bffmm1 / h2database

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

Support semi-colons within single-quoted strings in RunScript #243

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following example breaks the RunScript tool.

INSERT INTO "text_table" VALUES (2352,'I like Chinese food; especially chicken 
lo mein.');

Workaround is to manually edit the script file.

Affects version 1.144.

Original issue reported on code.google.com by James.Mo...@gmail.com on 25 Oct 2010 at 12:50

GoogleCodeExporter commented 9 years ago
I can't reproduce the problem.

Original comment by thomas.t...@gmail.com on 25 Oct 2010 at 6:29

GoogleCodeExporter commented 9 years ago
Ok.  You are right.  I think the semi-colon was a red herring.  My import 
script must have an error somewhere else and the H2 exception stops at the 
first semi colon it finds?  Not sure.

I will trying to isolate the issue and possibly provide a script if it looks 
like there is an import bug.  Thanks.

Original comment by James.Mo...@gmail.com on 25 Oct 2010 at 7:56

GoogleCodeExporter commented 9 years ago
It looks like this is really the other issue I reported - 242 single quote 
escaping \' within single-quoted string:

CREATE TABLE text_table (
  id int(10) unsigned NOT NULL,
  content text NOT NULL,
  PRIMARY KEY  (id)
);
INSERT INTO text_table VALUES (1, 'Marks dog likes lo mein.');
INSERT INTO text_table VALUES (2, 'Mark's dog likes lo mein.');
INSERT INTO text_table VALUES (3, 'Mark\'s dog likes lo mein.');

Original comment by James.Mo...@gmail.com on 25 Oct 2010 at 8:20

GoogleCodeExporter commented 9 years ago
Instead of H2 supporting the non-standard MySQL syntax, what about configuring
MySQL to use the ANSI SQL syntax? This would work for all databases:

http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html#sqlmode_no_backslash
_escapes

Original comment by thomas.t...@gmail.com on 28 Oct 2010 at 6:42