Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #2612
| From | "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: SQLITE_SCHEMA error with php 5.3 |
| Date | 2011-07-18 11:58 +0200 |
| Organization | http://alvaro.es/ |
| Message-ID | <j0103j$34e$1@dont-email.me> (permalink) |
| References | <5e79933c-f1a3-4914-855f-bc9c9db3aa2a@e21g2000vbz.googlegroups.com> |
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/sqlite_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/libsqlite/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
--
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
SQLITE_SCHEMA error with php 5.3 luigi <luigi.bardelli@gmail.com> - 2011-07-18 02:01 -0700
Re: SQLITE_SCHEMA error with php 5.3 "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2011-07-18 11:58 +0200
Re: SQLITE_SCHEMA error with php 5.3 luigi <luigi.bardelli@gmail.com> - 2011-07-18 03:24 -0700
csiph-web