Merge branch '2.3' into 2.4

This commit is contained in:
Johan Wikman 2020-12-16 10:06:38 +02:00
commit f496ab07eb
2 changed files with 30 additions and 2 deletions

View File

@ -679,7 +679,7 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){
if (pParse) {
if (z != (const unsigned char *)pParse->zTail) {
const char *p = (const char*)z - 1;
while ((p != pParse->zTail) && sqlite3Isspace(*p)) {
while ((p != pParse->zTail) && sqlite3Isspace(*p) && *p != '\n') {
--p;
}

View File

@ -1530,6 +1530,7 @@ int main(int argc, char* argv[])
string classifier2Args("log_unrecognized_statements=1");
version = 10 * 1000 * 2 * 100;
#endif
string statement;
const char* zStatement = NULL;
qc_sql_mode_t sql_mode = QC_SQL_MODE_DEFAULT;
bool solo = false;
@ -1581,7 +1582,34 @@ int main(int argc, char* argv[])
break;
case 's':
zStatement = optarg;
{
const char* z = optarg;
while (*z)
{
switch (*z)
{
case '\\':
if (*(z + 1) == 'n')
{
statement += '\n';
++z;
}
else
{
statement += *z;
}
break;
default:
statement += *z;
}
++z;
}
zStatement = statement.c_str();
}
break;
case 'm':