FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » SQLITE_SCHEMA error with php 5.3
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: SQLITE_SCHEMA error with php 5.3 [message #174924 is a reply to message #174923] Mon, 18 July 2011 09:58 Go to previous messageGo to previous message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma:
Senior Member
El 18/07/2011 11:01, luigi escribió/wrote:
> I am getting this error (something like once a day) on a php5.3
> box.
> Do you know how this can be fixed?
>
> I have seen on the SQlite FAQ that this should not happen using
> sqlite3_prepare_v2() instead of sqlite3_prepare() in the C api: do you
> know which function pdo uses internally?

Having a look at the PHP source code for 5.3.x, it seems it uses the
same code as the sqlite3 extension:

http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/ext/pdo_sqlite/sqlit e_driver.c?view=markup

static int sqlite_handle_preparer(pdo_dbh_t *dbh, const char *sql, long
sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
{
[...]
i = sqlite3_prepare(H->db, sql, sql_len, &S->stmt, &tail);

And such extension has references to both of them:

http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/ext/sqlite3/libsqlit e/sqlite3.c?view=markup

** The sqlite3_exec() interface is a convenience wrapper around
** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()],
** that allows an application to run multiple statements of SQL
** without having to use a lot of C code.

** ^The authorizer callback is invoked as SQL statements are being compiled
** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()],
** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()]. ^At various


So I guess it tries to autodetect but uses sqlite3_prepare_v2() when
available.

I hope this helps.



--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Stats comp.lang.php (last 7 days)
Next Topic: Geodetic functions library GeoDLL 32 Bit and 64 Bit
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 03:46:02 GMT 2024

Total time taken to generate the page: 0.03524 seconds