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

Comparing PApp-SQL/SQL.xs (file contents):
Revision 1.5 by root, Sun Apr 22 14:38:28 2001 UTC vs.
Revision 1.6 by root, Sun Apr 22 17:03:28 2001 UTC

166 } 166 }
167} 167}
168 168
169static GV *sql_exec; 169static GV *sql_exec;
170static GV *DBH; 170static GV *DBH;
171static SV *sv_prepare, *sv_execute, *sv_bind_columns, *sv_fetchrow_arrayref, *sv_finish; 171static SV *sv_prepare, *sv_execute, *sv_bind_columns,
172 *sv_fetchrow_arrayref, *sv_fetchall_arrayref,
173 *sv_finish;
172 174
173#define newconstpv(str) newSVpvn ((str), sizeof (str)) 175#define newconstpv(str) newSVpvn ((str), sizeof (str))
174 176
175MODULE = PApp::SQL PACKAGE = PApp::SQL 177MODULE = PApp::SQL PACKAGE = PApp::SQL
176 178
185 { 187 {
186 sv_prepare = newconstpv ("prepare"); 188 sv_prepare = newconstpv ("prepare");
187 sv_execute = newconstpv ("execute"); 189 sv_execute = newconstpv ("execute");
188 sv_bind_columns = newconstpv ("bind_columns"); 190 sv_bind_columns = newconstpv ("bind_columns");
189 sv_fetchrow_arrayref = newconstpv ("fetchrow_arrayref"); 191 sv_fetchrow_arrayref = newconstpv ("fetchrow_arrayref");
192 sv_fetchall_arrayref = newconstpv ("fetchall_arrayref");
190 sv_finish = newconstpv ("finish"); 193 sv_finish = newconstpv ("finish");
191 } 194 }
192 195
193 /* apache might BOOT: twice :( */ 196 /* apache might BOOT: twice :( */
194 if (lru_size) 197 if (lru_size)
401 SV *rows; 404 SV *rows;
402 405
403 PUSHMARK (SP); 406 PUSHMARK (SP);
404 XPUSHs (sth); 407 XPUSHs (sth);
405 PUTBACK; 408 PUTBACK;
406 count = call_sv (sv_fetchrow_arrayref, G_METHOD | G_SCALAR); 409 count = call_sv (sv_fetchall_arrayref, G_METHOD | G_SCALAR);
407 SPAGAIN; 410 SPAGAIN;
408 411
409 if (count != 1) 412 if (count != 1)
410 abort (); 413 abort ();
411 414
416 AV *av = (AV *)SvRV (rows); 419 AV *av = (AV *)SvRV (rows);
417 count = AvFILL (av) + 1; 420 count = AvFILL (av) + 1;
418 421
419 if (count) 422 if (count)
420 { 423 {
421 int columns = AvFILL ((AV *)SvRV (AvARRAY(av)[0])) + 1; /* columns? */ 424 int columns = AvFILL ((AV *) SvRV (AvARRAY (av)[0])) + 1; /* columns? */
422 425
423 EXTEND (SP, count); 426 EXTEND (SP, count);
424 if (columns == 1) 427 if (columns == 1)
425 for (arg = 0; arg < count; arg++) 428 for (arg = 0; arg < count; arg++)
426 PUSHs (maybe_force_utf8 (ix & 1, AvARRAY ((AV *)SvRV (AvARRAY (av)[arg]))[0])); 429 PUSHs (maybe_force_utf8 (ix & 1, AvARRAY ((AV *)SvRV (AvARRAY (av)[arg]))[0]));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines