** Return true if zSql is a complete SQL statement. Return false if it ** ends in the middle of a string literal or C-style comment. */
| 1311 | ** ends in the middle of a string literal or C-style comment. |
| 1312 | */ |
| 1313 | static int _is_complete(char *zSql, int nSql){ |
| 1314 | int rc; |
| 1315 | if( zSql==0 ) return 1; |
| 1316 | zSql[nSql] = ';'; |
| 1317 | zSql[nSql+1] = 0; |
| 1318 | rc = sqlite3_complete(zSql); |
| 1319 | zSql[nSql] = 0; |
| 1320 | return rc; |
| 1321 | } |
| 1322 | /* |
| 1323 | ** Return TRUE if a semicolon occurs anywhere in the first N characters |
| 1324 | ** of string z[]. |