summaryrefslogtreecommitdiff
path: root/ext/sqlite/sess_sqlite.c
diff options
context:
space:
mode:
authorSterling Hughes <sterling@php.net>2003-07-02 03:12:06 +0000
committerSterling Hughes <sterling@php.net>2003-07-02 03:12:06 +0000
commite724e4cbdb9da66e6dfde6bc151581616854bcfb (patch)
treed82bfb07a973fb126afb093e6acfd5500660d4f5 /ext/sqlite/sess_sqlite.c
parent4239cc4256d0d202b9af64e4ebc6d054da75f309 (diff)
downloadphp-git-e724e4cbdb9da66e6dfde6bc151581616854bcfb.tar.gz
further improve the performance and clean up
Diffstat (limited to 'ext/sqlite/sess_sqlite.c')
-rw-r--r--ext/sqlite/sess_sqlite.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/sqlite/sess_sqlite.c b/ext/sqlite/sess_sqlite.c
index bbdd4d7923..2a3780bdb2 100644
--- a/ext/sqlite/sess_sqlite.c
+++ b/ext/sqlite/sess_sqlite.c
@@ -44,7 +44,8 @@ PS_OPEN_FUNC(sqlite)
/* TODO: do we need a safe_mode check here? */
db = sqlite_open(save_path, 0666, &errmsg);
if (db == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLite: failed to open/create session database `%s' - %s", save_path, errmsg);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ "SQLite: failed to open/create session database `%s' - %s", save_path, errmsg);
sqlite_freemem(errmsg);
return FAILURE;
}
@@ -53,13 +54,15 @@ PS_OPEN_FUNC(sqlite)
sqlite_busy_timeout(db, 60000);
sqlite_exec(db, "PRAGMA default_synchronous = OFF", NULL, NULL, NULL);
-
+ sqlite_exec(db, "PRAGMA count_changes = OFF", NULL, NULL, NULL);
+
/* This will fail if the table already exists, but that's not a big problem. I'm
unclear as to how to check for a table's existence in SQLite -- that would be better here. */
sqlite_exec(db,
"CREATE TABLE session_data ("
- " sess_id TEXT PRIMARY KEY,"
- " value TEXT, updated INTEGER "
+ " sess_id PRIMARY KEY,"
+ " value TEXT, "
+ " updated INTEGER "
")", NULL, NULL, NULL);
PS_SET_MOD_DATA(db);