1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

Add the legacy_file_format pragma. (CVS 2922)

FossilOrigin-Name: b2dbd1a5b7f5a70049f25755f07b9c4c5116549b
This commit is contained in:
drh
2006-01-12 01:56:43 +00:00
parent 70ff98ab74
commit e321c29a7b
6 changed files with 41 additions and 15 deletions

View File

@@ -22,7 +22,7 @@
** COMMIT
** ROLLBACK
**
** $Id: build.c,v 1.377 2006/01/11 21:41:22 drh Exp $
** $Id: build.c,v 1.378 2006/01/12 01:56:44 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -833,6 +833,7 @@ void sqlite3StartTable(
*/
if( !db->init.busy && (v = sqlite3GetVdbe(pParse))!=0 ){
int lbl;
int fileFormat;
sqlite3BeginWriteOperation(pParse, 0, iDb);
/* If the file format and encoding in the database have not been set,
@@ -841,7 +842,9 @@ void sqlite3StartTable(
sqlite3VdbeAddOp(v, OP_ReadCookie, iDb, 1); /* file_format */
lbl = sqlite3VdbeMakeLabel(v);
sqlite3VdbeAddOp(v, OP_If, 0, lbl);
sqlite3VdbeAddOp(v, OP_Integer, SQLITE_DEFAULT_FILE_FORMAT, 0);
fileFormat = (db->flags & SQLITE_LegacyFileFmt)!=0 ?
1 : SQLITE_DEFAULT_FILE_FORMAT;
sqlite3VdbeAddOp(v, OP_Integer, fileFormat, 0);
sqlite3VdbeAddOp(v, OP_SetCookie, iDb, 1);
sqlite3VdbeAddOp(v, OP_Integer, ENC(db), 0);
sqlite3VdbeAddOp(v, OP_SetCookie, iDb, 4);