处理issue:gsql不同命令对MySQL语句兼容性不同

This commit is contained in:
lukeman
2024-01-24 16:48:14 +08:00
parent 36826f8914
commit 344c82d405

View File

@ -368,6 +368,14 @@ int MainLoop(FILE* source, char* querystring)
exit(EXIT_FAILURE);
}
/* Initialize current database compatibility */
PGresult* res = PQexec(pset.db, "show sql_compatibility");
if (res != NULL && PQresultStatus(res) == PGRES_TUPLES_OK) {
is_b_format = strcmp (PQgetvalue(res, 0, 0), "B") == 0;
}
PQclear(res);
res = NULL;
/* main loop to get queries and execute them */
while (successResult == EXIT_SUCCESS) {
/*