Skip to content

Commit

Permalink
Revert "db/drivers/odbc: set ODBC MySQL DB backend SQL ANSI_QUOTES MO…
Browse files Browse the repository at this point in the history
…DE (OSGeo#3635)"

This reverts commit 5f6977e.
  • Loading branch information
tmszi committed Apr 22, 2024
1 parent a51275b commit 32916ea
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions db/drivers/odbc/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ int db__driver_open_database(dbHandle *handle)
SQLRETURN ret;
SQLINTEGER err;
dbConnection connection;
SQLCHAR dbms_name[256];

/* Open connection */
if (open_connection() != DB_OK)
Expand All @@ -40,30 +39,6 @@ int db__driver_open_database(dbHandle *handle)
return DB_FAILED;
}

/* Find ODBC DB driver */
SQLGetInfo(ODconn, SQL_DBMS_NAME, (SQLPOINTER)dbms_name, sizeof(dbms_name),
NULL);

if (strcmp((CHAR *)dbms_name, "MySQL") == 0 ||
strcmp((CHAR *)dbms_name, "MariaDB") == 0) {
cursor *c;

c = alloc_cursor();
if (c == NULL)
return DB_FAILED;

/* Set SQL ANSI_QUOTES MODE which allow to use double quotes instead of
* backticks */
SQLExecDirect(c->stmt, (SQLCHAR *)"SET SQL_MODE=ANSI_QUOTES", SQL_NTS);

G_debug(
3,
"db__driver_open_database(): Set ODBC %s DB SQL ANSI_QUOTES MODE",
dbms_name);

free_cursor(c);
}

return DB_OK;
}

Expand Down

0 comments on commit 32916ea

Please sign in to comment.