Page 1 of 1

mysql5-specific bug or feature

Posted: Tue 11 Mar 2008 04:55
by cyrilo
my app (D7 with 5.20.1.14) designed for mysql server 4.1
I'm upgraded to mysql 5.0 and found problem with TMyTable - it's not working with mysql 5.0.41 (community, win32).

Example:
mysql 4.1

Code: Select all

use test;
SELECT * from table1
OK

Code: Select all

SELECT * from test.table1
OK

mysql 5.0

Code: Select all

use test;
SELECT * from table1
error in SQL query

Code: Select all

SELECT * from test.table1
OK

TMyTable is use SQL-query "SELECT * from table1" for fetching data from table. When application tried to open TMyTable, exception is raised every time.

Posted: Tue 11 Mar 2008 08:09
by Antaeus
I could not reproduce the problem. What is the exact error message?

Note, using the USE command in scripts that are executed with components of MyDAC is not recommended. It is better changing the TMyConnection.Database property.

Posted: Wed 12 Mar 2008 03:14
by cyrilo
Antaeus wrote:What is the exact error message?
in my real case:
#42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schemas ORDER BY Name' at line 1
My real SQL is (from DBMonitor log):

Code: Select all

SELECT * FROM schemas ORDER BY Name
I tried to launch this SQL in mysql command-line client and got the same error message.

Code: Select all

SELECT * FROM phone.schemas ORDER BY Name
executed successfully without any errors.
Antaeus wrote: Note, using the USE command in scripts that are executed with components of MyDAC is not recommended.
I never use USE command with MyDAC. It's only for better understanding of my example.

Posted: Thu 13 Mar 2008 15:33
by Antaeus
You should quote schemas. Set the QuoteNames option of TMyQuery to True.

Posted: Sat 15 Mar 2008 03:11
by cyrilo
with QuoteNames=True it works.
Thanks!