SQLITE_SCHEMA error with php 5.3 [message #174923] |
Mon, 18 July 2011 09:01 |
luigi
Messages: 2 Registered: July 2011
Karma: 0
|
Junior Member |
|
|
Hi,
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?
thanks!!!!
|
|
|
Re: SQLITE_SCHEMA error with php 5.3 [message #174924 is a reply to message #174923] |
Mon, 18 July 2011 09:58 |
alvaro.NOSPAMTHANX
Messages: 277 Registered: September 2010
Karma: 0
|
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
--
|
|
|
Re: SQLITE_SCHEMA error with php 5.3 [message #174925 is a reply to message #174924] |
Mon, 18 July 2011 10:24 |
luigi
Messages: 2 Registered: July 2011
Karma: 0
|
Junior Member |
|
|
On 18 Lug, 11:58, "Álvaro G. Vicario"
<alvaro.NOSPAMTH...@demogracia.com.invalid> wrote:
> 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...
>
> 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/li...
>
> ** 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
> --
Hi Alvaro,
thanks: do you know what is used in pdo::prepare?
I keep having this error... how to avoid it?
thanks!
|
|
|