SyuTingSong / phpliteadmin

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

INSERT statemet quotes differs from CREATE when exporting data as SQL #198

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Export a table with data as default settings.

What is the expected output? What do you see instead?
CREATE statement uses single quotes for table name and fields but INSERT uses 
double quotes for table and fields and single quotes for values. I think that 
INSERT should use single quotes for all as CREATE statement or at least all 
must use the same quotes.

What version of the product are you using? On what operating system?
I'm using 1.9.4.

Which
Database Extension (PDO/SQLiteDatabase/SQLiteDatabase3 - see Database
structure-tab in phpLiteAdmin)?
I'm using PDO.

Original issue reported on code.google.com by is2cool...@gmail.com on 21 Mar 2013 at 10:42

GoogleCodeExporter commented 9 years ago
That's correct behaviour:
| CREATE statement uses single quotes for table name and fields
It uses what you used when you created the table. It doesn't touch the original 
create table statement at all.
Moreover, using single quotes in this context is correct, because when you 
create a table, the table name is a value, not a reference to an already 
existing db-object (because the table does not exist yet).

| INSERT uses double quotes for table and fields
Which is correct. See https://www.sqlite.org/lang_keywords.html .

| single quotes for values.
Which is correct. See https://www.sqlite.org/lang_keywords.html .

Original comment by crazy4ch...@gmail.com on 21 Mar 2013 at 1:15

GoogleCodeExporter commented 9 years ago
Ok, sorry con the inconvenience.
I've noticed the problem because when using the generated SQL I've needed 
change the double quotes to single quotes (instead of escape) to use inside a 
string. When warned about this I've think that was a problem not is real 
behavior..

Original comment by is2cool...@gmail.com on 21 Mar 2013 at 3:54