~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_log.c

  • Committer: Brian Aker
  • Date: 2008-07-14 22:18:37 UTC
  • mfrom: (77.1.96 codestyle)
  • Revision ID: brian@tangent.org-20080714221837-oceoshx7fjkla9u3
Merge from Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
                 const uchar *buffert, uint length)
65
65
{
66
66
  uchar buff[11];
67
 
  int error,old_errno;
 
67
  int old_errno;
68
68
  ulong pid=(ulong) GETPID();
69
69
  old_errno=my_errno;
70
70
  bzero(buff,sizeof(buff));
74
74
  mi_int2store(buff+9,length);
75
75
 
76
76
  pthread_mutex_lock(&THR_LOCK_myisam);
77
 
  error=my_lock(myisam_log_file,F_WRLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE));
78
77
  VOID(my_write(myisam_log_file,buff,sizeof(buff),MYF(0)));
79
78
  VOID(my_write(myisam_log_file,buffert,length,MYF(0)));
80
 
  if (!error)
81
 
    error=my_lock(myisam_log_file,F_UNLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE));
82
79
  pthread_mutex_unlock(&THR_LOCK_myisam);
83
80
  my_errno=old_errno;
84
81
}
88
85
                         const uchar *buffert, uint length, int result)
89
86
{
90
87
  uchar buff[9];
91
 
  int error,old_errno;
 
88
  int old_errno;
92
89
  ulong pid=(ulong) GETPID();
93
90
 
94
91
  old_errno=my_errno;
97
94
  mi_int4store(buff+3,pid);
98
95
  mi_int2store(buff+7,result);
99
96
  pthread_mutex_lock(&THR_LOCK_myisam);
100
 
  error=my_lock(myisam_log_file,F_WRLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE));
101
97
  VOID(my_write(myisam_log_file,buff,sizeof(buff),MYF(0)));
102
98
  if (buffert)
103
99
    VOID(my_write(myisam_log_file,buffert,length,MYF(0)));
104
 
  if (!error)
105
 
    error=my_lock(myisam_log_file,F_UNLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE));
106
100
  pthread_mutex_unlock(&THR_LOCK_myisam);
107
101
  my_errno=old_errno;
108
102
}
112
106
                        const uchar *record, my_off_t filepos, int result)
113
107
{
114
108
  uchar buff[21],*pos;
115
 
  int error,old_errno;
 
109
  int old_errno;
116
110
  uint length;
117
111
  ulong pid=(ulong) GETPID();
118
112
 
128
122
  mi_sizestore(buff+9,filepos);
129
123
  mi_int4store(buff+17,length);
130
124
  pthread_mutex_lock(&THR_LOCK_myisam);
131
 
  error=my_lock(myisam_log_file,F_WRLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE));
132
125
  VOID(my_write(myisam_log_file, buff,sizeof(buff),MYF(0)));
133
126
  VOID(my_write(myisam_log_file, record,info->s->base.reclength,MYF(0)));
134
127
  if (info->s->base.blobs)
144
137
      VOID(my_write(myisam_log_file,pos,blob->length,MYF(0)));
145
138
    }
146
139
  }
147
 
  if (!error)
148
 
    error=my_lock(myisam_log_file,F_UNLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE));
149
140
  pthread_mutex_unlock(&THR_LOCK_myisam);
150
141
  my_errno=old_errno;
151
142
}