html5sql icon indicating copy to clipboard operation
html5sql copied to clipboard

Double quotes inside SQL strings cause crashes

Open AndreaSpinelli opened this issue 11 years ago • 0 comments

Hi, cute piece of software!

The following code crashes:

var sql = 'insert into foo (bar) values ('baz " biz') ; insert into foo (bar) values ('barbaz'); html5sql.process(sql, function() {});

Trying to debug, I found that at line 99 of html5sql.js the input string is split in two, and the splice on line 102 is executed repeatedly, until i+1 goes outside the array and the program crashes.

I guess that the split at line 95 must be substituted by something more complex.

Thanks in advance for your attention.

AndreaSpinelli avatar May 20 '14 16:05 AndreaSpinelli