<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to bugs</title><link href="https://sourceforge.net/p/jsqlparser/bugs/" rel="alternate"/><link href="https://sourceforge.net/p/jsqlparser/bugs/feed.atom" rel="self"/><id>https://sourceforge.net/p/jsqlparser/bugs/</id><updated>2012-10-02T17:16:51Z</updated><subtitle>Recent changes to bugs</subtitle><entry><title>Some Parser Issues with subqueries</title><link href="https://sourceforge.net/p/jsqlparser/bugs/23/" rel="alternate"/><published>2012-10-02T17:16:51Z</published><updated>2012-10-02T17:16:51Z</updated><author><name>christian</name><uri>https://sourceforge.net/u/somefreestring/</uri></author><id>https://sourceforge.net669d262062a71c262c44319fd2e3ea42e1cf1cfd</id><summary type="html">Here is a very generic but \(almost\) everything covering select 

SELECT t1.col\_1
,col\_2 as column2
,t4.col\_3 \* \(4+2\) 
,t2.col\_4 +2 as column\_4\_plus\_2
,Concat\(a,b,c,d\)  as my\_sql\_func
,count\(\(select foo from bar where something is ture\)\) as sub\_query\_column
,custom\_function\(a,b,2\)
FROM t1 
,t2 t4
LEFT OUTER JOIN t3 as t5 ON t3.id = t1.id
,\(select foo from bar where something is ture\) as sub\_query\_table
WHERE \(t1.col\_1 like '% something %' OR \(col\_2=3 and t2.col\_4='hello world'\)\)
AND NOT EXISTS \(select foo from bar b where b.id = t1.id\)
GROUP BY t1.col\_1, col\_2, t4.col\_3 \* \(4+2\), t2.col\_4 +2 
HAVING count\(\*\) &amp;gt; 3
ORDER BY t1.col\_1 DESC
LIMIT 100;


The following statements are causing problems:

1\)  count\(\(select foo from bar where something is not null\)\) as sub\_query\_column

This is completly legal. 
On mysql test: 

mysql&amp;gt; select now\(\), count\(\(select now\(\) from dual\)\) from dual;
+---------------------+---------------------------------+
| now\(\)               | count\(\(select now\(\) from dual\)\) |
+---------------------+---------------------------------+
| 2012-10-02 19:06:01 |                               1 |
+---------------------+---------------------------------+
1 row in set \(0.01 sec\)


On Oracle XE:
SQL&amp;gt; select 'a', count\(\(select 'a' from dual\)\) from dual;

' COUNT\(\(SELECT'A'FROMDUAL\)\)
\- --------------------------
a                          1


2\) subselect in from 
,\(select foo from bar where something is ture\) as sub\_query\_table

</summary></entry><entry><title>De-parsing removes a space on joins</title><link href="https://sourceforge.net/p/jsqlparser/bugs/22/" rel="alternate"/><published>2012-08-01T08:33:12Z</published><updated>2012-08-01T08:33:12Z</updated><author><name>Luigi</name><uri>https://sourceforge.net/u/luigiiannone/</uri></author><id>https://sourceforge.net65cf86d130161d9099860e2cbb055ddc3e62f89d</id><summary type="html">The following code 

import java.io.StringReader;

import net.sf.jsqlparser.JSQLParserException;
import net.sf.jsqlparser.parser.CCJSqlParserManager;
import net.sf.jsqlparser.statement.Statement;
import net.sf.jsqlparser.util.deparser.StatementDeParser;

public class SelectDeparserTest \{
	public static void main\(String\[\] args\) throws JSQLParserException \{
		String originalSQL = "SELECT \* FROM BOB B RIGHT JOIN FRED F ON \(B.C=F.C\)";
		System.out.println\(originalSQL\);
		Statement parsed = new CCJSqlParserManager\(\).parse\(new StringReader\(
				originalSQL\)\);
		StringBuffer stringBuffer = new StringBuffer\(\);
		parsed.accept\(new StatementDeParser\(stringBuffer\)\);
		System.out.println\(stringBuffer\);
	\}
\}

when run has the following output

SELECT \* FROM BOB B RIGHT JOIN FRED F ON \(B.C=F.C\)
SELECT \* FROM BOB AS BRIGHT JOIN FRED AS F ON \(B.C = F.C\)

notice that the de-parsed query \(the second one\) lacks a white space between the alias for BOB, i.e.: B and the keyword RIGHT. The same happens for LEFT, INNER, OUTER, FULL, and simply JOIN</summary></entry><entry><title>Negative default values not handled correctly</title><link href="https://sourceforge.net/p/jsqlparser/bugs/21/" rel="alternate"/><published>2012-02-29T13:38:43Z</published><updated>2012-02-29T13:38:43Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.netb8a0e0aa4a44fc7adcb236c996f26be28d7c734f</id><summary type="html">A CREATE statement with default values that are negative are not handled correctly.  Please see the example below where the default value for MONTH is -1.

With &amp;lt;&amp;lt;QUERY&amp;gt;&amp;gt; = 
CREATE TABLE dim\_date\(
date DATE NOT NULL,
year INTEGER NOT NULL,
quarter INTEGER NOT NULL,
month INTEGER NOT NULL DEFAULT -1,
day INTEGER NOT NULL
\);

This test fails:

private CCJSqlParserManager sqlParser = new CCJSqlParserManager\(\);
Statement stmt = sqlParser.parse\(new StringReader\(&amp;lt;&amp;lt;QUERY&amp;gt;&amp;gt;\);
assertTrue\(stmt instanceof CreateTable\);

</summary></entry><entry><title>CROSS JOIN not supported</title><link href="https://sourceforge.net/p/jsqlparser/bugs/20/" rel="alternate"/><published>2012-01-25T13:37:43Z</published><updated>2012-01-25T13:37:43Z</updated><author><name>Eric Citaire</name><uri>https://sourceforge.net/u/userid-2055470/</uri></author><id>https://sourceforge.netd4a61f6532db6fdf3e53ae9c1281e5f8187a21f6</id><summary type="html">Encountered " &amp;lt;S\_IDENTIFIER&amp;gt; "cross "" at line 1, column 413.
Was expecting one of:
&amp;lt;EOF&amp;gt; 
"JOIN" ...
"LEFT" ...
"FULL" ...
"WHERE" ...
"GROUP" ...
"INNER" ...
"LIMIT" ...
"OUTER" ...
"ORDER" ...
"RIGHT" ...
"OFFSET" ...
"HAVING" ...
"NATURAL" ...
";" ...
"," ...
"LEFT" ...
"RIGHT" ...
"FULL" ...
"NATURAL" ...
"OUTER" ...
"INNER" ...
"JOIN" ...
"," ...
"WHERE" ...
"GROUP" ...
"HAVING" ...
"ORDER" ...
"LIMIT" ...
"OFFSET" ...
"LIMIT" ...</summary></entry><entry><title>case else bug</title><link href="https://sourceforge.net/p/jsqlparser/bugs/19/" rel="alternate"/><published>2012-01-24T08:00:31Z</published><updated>2012-01-24T08:00:31Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.netc1878d7118a3fe91bef85247135a7a17654ffce1</id><summary type="html">This sql statement should work: \(else 'el' || 'se'\)

select case when dummy = 'X' then 'XXX' else 'el' || 'se' end from dual

jsqlparser version: 0.7

java.text.ParseException: Encountered " "CASE" "case "" at line 1, column 8.
Was expecting one of:
"ALL" ...
"TOP" ...
"DISTINCT" ...
"\(" ...
"\*" ...
"ALL" ...
"DISTINCT" ...
"TOP" ...
"\*" ...
"\(" ...
</summary></entry><entry><title>or not bug</title><link href="https://sourceforge.net/p/jsqlparser/bugs/18/" rel="alternate"/><published>2012-01-24T07:57:39Z</published><updated>2012-01-24T07:57:39Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.netf436e392a4d091979b3f41a81809376c2864640f</id><summary type="html">This sql statement should work:

select dummy from dual where dummy like '%X%' or not dummy like '%A%'

jsqlparser version: 0.7

java.text.ParseException: Encountered " &amp;lt;S\_IDENTIFIER&amp;gt; "dummy "" at line 1, column 54.
Was expecting one of:
"\(" ...
</summary></entry><entry><title>and not bug</title><link href="https://sourceforge.net/p/jsqlparser/bugs/17/" rel="alternate"/><published>2012-01-24T07:41:23Z</published><updated>2012-01-24T07:41:23Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net3e7aed463e4e13ab64d7307246adb11de043c50d</id><summary type="html">This sql statement should work:

select dummy from dual where dummy like '%X%' and not dummy like '%A%'

jsqlparser version: 0.7

Stacktrace:
java.text.ParseException: Encountered " &amp;lt;S\_IDENTIFIER&amp;gt; "dummy "" at line 1, column 55.
Was expecting one of:
"\(" ...



</summary></entry><entry><title>Column names started with Numbers !</title><link href="https://sourceforge.net/p/jsqlparser/bugs/16/" rel="alternate"/><published>2011-11-21T07:06:27Z</published><updated>2011-11-21T07:06:27Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.netb2e34bf251491e4ca66b646ee34f3dd9a49b01ca</id><summary type="html">In Ms Sql Server \(2000\) you can create columns that their names started with digits. 
in parsin JSQLParser throws Exception</summary></entry><entry><title>Arabic Characters Comparison</title><link href="https://sourceforge.net/p/jsqlparser/bugs/15/" rel="alternate"/><published>2011-11-21T07:04:02Z</published><updated>2011-11-21T07:04:02Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net784fabf1a8449671260216ae160860ef4f7de40c</id><summary type="html">The Comparison of one String column with an Arabic String throws excrption like:

SELECT Amount, AmountEzaf,AmountKasr, idProvince, LastName FROM VIEWFactorDetail WHERE LastName ='حسین'</summary></entry><entry><title>CASE in Statement throws exception</title><link href="https://sourceforge.net/p/jsqlparser/bugs/14/" rel="alternate"/><published>2011-04-20T08:00:07Z</published><updated>2011-04-20T08:00:07Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.netd78f9ed58ed89d7cb5aa8b9007471ee153ea372d</id><summary type="html">When parsing statements, which containe a CASE and the ELSE part of the CASE is a arithmetic function like /,+,- ... an exception is thrown.

Example statement throwing the exception:
select p, case when sum\(a\)=0 then 1 else 1\*2 end as f from anything

the 1\*2 part is the one causing the exception.

select p, case when sum\(a\)=0 then 1 else 2 end as f from anything  
is parsed correctly
</summary></entry></feed>