@@ -547,6 +547,55 @@ public void testConcat() throws JSQLParserException {
547547 assertSqlCanBeParsedAndDeparsed (statement );
548548 }
549549
550+ public void testConcatProblem2 () throws JSQLParserException {
551+ String stmt = "SELECT MAX(((((" +
552+ "(SPA.SOORTAANLEVERPERIODE)::VARCHAR (2) || (VARCHAR(SPA.AANLEVERPERIODEJAAR))::VARCHAR (4)" +
553+ ") || TO_CHAR(SPA.AANLEVERPERIODEVOLGNR, 'FM09'::VARCHAR)" +
554+ ") || TO_CHAR((10000 - SPA.VERSCHIJNINGSVOLGNR), 'FM0999'::VARCHAR)" +
555+ ") || (SPA.GESLACHT)::VARCHAR (1))) AS GESLACHT_TMP FROM testtable" ;
556+ assertSqlCanBeParsedAndDeparsed (stmt );
557+ }
558+
559+ public void testConcatProblem2_1 () throws JSQLParserException {
560+ String stmt = "SELECT TO_CHAR(SPA.AANLEVERPERIODEVOLGNR, 'FM09'::VARCHAR) FROM testtable" ;
561+ assertSqlCanBeParsedAndDeparsed (stmt );
562+ }
563+
564+ public void testConcatProblem2_2 () throws JSQLParserException {
565+ String stmt = "SELECT MAX((SPA.SOORTAANLEVERPERIODE)::VARCHAR (2) || (VARCHAR(SPA.AANLEVERPERIODEJAAR))::VARCHAR (4)) AS GESLACHT_TMP FROM testtable" ;
566+ assertSqlCanBeParsedAndDeparsed (stmt );
567+ }
568+
569+ public void testConcatProblem2_3 () throws JSQLParserException {
570+ String stmt = "SELECT TO_CHAR((10000 - SPA.VERSCHIJNINGSVOLGNR), 'FM0999'::VARCHAR) FROM testtable" ;
571+ assertSqlCanBeParsedAndDeparsed (stmt );
572+ }
573+
574+ public void testConcatProblem2_4 () throws JSQLParserException {
575+ String stmt = "SELECT (SPA.GESLACHT)::VARCHAR (1) FROM testtable" ;
576+ assertSqlCanBeParsedAndDeparsed (stmt );
577+ }
578+
579+ public void testConcatProblem2_5 () throws JSQLParserException {
580+ String stmt = "SELECT max((a || b) || c) FROM testtable" ;
581+ assertSqlCanBeParsedAndDeparsed (stmt );
582+ }
583+
584+ public void testConcatProblem2_5_1 () throws JSQLParserException {
585+ String stmt = "SELECT (a || b) || c FROM testtable" ;
586+ assertSqlCanBeParsedAndDeparsed (stmt );
587+ }
588+
589+ public void testConcatProblem2_5_2 () throws JSQLParserException {
590+ String stmt = "SELECT (a + b) + c FROM testtable" ;
591+ assertSqlCanBeParsedAndDeparsed (stmt );
592+ }
593+
594+ public void testConcatProblem2_6 () throws JSQLParserException {
595+ String stmt = "SELECT max(a || b || c) FROM testtable" ;
596+ assertSqlCanBeParsedAndDeparsed (stmt );
597+ }
598+
550599 public void testMatches () throws JSQLParserException {
551600 String statement = "SELECT * FROM team WHERE team.search_column @@ to_tsquery('new & york & yankees')" ;
552601 assertSqlCanBeParsedAndDeparsed (statement );
0 commit comments