Page 1 of 1

DatabaseExplorer - SQL Parsing Issues

Posted: Thu Jun 15, 2017 12:16 am
by chaddcw
I've been working with MySQL and SQLite (on Linux) via the SqlCommandPanel and have found a number of SQL parsing errors. I've also got fixes for some of the following bugs.

What is the preferred process to handle this? Should I open Issues on GitHub and then make pull requests against those?

I've outlined my findings below.


1) History is not updated correctly in SQLCommandPanel if ; appears in a search string and comments are not always removed.

Code: Select all

select * from People where LName not like '%a%'; -- test comment
select * from People where LName not like '%;%';
2) Unicode in SQL statements is not handled correctly in MysqlDatabaseLayer

Code: Select all

select * from People where LName not like '%☺%'; 

3) A Comment at the end of a SQL statement is not filtered out correctly by SQLCommandPanel::ExecuteSQL() and is not filtered out by DatabaseQueryParser.cpp (maybe could be fixed by using the new, fixed output of ParseSql() from the solution to 1)

Also,

Code: Select all

 "%;%"
is parsed incorrectly in DatabaseQueryParser.cpp

Code: Select all

	select * from People; -- TEST
	select * from People where LName not like "%;%";

Re: DatabaseExplorer - SQL Parsing Issues

Posted: Thu Jun 15, 2017 1:04 am
by eranif
GitHub pull request is the best way