lbehnke / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

improve console usability for MODE=MYSQL #72

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
when run in MySQL compatibility mode, the console doesn't accept SQL
statement with "" for field and table names. but when click on a table, it
generate SQL with quotes. 

It would be great if either:
1. the generated SQL statement doesn't use quote when connected in mysql
mode, or
2. the console automatically remove "" before sending the sql statement to
the engine

Original issue reported on code.google.com by mingfai...@gmail.com on 27 Mar 2009 at 12:17

GoogleCodeExporter commented 9 years ago
> when run in MySQL compatibility mode, 
> the console doesn't accept SQL
> statement with "" for field and table names.

I can't reproduce this, it works for me:

jdbc:h2:~/test;MODE=MYSQL
DROP TABLE IF EXISTS TEST;
CREATE TABLE "TEST"("ID" INT PRIMARY KEY, "NAME" VARCHAR(255));
select * from test;

Works. What is your test case?

> the console automatically remove "" before sending 
> the sql statement to the engine

The Console doesn't know about the mode. Also, the Console never changes the SQL
statement before sending to the database.

Original comment by thomas.t...@gmail.com on 28 Mar 2009 at 4:39

GoogleCodeExporter commented 9 years ago
the issue is not about create-drop table but query.  If u click on any table 
name,(on ant table name at the left 
hand side list) or use autocomplete, the table names are generated with quote. 
There is no problem in 
normal mode but when run in mysql mode, it doesn't support a sql statement with 
table name quoted.

Perhaps the autocomplete and click-on-table-name should simply never use quote?

Original comment by mingfai...@gmail.com on 29 Mar 2009 at 1:48

GoogleCodeExporter commented 9 years ago
E.g. If u hv a test table, when u click on TEST, it generate a sql 
  select * from "test"

That won't work in mysql mode (which is a correct behavior)

Original comment by mingfai...@gmail.com on 29 Mar 2009 at 1:52

GoogleCodeExporter commented 9 years ago
Thanks! Now I understand the problem. I will have a look.

Original comment by thomas.t...@gmail.com on 31 Mar 2009 at 3:33

GoogleCodeExporter commented 9 years ago

Original comment by thomas.t...@gmail.com on 31 Mar 2009 at 3:37

GoogleCodeExporter commented 9 years ago
This should be fixed with todays release (1.1.110).

Original comment by thomas.t...@gmail.com on 3 Apr 2009 at 3:59