summaryrefslogtreecommitdiff
path: root/ext/pdo_sqlite/sqlite/src/complete.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo_sqlite/sqlite/src/complete.c')
-rw-r--r--ext/pdo_sqlite/sqlite/src/complete.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/ext/pdo_sqlite/sqlite/src/complete.c b/ext/pdo_sqlite/sqlite/src/complete.c
index 660417b066..f35ca86485 100644
--- a/ext/pdo_sqlite/sqlite/src/complete.c
+++ b/ext/pdo_sqlite/sqlite/src/complete.c
@@ -24,8 +24,16 @@
/*
** This is defined in tokenize.c. We just have to import the definition.
*/
-extern const char sqlite3IsIdChar[];
-#define IdChar(C) (((c=C)&0x80)!=0 || (c>0x1f && sqlite3IsIdChar[c-0x20]))
+#ifndef SQLITE_AMALGAMATION
+#ifdef SQLITE_ASCII
+extern const char sqlite3IsAsciiIdChar[];
+#define IdChar(C) (((c=C)&0x80)!=0 || (c>0x1f && sqlite3IsAsciiIdChar[c-0x20]))
+#endif
+#ifdef SQLITE_EBCDIC
+extern const char sqlite3IsEbcdicIdChar[];
+#define IdChar(C) (((c=C)>=0x42 && sqlite3IsEbcdicIdChar[c-0x40]))
+#endif
+#endif /* SQLITE_AMALGAMATION */
/*
@@ -248,9 +256,9 @@ int sqlite3_complete(const char *zSql){
int sqlite3_complete16(const void *zSql){
sqlite3_value *pVal;
char const *zSql8;
- int rc = 0;
+ int rc = SQLITE_NOMEM;
- pVal = sqlite3ValueNew();
+ pVal = sqlite3ValueNew(0);
sqlite3ValueSetStr(pVal, -1, zSql, SQLITE_UTF16NATIVE, SQLITE_STATIC);
zSql8 = sqlite3ValueText(pVal, SQLITE_UTF8);
if( zSql8 ){