1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-15 11:41:13 +03:00

Fix a bug in pragma table_info. Column default values specified as negative numbers (col DEFAULT -1) were being reported as NULL by the pragma. (CVS 5839)

FossilOrigin-Name: 0e448bc6096c7ee3b21dbd22dc4ca9470ae7ba31
This commit is contained in:
danielk1977
2008-10-23 05:45:07 +00:00
parent b1cd7308dc
commit f96a3778f9
5 changed files with 36 additions and 15 deletions

View File

@@ -11,7 +11,7 @@
*************************************************************************
** This file contains code used to implement the PRAGMA command.
**
** $Id: pragma.c,v 1.190 2008/10/17 18:51:53 danielk1977 Exp $
** $Id: pragma.c,v 1.191 2008/10/23 05:45:07 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -777,7 +777,7 @@ void sqlite3Pragma(
sqlite3VdbeAddOp4(v, OP_String8, 0, 2, 0, pCol->zName, 0);
sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0,
pCol->zType ? pCol->zType : "", 0);
sqlite3VdbeAddOp2(v, OP_Integer, pCol->notNull, 4);
sqlite3VdbeAddOp2(v, OP_Integer, (pCol->notNull ? 1 : 0), 4);
if( pCol->pDflt && (pDflt = &pCol->pDflt->span)->z ){
sqlite3VdbeAddOp4(v, OP_String8, 0, 5, 0, (char*)pDflt->z, pDflt->n);
}else{