ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro-Mysql/Mysql.xs
(Generate patch)

Comparing Coro-Mysql/Mysql.xs (file contents):
Revision 1.7 by root, Thu Feb 17 02:05:15 2011 UTC vs.
Revision 1.8 by root, Thu Jul 26 21:38:00 2012 UTC

37 char buf[VIO_READ_BUFFER_SIZE]; 37 char buf[VIO_READ_BUFFER_SIZE];
38} ourdata; 38} ourdata;
39 39
40#define OURDATAPTR (*((ourdata **)((vio)->desc + DESC_OFFSET))) 40#define OURDATAPTR (*((ourdata **)((vio)->desc + DESC_OFFSET)))
41 41
42static int 42static xlen
43our_read (Vio *vio, xgptr p, int len) 43our_read (Vio *vio, xgptr p, xlen len)
44{ 44{
45 ourdata *our = OURDATAPTR; 45 ourdata *our = OURDATAPTR;
46 46
47 if (!our->bufcnt) 47 if (!our->bufcnt)
48 { 48 {
92 our->bufcnt -= len; 92 our->bufcnt -= len;
93 93
94 return len; 94 return len;
95} 95}
96 96
97static int 97static xlen
98our_write (Vio *vio, const xgptr p, int len) 98our_write (Vio *vio, cxgptr p, xlen len)
99{ 99{
100 char *ptr = (char *)p; 100 char *ptr = (char *)p;
101 my_bool dummy; 101 my_bool dummy;
102 102
103 vio->vioblocking (vio, 0, &dummy); 103 vio->vioblocking (vio, 0, &dummy);
213 213
214 XPUSHs (use_ev ? &PL_sv_yes : &PL_sv_no); 214 XPUSHs (use_ev ? &PL_sv_yes : &PL_sv_no);
215} 215}
216 216
217void 217void
218_patch (IV sock, int fd, SV *corohandle_sv, SV *corohandle) 218_patch (IV sock, int fd, unsigned long client_version, SV *corohandle_sv, SV *corohandle)
219 CODE: 219 CODE:
220{ 220{
221 MYSQL *my = (MYSQL *)sock; 221 MYSQL *my = (MYSQL *)sock;
222 Vio *vio = my->net.vio; 222 Vio *vio = my->net.vio;
223 ourdata *our; 223 ourdata *our;
224
225 /* matching versions are required but not sufficient */
226 if (client_version != mysql_get_client_version ())
227 croak ("DBD::mysql linked against different libmysqlclient library than Coro::Mysql (%lu vs. %lu).",
228 client_version, mysql_get_client_version ());
224 229
225 if (fd != my->net.fd) 230 if (fd != my->net.fd)
226 croak ("DBD::mysql fd and libmysql disagree - library mismatch, unsupported transport or API changes?"); 231 croak ("DBD::mysql fd and libmysql disagree - library mismatch, unsupported transport or API changes?");
227 232
228 if (fd != vio->sd) 233 if (fd != vio->sd)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines