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.8 by root, Sat Aug 11 02:46:16 2001 UTC vs.
Revision 1.11 by root, Wed Feb 27 04:32:39 2002 UTC

6# define get_sv perl_get_sv 6# define get_sv perl_get_sv
7# define call_method perl_call_method 7# define call_method perl_call_method
8# define call_sv perl_call_sv 8# define call_sv perl_call_sv
9#endif 9#endif
10 10
11#if (PERL_VERSION < 5) || ((PERL_VERSION == 5) && (PERL_SUBVERSION <= 5)) 11#if (PERL_VERSION > 5) || ((PERL_VERSION == 5) && (PERL_SUBVERSION >= 6))
12# define CAN_UTF8 1 12# define CAN_UTF8 1
13#endif 13#endif
14 14
15static SV * 15static SV *
16sql_upgrade_utf8 (SV *sv) 16sql_upgrade_utf8 (SV *sv)
225 int count; 225 int count;
226 SV *dbh = ST(0); 226 SV *dbh = ST(0);
227 SV *sth; 227 SV *sth;
228 SV *sql; 228 SV *sql;
229 SV *execute; 229 SV *execute;
230 STRLEN dc; 230 STRLEN dc, dd; /* dummy */
231 231
232 /* save our arguments against destruction through function calls */ 232 /* save our arguments against destruction through function calls */
233 SP += items; 233 SP += items;
234 234
235 /* first check wether we should use an explicit db handle */ 235 /* first check wether we should use an explicit db handle */
284 SPAGAIN; 284 SPAGAIN;
285 285
286 if (count != 1) 286 if (count != 1)
287 croak ("sql_exec: unable to prepare() statement '%s': %s", 287 croak ("sql_exec: unable to prepare() statement '%s': %s",
288 SvPV (sql, dc), 288 SvPV (sql, dc),
289 SvPV (get_sv ("DBI::errstr", TRUE), dc)); 289 SvPV (get_sv ("DBI::errstr", TRUE), dd));
290 290
291 sth = POPs; 291 sth = POPs;
292 292
293 lru_store (dbh, sql, sth); 293 lru_store (dbh, sql, sth);
294 } 294 }
311 SPAGAIN; 311 SPAGAIN;
312 312
313 if (count != 1) 313 if (count != 1)
314 croak ("sql_exec: execute() didn't return any value ('%s'): %s", 314 croak ("sql_exec: execute() didn't return any value ('%s'): %s",
315 SvPV (sql, dc), 315 SvPV (sql, dc),
316 SvPV (get_sv ("DBI::errstr", TRUE), dc)); 316 SvPV (get_sv ("DBI::errstr", TRUE), dd));
317 317
318 execute = POPs; 318 execute = POPs;
319 319
320 if (!SvTRUE (execute)) 320 if (!SvTRUE (execute))
321 croak ("sql_exec: unable to execute statement '%s' (%s)", 321 croak ("sql_exec: unable to execute statement '%s' (%s)",
322 SvPV (sql, dc), 322 SvPV (sql, dc),
323 SvPV (get_sv ("DBI::errstr", TRUE), dc)); 323 SvPV (get_sv ("DBI::errstr", TRUE), dd));
324 324
325 sv_setsv (GvSV(sql_exec), execute); 325 sv_setsv (GvSV(sql_exec), execute);
326 326
327 if (bind_first != bind_last) 327 if (bind_first != bind_last)
328 { 328 {
339 SPAGAIN; 339 SPAGAIN;
340 340
341 if (count != 1) 341 if (count != 1)
342 croak ("sql_exec: bind_columns() didn't return any value ('%s'): %s", 342 croak ("sql_exec: bind_columns() didn't return any value ('%s'): %s",
343 SvPV (sql, dc), 343 SvPV (sql, dc),
344 SvPV (get_sv ("DBI::errstr", TRUE), dc)); 344 SvPV (get_sv ("DBI::errstr", TRUE), dd));
345 345
346 if (!SvOK (POPs)) 346 if (!SvOK (POPs))
347 croak ("sql_exec: bind_columns() didn't return a true ('%s'): %s", 347 croak ("sql_exec: bind_columns() didn't return a true ('%s'): %s",
348 SvPV (sql, dc), 348 SvPV (sql, dc),
349 SvPV (get_sv ("DBI::errstr", TRUE), dc)); 349 SvPV (get_sv ("DBI::errstr", TRUE), dd));
350 } 350 }
351 351
352 /* free our arguments from the stack */ 352 /* free our arguments from the stack */
353 SP -= items; 353 SP -= items;
354 354

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines