--- PApp-SQL/SQL.xs 2002/11/07 01:57:58 1.15 +++ PApp-SQL/SQL.xs 2008/01/19 07:38:52 1.19 @@ -64,7 +64,7 @@ /* this is primitive, yet effective */ /* the returned value must never be zero (or bad things will happen) */ #define lru_hash do { \ - hash = (((U32)dbh)>>2); \ + hash = (((U32)(long)dbh)>>2); \ hash += *statement;\ hash += len; \ } while (0) @@ -339,6 +339,10 @@ EXTEND (SP, bind_last - bind_first + 2); PUSHs (sth); do { +#if CAN_UTF8 + if (ix & 1) + SvUTF8_on (SvRV(ST(bind_first))); +#endif PUSHs (ST(bind_first)); bind_first++; } while (bind_first != bind_last); @@ -352,13 +356,15 @@ SvPV (sql, dc), SvPV (get_sv ("DBI::errstr", TRUE), dd)); - if (!SvOK (POPs)) + if (!SvOK (TOPs)) croak ("sql_exec: bind_columns() didn't return a true ('%s'): %s", SvPV (sql, dc), SvPV (get_sv ("DBI::errstr", TRUE), dd)); + + POPs; } - /* free our arguments from the stack */ + /* restore our arguments again */ SP -= items; if ((ix & ~1) == 2)