[MDEV-22780] CONNECT+ODBC - UPDATE and DELETE queries contains unwanted MariaDB database name Created: 2020-06-02 Updated: 2020-07-08 Resolved: 2020-07-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Connect |
| Affects Version/s: | 10.4.13 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Critical |
| Reporter: | Ján Regeš | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | ODBC, connect-engine | ||
| Environment: |
Debian Buster |
||
| Description |
|
Hi, i have CONNECT table created table "company__contract" in MariaDB database "myproject", by command below. This table is connected to MSSQL schema "externaldatabase" on server "mydsn" (defined properly by FreeTDS + UnixODBC). Select and insert into table works properly, but UPDATE or DELETE queries produced by CONNECT/ODBC engine generates unwanted "myproject" prefix into MSSQL queries. String "myproject" is name of MariaDB database, not MSSQL database. Proper name of MSSQL database/schema is "externaldatabase" defined by DATABASE in CONNECTION. Here are queries recorded by tracing in FreeTDS/UnixODBC: SELECT (OK): SELECT id, note FROM dbo.contract UPDATE or DELETE of course ends by an error Invalid object name 'myproject.dbo.contract'. I tried any "hacks" with DBNAME, DATABASE, SCHEMA, CATALOG, but i don't know, how to remove unwanted "myproject" from MSSQL query. I read whole documentation about ODBC and CONNECT engine, but nothing helps. Is there any option or workaround how to disable this invalid "prefixing", or override it to proper name "externaldatabase"? Thank you.
|
| Comments |
| Comment by Ján Regeš [ 2020-06-11 ] |
|
Hi, you can close this issue. After i read again this documentation https://mariadb.com/kb/en/connect-odbc-table-type-accessing-tables-from-another-dbms/#update-and-delete-commands Then I understood how the CONNECT engine would behave in the case of an UPDATE / DELETE query. CONNECT engine just simply replaces the table name and leaves the rest of the query in its original form. It makes sense. Query from my database client contained also MariaDB database name in UPDATE/DELETE query. That was cause of this issue. At least in the future, this ticket will respond to others who encounter a similar problem |