SQLITE_SCHEMA error with php 5.3

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
   I am getting this error (something like once a day) on a php5.3
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?


Re: SQLITE_SCHEMA error with php 5.3

El 18/07/2011 11:01, luigi escribió/wrote:
Quoted text here. Click to load it

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


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:


** 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

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

Re: SQLITE_SCHEMA error with php 5.3

On 18 Lug, 11:58, "=C1lvaro G. Vicario"
Quoted text here. Click to load it

Hi Alvaro,
   thanks: do you know what is used in pdo::prepare?
I keep having this error... how to avoid it?


Site Timeline