From b28b93d9abbb543f679272e08bd2ddb8ffe26d67 Mon Sep 17 00:00:00 2001 From: lukeman Date: Wed, 24 Jan 2024 16:48:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86issue=EF=BC=9Agsql=E4=B8=8D?= =?UTF-8?q?=E5=90=8C=E5=91=BD=E4=BB=A4=E5=AF=B9MySQL=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=80=A7=E4=B8=8D=E5=90=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bin/psql/mainloop.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/bin/psql/mainloop.cpp b/src/bin/psql/mainloop.cpp index 9953083d7..6813f6290 100644 --- a/src/bin/psql/mainloop.cpp +++ b/src/bin/psql/mainloop.cpp @@ -355,6 +355,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) { /*