Bug 57662

Summary: SQL Insert confuses the VALUES with the COLUMNS/FIELDS
Product: LibreOffice Reporter: emanuel.feruzi
Component: BaseAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED NOTABUG    
Severity: major CC: lionel, serval2412
Priority: medium    
Version: 3.5.4 release   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: Database

Description emanuel.feruzi 2012-11-28 20:51:13 UTC
Created attachment 70752 [details]
Database

I created the database with a countries table. See attachment.

When I run an insert statement:

INSERT INTO "countries" ("country", "short", "dialcode", "continentid") VALUES ("Tanzania", "TZ", 255, 0);

I get an error: 

5: Column not found: Tanzania
Comment 1 Julien Nabet 2012-11-28 21:02:15 UTC
On pc Debian x86-64 with 3.6 sources updated today, I reproduced this problem.

Lionel: it may interest you so put you on cc
Comment 2 Lionel Elie Mamane 2012-11-29 07:09:09 UTC
In ANSI SQL, strings are enclosed in simple quotes, not double quotes. The correct INSERT statement is:

INSERT INTO "countries" ("country", "short", "dialcode", "continentid") VALUES ('Tanzania', 'TZ', 255, 0);


In double quotes can *only* by identifiers (table names, column names, ...).