From 84c0c44ee1cfc35c6bebd31f36470e22cb3966e2 Mon Sep 17 00:00:00 2001 From: ritwizsinha Date: Fri, 10 Sep 2021 17:52:15 +0530 Subject: [PATCH 1/6] Added auxilary code to run tests Signed-off-by: ritwizsinha --- go/vt/sqlparser/parse_test.go | 167 +++++++++++++++++++++++ go/vt/sqlparser/testdata/union_cases.txt | 6 + 2 files changed, 173 insertions(+) create mode 100644 go/vt/sqlparser/testdata/union_cases.txt diff --git a/go/vt/sqlparser/parse_test.go b/go/vt/sqlparser/parse_test.go index bec7ca8f569..a77df606902 100644 --- a/go/vt/sqlparser/parse_test.go +++ b/go/vt/sqlparser/parse_test.go @@ -21,7 +21,9 @@ import ( "bytes" "compress/gzip" "fmt" + "github.com/google/go-cmp/cmp" "io" + "io/ioutil" "math/rand" "os" "path" @@ -3492,3 +3494,168 @@ func BenchmarkParse3(b *testing.B) { largeQueryBenchmark(b, true) }) } + +func TestValidCases(t *testing.T) { + testOutputTempDir, err := ioutil.TempDir("", "parse_test") + require.NoError(t, err) + defer func() { + if !t.Failed() { + os.RemoveAll(testOutputTempDir) + } + }() + + testFile(t, "union_cases.txt", testOutputTempDir) +} +type testCase struct { + file string + lineno int + input string + output string + errStr string + comments string +} +func escapeNewLines(in string) string { + return strings.ReplaceAll(in, "\n", "\\n") +} + +func testFile(t *testing.T, filename, tempDir string) { + t.Run(filename, func(t *testing.T) { + fail := false + expected := strings.Builder{} + for tcase := range iterateExecFile(filename) { + t.Run(fmt.Sprintf("%d : %s", tcase.lineno, tcase.comments), func(t *testing.T) { + if tcase.output == "" && tcase.errStr == "" { + tcase.output = tcase.input + } + expected.WriteString(fmt.Sprintf("%sINPUT\n%sEND\n", tcase.comments, escapeNewLines(tcase.input))) + tree, err := Parse(tcase.input) + if tcase.errStr != "" { + expected.WriteString(fmt.Sprintf("ERROR\n%sEND\n", escapeNewLines(err.Error()))) + if err == nil || tcase.errStr != err.Error() { + fail = true + t.Errorf("File: %s, Line: %d\nDiff:\n%s\n[%s] \n[%s]", filename, tcase.lineno, cmp.Diff(tcase.errStr, err.Error()), tcase.errStr, err.Error()) + } + } else { + if err != nil { + expected.WriteString(fmt.Sprintf("ERROR\n%sEND\n", escapeNewLines(err.Error()))) + fail = true + t.Errorf("File: %s, Line: %d\nDiff:\n%s\n[%s] \n[%s]", filename, tcase.lineno, cmp.Diff(tcase.errStr, err.Error()), tcase.errStr, err.Error()) + } else { + out := String(tree) + expected.WriteString(fmt.Sprintf("OUTPUT\n%sEND\n", escapeNewLines(out))) + if tcase.output != out { + fail = true + t.Errorf("Parsing failed. \nExpected/Got:\n%s\n%s", tcase.output, out) + } + } + } + }) + } + + if fail && tempDir != "" { + gotFile := fmt.Sprintf("%s/%s", tempDir, filename) + _ = ioutil.WriteFile(gotFile, []byte(strings.TrimSpace(expected.String())+"\n"), 0644) + fmt.Println(fmt.Sprintf("Errors found in parse tests. If the output is correct, run `cp %s/* testdata/` to update test expectations", tempDir)) // nolint + } + }) +} + +func iterateExecFile(name string) (testCaseIterator chan testCase) { + name = locateFile(name) + fd, err := os.OpenFile(name, os.O_RDONLY, 0) + if err != nil { + panic(fmt.Sprintf("Could not open file %s", name)) + } + testCaseIterator = make(chan testCase) + var comments string + go func() { + defer close(testCaseIterator) + + r := bufio.NewReader(fd) + lineno := 0 + for { + binput, err := r.ReadBytes('\n') + if err != nil { + if err != io.EOF { + panic(fmt.Errorf("error reading file %s: line %d: %s", name, lineno, err.Error())) + } + break + } + lineno++ + input := string(binput) + if input == "" || input == "\n" { + continue + } + if input[0] == '#' { + comments = comments + input + continue + } + input, lineno, _ = parsePartial(r, []string{"INPUT"}, lineno, name) + output, lineno, returnTypeNumber := parsePartial(r, []string{"OUTPUT, ERROR"}, lineno, name) + var errStr string + if returnTypeNumber == 1 { + errStr = output + output = "" + } + testCaseIterator <- testCase{ + file: name, + lineno: lineno, + input: input, + comments: comments, + output: output, + errStr: errStr, + + } + comments = "" + } + }() + return testCaseIterator +} + +func parsePartial(r *bufio.Reader, readType []string, lineno int, fileName string) (string, int, int) { + var returnTypeNumber int + for { + binput, err := r.ReadBytes('\n') + if err != nil { + if err != io.EOF { + panic(fmt.Errorf("error reading file %s: line %d: %s", fileName, lineno, err.Error())) + } + break + } + lineno++ + input := string(binput) + if input == "" || input == "\n" { + continue + } + input = strings.TrimSpace(input) + for i, str := range readType { + if input == str { + returnTypeNumber = i + break + } + } + panic(fmt.Errorf("error reading file %s: line %d: %s - Expected keyword", fileName, lineno, err.Error())) + } + input := "" + for { + l, err := r.ReadBytes('\n') + lineno++ + if err != nil { + panic(fmt.Sprintf("error reading file %s line# %d: %s", fileName, lineno, err.Error())) + } + str := strings.TrimSpace(string(l)) + if str == "END" { + break + } + if input == "" { + input += str + } else { + input += str + "\n" + } + } + return input, lineno, returnTypeNumber +} + +func locateFile(name string) string { + return "testdata/" + name +} diff --git a/go/vt/sqlparser/testdata/union_cases.txt b/go/vt/sqlparser/testdata/union_cases.txt new file mode 100644 index 00000000000..58222fde730 --- /dev/null +++ b/go/vt/sqlparser/testdata/union_cases.txt @@ -0,0 +1,6 @@ +INPUT +select 1 from dual union select 2 from dual +END +OUTPUT +select 1 from dual union select 2 from dual +END From 145af63cb44932585f73172c68d0f28fb3dc26a0 Mon Sep 17 00:00:00 2001 From: ritwizsinha Date: Sun, 12 Sep 2021 23:58:00 +0530 Subject: [PATCH 2/6] Added union test cases from SQL SERVER Signed-off-by: ritwizsinha --- go/vt/sqlparser/parse_test.go | 40 +- go/vt/sqlparser/testdata/union_cases.txt | 1456 +++++++++++++++++++++- 2 files changed, 1470 insertions(+), 26 deletions(-) diff --git a/go/vt/sqlparser/parse_test.go b/go/vt/sqlparser/parse_test.go index a77df606902..d4637fed353 100644 --- a/go/vt/sqlparser/parse_test.go +++ b/go/vt/sqlparser/parse_test.go @@ -3523,26 +3523,27 @@ func testFile(t *testing.T, filename, tempDir string) { fail := false expected := strings.Builder{} for tcase := range iterateExecFile(filename) { + fmt.Println(tcase) t.Run(fmt.Sprintf("%d : %s", tcase.lineno, tcase.comments), func(t *testing.T) { if tcase.output == "" && tcase.errStr == "" { tcase.output = tcase.input } - expected.WriteString(fmt.Sprintf("%sINPUT\n%sEND\n", tcase.comments, escapeNewLines(tcase.input))) + expected.WriteString(fmt.Sprintf("%sINPUT\n%s\nEND\n", tcase.comments, escapeNewLines(tcase.input))) tree, err := Parse(tcase.input) if tcase.errStr != "" { - expected.WriteString(fmt.Sprintf("ERROR\n%sEND\n", escapeNewLines(err.Error()))) + expected.WriteString(fmt.Sprintf("ERROR\n%s\nEND\n", escapeNewLines(err.Error()))) if err == nil || tcase.errStr != err.Error() { fail = true t.Errorf("File: %s, Line: %d\nDiff:\n%s\n[%s] \n[%s]", filename, tcase.lineno, cmp.Diff(tcase.errStr, err.Error()), tcase.errStr, err.Error()) } } else { if err != nil { - expected.WriteString(fmt.Sprintf("ERROR\n%sEND\n", escapeNewLines(err.Error()))) + expected.WriteString(fmt.Sprintf("ERROR\n%s\nEND\n", escapeNewLines(err.Error()))) fail = true t.Errorf("File: %s, Line: %d\nDiff:\n%s\n[%s] \n[%s]", filename, tcase.lineno, cmp.Diff(tcase.errStr, err.Error()), tcase.errStr, err.Error()) } else { out := String(tree) - expected.WriteString(fmt.Sprintf("OUTPUT\n%sEND\n", escapeNewLines(out))) + expected.WriteString(fmt.Sprintf("OUTPUT\n%s\nEND\n", escapeNewLines(out))) if tcase.output != out { fail = true t.Errorf("Parsing failed. \nExpected/Got:\n%s\n%s", tcase.output, out) @@ -3566,6 +3567,7 @@ func iterateExecFile(name string) (testCaseIterator chan testCase) { if err != nil { panic(fmt.Sprintf("Could not open file %s", name)) } + testCaseIterator = make(chan testCase) var comments string go func() { @@ -3573,25 +3575,12 @@ func iterateExecFile(name string) (testCaseIterator chan testCase) { r := bufio.NewReader(fd) lineno := 0 - for { - binput, err := r.ReadBytes('\n') - if err != nil { - if err != io.EOF { - panic(fmt.Errorf("error reading file %s: line %d: %s", name, lineno, err.Error())) - } + for { + input, lineno, _ := parsePartial(r, []string{"INPUT"}, lineno, name) + if input == "" && lineno == 0 { break } - lineno++ - input := string(binput) - if input == "" || input == "\n" { - continue - } - if input[0] == '#' { - comments = comments + input - continue - } - input, lineno, _ = parsePartial(r, []string{"INPUT"}, lineno, name) - output, lineno, returnTypeNumber := parsePartial(r, []string{"OUTPUT, ERROR"}, lineno, name) + output, lineno, returnTypeNumber := parsePartial(r, []string{"OUTPUT", "ERROR"}, lineno, name) var errStr string if returnTypeNumber == 1 { errStr = output @@ -3613,27 +3602,30 @@ func iterateExecFile(name string) (testCaseIterator chan testCase) { } func parsePartial(r *bufio.Reader, readType []string, lineno int, fileName string) (string, int, int) { - var returnTypeNumber int + returnTypeNumber := -1 for { binput, err := r.ReadBytes('\n') if err != nil { if err != io.EOF { panic(fmt.Errorf("error reading file %s: line %d: %s", fileName, lineno, err.Error())) } - break + return "", 0, 0 } lineno++ input := string(binput) + input = strings.TrimSpace(input) if input == "" || input == "\n" { continue } - input = strings.TrimSpace(input) for i, str := range readType { if input == str { returnTypeNumber = i break } } + if returnTypeNumber != -1 { + break + } panic(fmt.Errorf("error reading file %s: line %d: %s - Expected keyword", fileName, lineno, err.Error())) } input := "" diff --git a/go/vt/sqlparser/testdata/union_cases.txt b/go/vt/sqlparser/testdata/union_cases.txt index 58222fde730..b288e09b393 100644 --- a/go/vt/sqlparser/testdata/union_cases.txt +++ b/go/vt/sqlparser/testdata/union_cases.txt @@ -1,6 +1,1458 @@ INPUT -select 1 from dual union select 2 from dual +SELECT ST_ASTEXT(ST_UNION(ST_ENVELOPE(ST_GEOMFROMTEXT('LINESTRING(5 9,-1 10,-2 -6,2 9,2 0,3 6,-3 3,9 -2,-3 -10,-7 -4,1 4)')), ST_UNION(ST_GEOMFROMTEXT('MULTILINESTRING((6 -8,10 -8,3 0,-6 1,0 8,-1 8,-3 -3,6 -6,0 6,1 -6,-1 7,8 3),(-9 -10,-4 0,0 1,-9 1,6 9,-8 7,-2 -6,2 10,-1 -5,3 -5,-1 -10))'), ST_GEOMFROMTEXT('MULTILINESTRING((8 7,2 6,-6 -8,-2 10,4 1,9 7,5 9,4 1,8 2,-2 10,8 -5))')))) as result; END OUTPUT -select 1 from dual union select 2 from dual +select ST_ASTEXT(ST_UNION(ST_ENVELOPE(ST_GEOMFROMTEXT('LINESTRING(5 9,-1 10,-2 -6,2 9,2 0,3 6,-3 3,9 -2,-3 -10,-7 -4,1 4)')), ST_UNION(ST_GEOMFROMTEXT('MULTILINESTRING((6 -8,10 -8,3 0,-6 1,0 8,-1 8,-3 -3,6 -6,0 6,1 -6,-1 7,8 3),(-9 -10,-4 0,0 1,-9 1,6 9,-8 7,-2 -6,2 10,-1 -5,3 -5,-1 -10))'), ST_GEOMFROMTEXT('MULTILINESTRING((8 7,2 6,-6 -8,-2 10,4 1,9 7,5 9,4 1,8 2,-2 10,8 -5))')))) as result from dual +END +INPUT +SELECT i FROM t2 UNION SELECT c FROM t1; +END +OUTPUT +(select i from t2) union (select c from t1) +END +INPUT +select @arg00 FROM t1 where a=1 union distinct select 1 FROM t1 where a=1; +END +OUTPUT +(select @arg00 from t1 where a = 1) union (select 1 from t1 where a = 1) +END +INPUT +SELECT '1' UNION SELECT 'н1234567890'; +END +OUTPUT +(select '1' from dual) union (select 'н1234567890' from dual) +END +INPUT +select * from (select * from t1 union select * from t1) a; +END +OUTPUT +select * from ((select * from t1) union (select * from t1)) as a +END +INPUT +select concat(f1, 2) a from t1 union select 'x' a from t1; +END +OUTPUT +(select concat(f1, 2) as a from t1) union (select 'x' as a from t1) +END +INPUT +SELECT b FROM t2 UNION SELECT c FROM t1; +END +OUTPUT +(select b from t2) union (select c from t1) +END +INPUT +(SELECT * FROM t1 ORDER BY a DESC LIMIT 5) UNION ALL (SELECT * FROM t2 ORDER BY a DESC LIMIT 4) ORDER BY a LIMIT 7; +END +OUTPUT +(select * from t1 order by a desc limit 5) union all (select * from t2 order by a desc limit 4) order by a asc limit 7 +END +INPUT +SELECT ST_AsText(ST_Union(ST_GEOMFROMTEXT( 'GEOMETRYCOLLECTION(POLYGON((0 0, 3 0, 3 3, 0 3, 0 0)), LINESTRING(0 1, 4 1))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))) as result; +END +OUTPUT +select ST_AsText(ST_Union(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0, 3 0, 3 3, 0 3, 0 0)), LINESTRING(0 1, 4 1))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))) as result from dual +END +INPUT +select ST_astext(st_union( st_intersection( multipoint(point(-1,-1)), point(1,-1) ), st_difference( multipoint(point(-1,1)), point(-1,-1) ))); +END +OUTPUT +select ST_astext(st_union(st_intersection(multipoint(point(-1, -1)), point(1, -1)), st_difference(multipoint(point(-1, 1)), point(-1, -1)))) from dual +END +INPUT +(select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 HOUR)),'%H') As H) union (select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 HOUR)),'%H') As H); +END +OUTPUT +(select time_format(timediff(now(), DATE_SUB(now(), interval 5 HOUR)), '%H') as H from dual) union (select time_format(timediff(now(), DATE_SUB(now(), interval 5 HOUR)), '%H') as H from dual) +END +INPUT +select ST_astext(st_union(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))); +END +OUTPUT +select ST_astext(st_union(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))) from dual +END +INPUT +SELECT sleep(0.5) FROM t17059925 UNION ALL SELECT * FROM t17059925 WHERE a= 10 AND a= 20 UNION ALL SELECT * FROM t2; +END +OUTPUT +(select sleep(0.5) from t17059925) union all (select * from t17059925 where a = 10 and a = 20) union all (select * from t2) +END +INPUT +(SELECT * FROM t1 LIMIT 5) UNION SELECT * FROM t2 ORDER BY a LIMIT 8; +END +OUTPUT +(select * from t1 limit 5) union (select * from t2) order by a asc limit 8 +END +INPUT +select * from t1 where MATCH(a,b) AGAINST ("collections") UNION ALL select * from t1 where MATCH(a,b) AGAINST ("indexes"); +END +OUTPUT +(select * from t1 where match(a, b) against ('collections')) union all (select * from t1 where match(a, b) against ('indexes')) +END +INPUT +SELECT 1 as a FROM (SELECT a UNION SELECT 1) b; +END +OUTPUT +select 1 as a from ((select a from dual) union (select 1 from dual)) as b +END +INPUT +(select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 DAY)),'%k') As H) union (select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 DAY)),'%k') As H); +END +OUTPUT +(select time_format(timediff(now(), DATE_SUB(now(), interval 5 DAY)), '%k') as H from dual) union (select time_format(timediff(now(), DATE_SUB(now(), interval 5 DAY)), '%k') as H from dual) +END +INPUT +SELECT * FROM (SELECT t17059925_func1(1)) t WHERE 1= 0 UNION SELECT sleep(0.5); +END +OUTPUT +(select * from (select t17059925_func1(1) from dual) as t where 1 = 0) union (select sleep(0.5) from dual) +END +INPUT +SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp2.txt' CHARACTER SET ucs2; +END +ERROR +syntax error at position 35 near 'INTO' +END +INPUT +SELECT a, SUM(a), SUM(a)+1 FROM (SELECT a FROM t1 UNION select 2) d GROUP BY a WITH ROLLUP; +END +ERROR +syntax error at position 86 near 'WITH' +END +INPUT +SELECT * FROM t1 UNION ALL SELECT * FROM t2 ORDER BY a LIMIT 5 OFFSET 6; +END +OUTPUT +(select * from t1) union all (select * from t2) order by a asc limit 6, 5 +END +INPUT +(SELECT * FROM t1 ORDER BY a DESC LIMIT 5 OFFSET 4) UNION (SELECT * FROM t2 ORDER BY a DESC LIMIT 4 OFFSET 2) ORDER BY a LIMIT 7 OFFSET 1; +END +OUTPUT +(select * from t1 order by a desc limit 4, 5) union (select * from t2 order by a desc limit 2, 4) order by a asc limit 1, 7 +END +INPUT +SELECT 'н1234567890' UNION SELECT _binary '1'; +END +OUTPUT +(select 'н1234567890' from dual) union (select _binary '1' from dual) +END +INPUT +select ST_AsText(a) from (select f2 as a from t1 union select f3 from t1) t; +END +OUTPUT +select ST_AsText(a) from ((select f2 as a from t1) union (select f3 from t1)) as t +END +INPUT +select st_overlaps(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_overlaps(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +(SELECT * FROM t1 LIMIT 5) UNION ALL (SELECT * FROM t2 LIMIT 4) LIMIT 7; +END +OUTPUT +(select * from t1 limit 5) union all (select * from t2 limit 4) limit 7 +END +INPUT +(SELECT * FROM t1 LIMIT 5 OFFSET 4) UNION (SELECT * FROM t2 LIMIT 4 OFFSET 2) LIMIT 7 OFFSET 1; +END +OUTPUT +(select * from t1 limit 4, 5) union (select * from t2 limit 2, 4) limit 1, 7 +END +INPUT +SELECT sleep(0.5) FROM t17059925 UNION ALL SELECT * FROM t2 UNION ALL SELECT * FROM t3; +END +OUTPUT +(select sleep(0.5) from t17059925) union all (select * from t2) union all (select * from t3) +END +INPUT +SELECT sleep(0.5) FROM t17059925 UNION SELECT * FROM t2 UNION SELECT * FROM t3; +END +OUTPUT +(select sleep(0.5) from t17059925) union (select * from t2) union (select * from t3) +END +INPUT +select "xyz" as name union select "abc" as name order by name desc; +END +OUTPUT +(select 'xyz' as `name` from dual) union (select 'abc' as `name` from dual) order by `name` desc +END +INPUT +(SELECT * FROM t1 LIMIT 5 OFFSET 4) UNION ALL SELECT * FROM t2 ORDER BY a LIMIT 8 OFFSET 1; +END +OUTPUT +(select * from t1 limit 4, 5) union all (select * from t2) order by a asc limit 1, 8 +END +INPUT +select 'a' union select concat('a', -0.0000); +END +OUTPUT +(select 'a' from dual) union (select concat('a', -0.0000) from dual) +END +INPUT +select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b; +END +OUTPUT +select * from ((select * from t1) union (select * from t1)) as a, ((select * from t1) union (select * from t1)) as b +END +INPUT +SELECT DISTINCT GREATEST(a, (SELECT b FROM t1 LIMIT 1)) FROM t1 UNION SELECT 1; +END +OUTPUT +(select distinct GREATEST(a, (select b from t1 limit 1)) from t1) union (select 1 from dual) +END +INPUT +SELECT DISTINCT LEAST(a, (SELECT b FROM t1 LIMIT 1)) FROM t1 UNION SELECT 1; +END +OUTPUT +(select distinct LEAST(a, (select b from t1 limit 1)) from t1) union (select 1 from dual) +END +INPUT +(select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 HOUR)),'%k') As H) union (select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 HOUR)),'%k') As H); +END +OUTPUT +(select time_format(timediff(now(), DATE_SUB(now(), interval 5 HOUR)), '%k') as H from dual) union (select time_format(timediff(now(), DATE_SUB(now(), interval 5 HOUR)), '%k') as H from dual) +END +INPUT +select concat((select x from (select 'a' as x) as t1 ), (select y from (select 'b' as y) as t2 )) from (select 1 union select 2 ) as t3; +END +OUTPUT +select concat((select x from (select 'a' as x from dual) as t1), (select y from (select 'b' as y from dual) as t2)) from ((select 1 from dual) union (select 2 from dual)) as t3 +END +INPUT +select 'a' union select concat('a', 4 - 5); +END +OUTPUT +(select 'a' from dual) union (select concat('a', 4 - 5) from dual) +END +INPUT +select st_touches(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_touches(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +SELECT 1 UNION SELECT 1 INTO @var FOR UPDATE; +END +ERROR +syntax error at position 29 near 'INTO' +END +INPUT +select st_intersects(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_intersects(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select ST_astext(ST_UNION(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)'))); +END +OUTPUT +select ST_astext(ST_UNION(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)'))) from dual +END +INPUT +SELECT NULL as "my_col1",2 AS "my_col2" UNION SELECT NULL,1; +END +OUTPUT +(select null as my_col1, 2 as my_col2 from dual) union (select null, 1 from dual) +END +INPUT +select st_contains(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_contains(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +SELECT ST_AsText(ST_Union(ST_GEOMFROMTEXT( 'GEOMETRYCOLLECTION(LINESTRING(4 1, 6 1), LINESTRING(0 1, 4 1))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))) as result; +END +OUTPUT +select ST_AsText(ST_Union(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(4 1, 6 1), LINESTRING(0 1, 4 1))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))) as result from dual +END +INPUT +SELECT ST_ISVALID(ST_UNION(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 40,40 40,40 0,0 0),(10 10,30 10,30 30,10 30,10 10)))'), ST_GEOMFROMTEXT('MULTIPOLYGON(((10 10,10 20,20 10,10 10)),((20 10,30 20,30 10,20 10)),((10 20,10 30,20 20,10 20)),((20 20,30 30,30 20,20 20)))'))); +END +OUTPUT +select ST_ISVALID(ST_UNION(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 40,40 40,40 0,0 0),(10 10,30 10,30 30,10 30,10 10)))'), ST_GEOMFROMTEXT('MULTIPOLYGON(((10 10,10 20,20 10,10 10)),((20 10,30 20,30 10,20 10)),((10 20,10 30,20 20,10 20)),((20 20,30 30,30 20,20 20)))'))) from dual +END +INPUT +(SELECT * FROM t1 LIMIT 5 OFFSET 4) UNION (SELECT * FROM t2 LIMIT 4 OFFSET 2) ORDER BY a LIMIT 7 OFFSET 1; +END +OUTPUT +(select * from t1 limit 4, 5) union (select * from t2 limit 2, 4) order by a asc limit 1, 7 +END +INPUT +(SELECT * FROM t1 LIMIT 5 OFFSET 4) UNION SELECT * FROM t2 LIMIT 8 OFFSET 1; +END +OUTPUT +(select * from t1 limit 4, 5) union (select * from t2) limit 1, 8 +END +INPUT +SELECT "Xyz" AS Name UNION SELECT "Abc" as Name ORDER BY Name DESC; +END +OUTPUT +(select 'Xyz' as `Name` from dual) union (select 'Abc' as `Name` from dual) order by `Name` desc +END +INPUT +(SELECT * FROM t1 ORDER BY a DESC LIMIT 5) UNION (SELECT * FROM t2 ORDER BY a DESC LIMIT 4) LIMIT 7; +END +OUTPUT +(select * from t1 order by a desc limit 5) union (select * from t2 order by a desc limit 4) limit 7 +END +INPUT +select * from t1 union distinct select * from t2 union all select * from t3; +END +OUTPUT +(select * from t1) union (select * from t2) union all (select * from t3) +END +INPUT +SELECT ST_CONTAINS(ST_UNION(ST_INTERSECTION(ST_GEOMFROMTEXT('POINT(-3 3)'), ST_GEOMFROMTEXT('POLYGON((8 3,-2 9,-10 2,-10 -9,7 -1,4 1,7 6,5 -10,5 3,2 1,-10 0, 8 3))')), ST_CONVEXHULL(ST_GEOMFROMTEXT('MULTIPOINT(8 -8,-7 5)'))), ST_UNION(ST_GEOMFROMTEXT('POINT(4 1)'), ST_GEOMFROMTEXT('MULTIPOINT(-10 -10,5 -2,-6 -7,1 5,-3 0)'))) as result; +END +OUTPUT +select ST_CONTAINS(ST_UNION(ST_INTERSECTION(ST_GEOMFROMTEXT('POINT(-3 3)'), ST_GEOMFROMTEXT('POLYGON((8 3,-2 9,-10 2,-10 -9,7 -1,4 1,7 6,5 -10,5 3,2 1,-10 0, 8 3))')), ST_CONVEXHULL(ST_GEOMFROMTEXT('MULTIPOINT(8 -8,-7 5)'))), ST_UNION(ST_GEOMFROMTEXT('POINT(4 1)'), ST_GEOMFROMTEXT('MULTIPOINT(-10 -10,5 -2,-6 -7,1 5,-3 0)'))) as result from dual +END +INPUT +select * from (select * from t1 union all select * from t1 limit 2) a; +END +OUTPUT +select * from ((select * from t1) union all (select * from t1) limit 2) as a +END +INPUT +(SELECT table3.col_varchar_10_latin1_key, table1.col_varchar_1024_latin1_key, table1.col_varchar_1024_latin1_key FROM view_e AS table1 LEFT JOIN view_h AS table2 LEFT JOIN t1 AS table3 ON table2.col_int_key = table3.pk ON table1.col_varchar_1024_latin1_key = table3.col_varchar_10_utf8_key ) UNION DISTINCT ( SELECT table3.col_varchar_10_latin1_key, table1.col_varchar_1024_latin1_key, table1.col_varchar_1024_latin1_key FROM view_e AS table1 LEFT JOIN view_h AS table2 LEFT JOIN t1 AS table3 ON table2.col_int_key = table3.pk ON table1.col_varchar_1024_latin1_key = table3.col_varchar_10_utf8_key ); +END +OUTPUT +(select table3.col_varchar_10_latin1_key, table1.col_varchar_1024_latin1_key, table1.col_varchar_1024_latin1_key from view_e as table1 left join view_h as table2 left join t1 as table3 on table2.col_int_key = table3.pk on table1.col_varchar_1024_latin1_key = table3.col_varchar_10_utf8_key) union (select table3.col_varchar_10_latin1_key, table1.col_varchar_1024_latin1_key, table1.col_varchar_1024_latin1_key from view_e as table1 left join view_h as table2 left join t1 as table3 on table2.col_int_key = table3.pk on table1.col_varchar_1024_latin1_key = table3.col_varchar_10_utf8_key) +END +INPUT +SELECT c FROM t1 UNION SELECT i FROM t2; +END +OUTPUT +(select c from t1) union (select i from t2) +END +INPUT +SELECT * FROM (t1 RIGHT JOIN (SELECT * FROM t3 WHERE (DAYNAME('1995'))) AS table2 ON (( t1.f1 ,t1.pk) IN (SELECT 7,4 UNION SELECT 9,2))) WHERE (NOT EXISTS (SELECT t1.f1 FROM (t1 INNER JOIN t2 ON (t1.pk=t2.f1)) WHERE 0 IS NOT NULL)) AND t1.f1 > 50; +END +OUTPUT +select * from (t1 right join (select * from t3 where DAYNAME('1995')) as table2 on (t1.f1, t1.pk) in ((select 7, 4 from dual) union (select 9, 2 from dual))) where not exists (select t1.f1 from (t1 join t2 on t1.pk = t2.f1) where 0 is not null) and t1.f1 > 50 +END +INPUT +(SELECT * FROM t1 ORDER BY a DESC LIMIT 5) UNION SELECT * FROM t2 ORDER BY a LIMIT 8; +END +OUTPUT +(select * from t1 order by a desc limit 5) union (select * from t2) order by a asc limit 8 +END +INPUT +(SELECT a FROM t1 ORDER BY COUNT(*) LIMIT 1) UNION ALL SELECT a FROM t1; +END +OUTPUT +(select a from t1 order by COUNT(*) asc limit 1) union all (select a from t1) +END +INPUT +SELECT ST_AsText(ST_Union(ST_GEOMFROMTEXT( 'GEOMETRYCOLLECTION(POLYGON((0 0, 3 0, 3 3, 0 3, 0 0)), LINESTRING(3 1, 4 1))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))) as result; +END +OUTPUT +select ST_AsText(ST_Union(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0, 3 0, 3 3, 0 3, 0 0)), LINESTRING(3 1, 4 1))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))) as result from dual +END +INPUT +select 'a' union select concat('a', -concat('3',4)); +END +OUTPUT +(select 'a' from dual) union (select concat('a', -concat('3', 4)) from dual) +END +INPUT +SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a LIMIT 5 OFFSET 6; +END +OUTPUT +(select * from t1) union (select * from t2) order by a asc limit 6, 5 +END +INPUT +(SELECT * FROM t1 LIMIT 5) UNION (SELECT * FROM t2 LIMIT 4) ORDER BY a LIMIT 7; +END +OUTPUT +(select * from t1 limit 5) union (select * from t2 limit 4) order by a asc limit 7 +END +INPUT +SELECT 1 FOR UPDATE UNION SELECT 2; +END +OUTPUT +(select 1 from dual for update) union (select 2 from dual) +END +INPUT +SELECT product, country_id , year, SUM(profit) FROM t1 GROUP BY product, country_id, year WITH CUBE UNION ALL SELECT product, country_id , year, SUM(profit) FROM t1 GROUP BY product, country_id, year WITH ROLLUP; +END +ERROR +syntax error at position 95 near 'WITH' +END +INPUT +select (with recursive dt as (select t1.a as a union select a+1 from dt where a<10) select dt1.a from dt dt1 where dt1.a=t1.a ) as subq from t1; +END +ERROR +syntax error at position 15 near 'with' +END +INPUT +(SELECT * FROM t1 ORDER BY a DESC LIMIT 5) UNION ALL SELECT * FROM t2 ORDER BY a LIMIT 8; +END +OUTPUT +(select * from t1 order by a desc limit 5) union all (select * from t2) order by a asc limit 8 +END +INPUT +select st_astext(st_union(ST_GeometryFromText('geometrycollection(polygon((0 0, 2 0, 2 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 3 0, 3 1, 1 1, 1 0)))'))); +END +OUTPUT +select st_astext(st_union(ST_GeometryFromText('geometrycollection(polygon((0 0, 2 0, 2 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 3 0, 3 1, 1 1, 1 0)))'))) from dual +END +INPUT +select st_equals(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_equals(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +(SELECT * FROM t1 LIMIT 5) UNION ALL SELECT * FROM t2 ORDER BY a LIMIT 8; +END +OUTPUT +(select * from t1 limit 5) union all (select * from t2) order by a asc limit 8 +END +INPUT +SELECT ST_ISVALID(ST_UNION(ST_GEOMFROMTEXT('POLYGON((0 6,-11 -6,6 0,0 6),(3 1,5 0,-2 0,3 1))'), ST_GEOMFROMTEXT('POLYGON((5 4,6 0,9 12,-7 -12,5 -19,5 4))'))); +END +OUTPUT +select ST_ISVALID(ST_UNION(ST_GEOMFROMTEXT('POLYGON((0 6,-11 -6,6 0,0 6),(3 1,5 0,-2 0,3 1))'), ST_GEOMFROMTEXT('POLYGON((5 4,6 0,9 12,-7 -12,5 -19,5 4))'))) from dual +END +INPUT +(SELECT * FROM t1 ORDER BY a DESC LIMIT 5 OFFSET 4) UNION ALL (SELECT * FROM t2 ORDER BY a DESC LIMIT 4 OFFSET 2) LIMIT 7 OFFSET 1; +END +OUTPUT +(select * from t1 order by a desc limit 4, 5) union all (select * from t2 order by a desc limit 2, 4) limit 1, 7 +END +INPUT +(select b.id, b.betreff from t3 b) union (select b.id, b.betreff from t3 b) order by match(betreff) against ('+abc') desc; +END +OUTPUT +(select b.id, b.betreff from t3 as b) union (select b.id, b.betreff from t3 as b) order by match(betreff) against ('+abc') desc +END +INPUT +SELECT ST_AsText(ST_Union(ST_GEOMFROMTEXT( 'GEOMETRYCOLLECTION(POLYGON((0 0, 5 0, 5 5, 0 5,0 0)), POLYGON((5 0,10 0, 10 3,5 3,5 0)))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))) as result; +END +OUTPUT +select ST_AsText(ST_Union(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0, 5 0, 5 5, 0 5,0 0)), POLYGON((5 0,10 0, 10 3,5 3,5 0)))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))) as result from dual +END +INPUT +select f1 from t1 union select f1 from t1; +END +OUTPUT +(select f1 from t1) union (select f1 from t1) +END +INPUT +select f1,'' from t1 union select f1,'' from t1; +END +OUTPUT +(select f1, '' from t1) union (select f1, '' from t1) +END +INPUT +select st_intersects(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_intersects(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +(SELECT a FROM t1 ORDER BY COUNT(*)) UNION ALL SELECT a FROM t1; +END +OUTPUT +(select a from t1 order by COUNT(*) asc) union all (select a from t1) +END +INPUT +(SELECT * FROM t1 LIMIT 5 OFFSET 4) UNION ALL (SELECT * FROM t2 LIMIT 4 OFFSET 2) LIMIT 7 OFFSET 1; +END +OUTPUT +(select * from t1 limit 4, 5) union all (select * from t2 limit 2, 4) limit 1, 7 +END +INPUT +SELECT * FROM t1 UNION ALL SELECT * FROM t2 LIMIT 5 OFFSET 6; +END +OUTPUT +(select * from t1) union all (select * from t2) limit 6, 5 +END +INPUT +select t1.id from t1 union select t2.id from t2; +END +OUTPUT +(select t1.id from t1) union (select t2.id from t2) +END +INPUT +select 'a' union select concat('a', -4); +END +OUTPUT +(select 'a' from dual) union (select concat('a', -4) from dual) +END +INPUT +select 'a' union select concat('a', -'3'); +END +OUTPUT +(select 'a' from dual) union (select concat('a', -'3') from dual) +END +INPUT +select 'a' union select concat('a', -0); +END +OUTPUT +(select 'a' from dual) union (select concat('a', -0) from dual) +END +INPUT +SELECT a, SUM(a), SUM(a)+1 FROM (SELECT 1 a UNION select 2) d GROUP BY a WITH ROLLUP; +END +ERROR +syntax error at position 80 near 'WITH' +END +INPUT +SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3; +END +OUTPUT +(select LOCATION from T1 where EVENT_ID = 2) union all (select LOCATION from T1 where EVENT_ID = 3) +END +INPUT +(SELECT * FROM t1 LIMIT 5 OFFSET 4) UNION SELECT * FROM t2 ORDER BY a LIMIT 8 OFFSET 1; +END +OUTPUT +(select * from t1 limit 4, 5) union (select * from t2) order by a asc limit 1, 8 +END +INPUT +(SELECT * FROM t1 LIMIT 5) UNION (SELECT * FROM t2 LIMIT 4) LIMIT 7; +END +OUTPUT +(select * from t1 limit 5) union (select * from t2 limit 4) limit 7 +END +INPUT +SELECT 1 UNION SELECT 2 LOCK IN SHARE MODE; +END +OUTPUT +(select 1 from dual) union (select 2 from dual) lock in share mode +END +INPUT +SELECT a FROM t1 UNION (SELECT a FROM t1 ORDER BY COUNT(*)); +END +OUTPUT +(select a from t1) union (select a from t1 order by COUNT(*) asc) +END +INPUT +select min(`col002`) from t1 union select `col002` from t1; +END +OUTPUT +(select min(col002) from t1) union (select col002 from t1) +END +INPUT +SELECT 'case+union+test' UNION SELECT CASE LOWER('1') WHEN LOWER('2') THEN 'BUG' ELSE 'nobug' END; +END +OUTPUT +(select 'case+union+test' from dual) union (select case LOWER('1') when LOWER('2') then 'BUG' else 'nobug' end from dual) +END +INPUT +SELECT sleep(0.5) FROM t17059925 UNION SELECT * FROM (SELECT t17059925_func1(1)) t WHERE 1= 0 UNION SELECT t17059925_func1(1); +END +OUTPUT +(select sleep(0.5) from t17059925) union (select * from (select t17059925_func1(1) from dual) as t where 1 = 0) union (select t17059925_func1(1) from dual) +END +INPUT +(select 1 as a from t1) union all (select 1 from dual) limit 1; +END +OUTPUT +(select 1 as a from t1) union all (select 1 from dual) limit 1 +END +INPUT +select st_disjoint(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_disjoint(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +SELECT alias2 . `col_int_nokey` AS field1 FROM ( CC AS alias1 INNER JOIN ( ( BB AS alias2 INNER JOIN ( SELECT SQ1_alias1 . * FROM C AS SQ1_alias1 ) AS alias3 ON (alias3 . `col_int_key` = alias2 . `col_int_nokey` ) ) ) ON (alias3 . `col_varchar_nokey` = alias2 . `col_varchar_key` ) ) WHERE ( ( alias2 . `pk` , alias3 . `col_int_nokey` ) IN ( SELECT 4 , 7 UNION SELECT 137, 6 ) ) AND alias1 . `pk` > 149 AND alias1 . `pk` < ( 149 + 7 ) OR alias3 . `col_varchar_key` < 'o'; +END +OUTPUT +select alias2.col_int_nokey as field1 from (CC as alias1 join ((BB as alias2 join (select SQ1_alias1.* from C as SQ1_alias1) as alias3 on alias3.col_int_key = alias2.col_int_nokey)) on alias3.col_varchar_nokey = alias2.col_varchar_key) where (alias2.pk, alias3.col_int_nokey) in ((select 4, 7 from dual) union (select 137, 6 from dual)) and alias1.pk > 149 and alias1.pk < 149 + 7 or alias3.col_varchar_key < 'o' +END +INPUT +(SELECT * FROM t1 ORDER BY a DESC LIMIT 5) UNION ALL SELECT * FROM t2 LIMIT 8; +END +OUTPUT +(select * from t1 order by a desc limit 5) union all (select * from t2) limit 8 +END +INPUT +select repeat(_utf8'+',3) as h union select NULL; +END +OUTPUT +(select repeat(_utf8 '+', 3) as h from dual) union (select null from dual) +END +INPUT +SELECT * FROM t1 UNION SELECT /*+ MAX_EXECUTION_TIME(0) */ * FROM t1; +END +OUTPUT +(select * from t1) union (select /*+ MAX_EXECUTION_TIME(0) */ * from t1) +END +INPUT +SELECT ST_AsText(st_union(ST_GeomFromText('GeometryCollection(GeometryCollection(Point(1 1)), GeometryCollection(linestring(1 1, 2 2)))'), ST_GeomFromText('GeometryCollection(GeometryCollection(Point(1 1)))'))); +END +OUTPUT +select ST_AsText(st_union(ST_GeomFromText('GeometryCollection(GeometryCollection(Point(1 1)), GeometryCollection(linestring(1 1, 2 2)))'), ST_GeomFromText('GeometryCollection(GeometryCollection(Point(1 1)))'))) from dual +END +INPUT +select ST_astext(st_union(ST_GeomFromText('multipoint(2 2, 3 3)'), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))); +END +OUTPUT +select ST_astext(st_union(ST_GeomFromText('multipoint(2 2, 3 3)'), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))) from dual +END +INPUT +select group_concat('x') UNION ALL select 1; +END +OUTPUT +(select group_concat('x') from dual) union all (select 1 from dual) +END +INPUT +(SELECT * FROM t1 LIMIT 5 OFFSET 4) UNION ALL SELECT * FROM t2 LIMIT 8 OFFSET 1; +END +OUTPUT +(select * from t1 limit 4, 5) union all (select * from t2) limit 1, 8 +END +INPUT +SELECT 1 FROM dual WHERE 1= 0 UNION SELECT sleep(0.5); +END +OUTPUT +(select 1 from dual where 1 = 0) union (select sleep(0.5) from dual) +END +INPUT +select * from (select 1 union select 1) aaa; +END +OUTPUT +select * from ((select 1 from dual) union (select 1 from dual)) as aaa +END +INPUT +SELECT a, SUM(a), SUM(a)+1, CONCAT(SUM(a),'x'), SUM(a)+SUM(a), SUM(a) FROM (SELECT 1 a, 2 b UNION SELECT 2,3 UNION SELECT 5,6 ) d GROUP BY a WITH ROLLUP; +END +ERROR +syntax error at position 152 near 'WITH' +END +INPUT +select st_equals(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_equals(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +(SELECT * FROM t1 LIMIT 5 OFFSET 4) UNION ALL (SELECT * FROM t2 LIMIT 4 OFFSET 2) ORDER BY a LIMIT 7 OFFSET 1; +END +OUTPUT +(select * from t1 limit 4, 5) union all (select * from t2 limit 2, 4) order by a asc limit 1, 7 +END +INPUT +SELECT sleep(0.5) FROM t17059925 UNION SELECT * FROM t17059925 WHERE a= 10 AND a= 20 UNION SELECT * FROM t2; +END +OUTPUT +(select sleep(0.5) from t17059925) union (select * from t17059925 where a = 10 and a = 20) union (select * from t2) +END +INPUT +SELECT ST_ISVALID(ST_UNION(ST_GEOMFROMTEXT('POLYGON((0 0,0 40,40 40,40 0,0 0),(10 10,30 10,30 30,10 30,10 10))'), ST_GEOMFROMTEXT('POLYGON((5 15,5 30,30 15,5 15))'))); +END +OUTPUT +select ST_ISVALID(ST_UNION(ST_GEOMFROMTEXT('POLYGON((0 0,0 40,40 40,40 0,0 0),(10 10,30 10,30 30,10 30,10 10))'), ST_GEOMFROMTEXT('POLYGON((5 15,5 30,30 15,5 15))'))) from dual +END +INPUT +(SELECT * FROM t1 ORDER BY a DESC LIMIT 5) UNION ALL (SELECT * FROM t2 ORDER BY a DESC LIMIT 4) LIMIT 7; +END +OUTPUT +(select * from t1 order by a desc limit 5) union all (select * from t2 order by a desc limit 4) limit 7 +END +INPUT +select * from (select * from t1 where t1.a=(select t2.a from t2 where t2.a=t1.a) union select t1.a, t1.b from t1) a; +END +OUTPUT +select * from ((select * from t1 where t1.a = (select t2.a from t2 where t2.a = t1.a)) union (select t1.a, t1.b from t1)) as a +END +INPUT +SELECT id, CHAR_LENGTH(GROUP_CONCAT(body)) AS l FROM (SELECT 'a' AS id, REPEAT('foo bar', 100) AS body UNION ALL SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1 GROUP BY id ORDER BY l DESC; +END +OUTPUT +select id, CHAR_LENGTH(group_concat(body)) as l from ((select 'a' as id, REPEAT('foo bar', 100) as body from dual) union all (select 'a' as id, REPEAT('bla bla', 100) as body from dual)) as t1 group by id order by l desc +END +INPUT +SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp.txt'; +END +ERROR +syntax error at position 35 near 'INTO' +END +INPUT +select ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 -14,13 -8),(-5 -3,8 7),(-6 18,17 -11,-12 19,19 5),(16 11,9 -5),(17 -5,5 10),(-4 17,6 4),(-12 15,17 13,-18 11,15 10),(7 0,2 -16,-18 13,-6 4),(-17 -6,-6 -7,1 4,-18 0)),GEOMETRYCOLLECTION(MULTIPOINT(0 14,-9 -11),MULTILINESTRING((-11 -2,17 -14),(18 -12,18 -8),(-13 -16,9 16,9 -10,-7 20),(-14 -5,10 -9,4 1,17 -8),(-9 -4,-2 -12,9 -13,-5 4),(15 17,13 20))),MULTIPOINT(16 1,-9 -17,-16 6,-17 3),POINT(-18 13))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(7 0),MULTILINESTRING((-13 -18,-16 0),(17 11,-1 11,-18 -19,-4 -18),(-8 -8,-15 -13,3 -18,6 8)),LINESTRING(5 16,0 -9,-6 4,-15 17),MULTIPOINT(-9 -5,5 15,12 -11,12 11))'))) as result; +END +OUTPUT +select ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 -14,13 -8),(-5 -3,8 7),(-6 18,17 -11,-12 19,19 5),(16 11,9 -5),(17 -5,5 10),(-4 17,6 4),(-12 15,17 13,-18 11,15 10),(7 0,2 -16,-18 13,-6 4),(-17 -6,-6 -7,1 4,-18 0)),GEOMETRYCOLLECTION(MULTIPOINT(0 14,-9 -11),MULTILINESTRING((-11 -2,17 -14),(18 -12,18 -8),(-13 -16,9 16,9 -10,-7 20),(-14 -5,10 -9,4 1,17 -8),(-9 -4,-2 -12,9 -13,-5 4),(15 17,13 20))),MULTIPOINT(16 1,-9 -17,-16 6,-17 3),POINT(-18 13))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(7 0),MULTILINESTRING((-13 -18,-16 0),(17 11,-1 11,-18 -19,-4 -18),(-8 -8,-15 -13,3 -18,6 8)),LINESTRING(5 16,0 -9,-6 4,-15 17),MULTIPOINT(-9 -5,5 15,12 -11,12 11))'))) as result from dual +END +INPUT +SELECT ST_ISVALID( ST_UNION( ST_GEOMFROMTEXT(' LINESTRING(-9 -17,17 -11) '), ST_GEOMFROMTEXT(' GEOMETRYCOLLECTION( LINESTRING(8 16,-8 -3), POLYGON((2 3,-9 -7,12 -13,2 3)), MULTILINESTRING((-2 2,11 -10),(6 0,-15 0,16 0)) ) ') ) ) AS valid; +END +OUTPUT +select ST_ISVALID(ST_UNION(ST_GEOMFROMTEXT(' LINESTRING(-9 -17,17 -11) '), ST_GEOMFROMTEXT(' GEOMETRYCOLLECTION( LINESTRING(8 16,-8 -3), POLYGON((2 3,-9 -7,12 -13,2 3)), MULTILINESTRING((-2 2,11 -10),(6 0,-15 0,16 0)) ) '))) as valid from dual +END +INPUT +select ST_astext(ST_Union(ST_geometryfromtext('point(1 1)'), ST_geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))'))); +END +OUTPUT +select ST_astext(ST_Union(ST_geometryfromtext('point(1 1)'), ST_geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))'))) from dual +END +INPUT +SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b; +END +OUTPUT +select 1 as a from ((select 1 from dual) union (select a from dual)) as b +END +INPUT +SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a LIMIT 5; +END +OUTPUT +(select * from t1) union (select * from t2) order by a asc limit 5 +END +INPUT +SELECT /*+ MAX_EXECUTION_TIME(0) */ * FROM t1 UNION SELECT /*+ MAX_EXECUTION_TIME(0) */ * FROM t1; +END +OUTPUT +(select /*+ MAX_EXECUTION_TIME(0) */ * from t1) union (select /*+ MAX_EXECUTION_TIME(0) */ * from t1) +END +INPUT +(select b.id, b.betreff from t3 b) union (select b.id, b.betreff from t3 b) order by match(betreff) against ('+abc' in boolean mode) desc; +END +OUTPUT +(select b.id, b.betreff from t3 as b) union (select b.id, b.betreff from t3 as b) order by match(betreff) against ('+abc' in boolean mode) desc +END +INPUT +SELECT * FROM t1 WHERE (a, a) NOT IN (SELECT * FROM (SELECT 8, 4 UNION SELECT 2, 3) tt); +END +OUTPUT +select * from t1 where (a, a) not in (select * from ((select 8, 4 from dual) union (select 2, 3 from dual)) as tt) +END +INPUT +select st_touches(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_touches(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +(SELECT * FROM t1 ORDER BY a DESC LIMIT 5 OFFSET 4) UNION ALL (SELECT * FROM t2 ORDER BY a DESC LIMIT 4 OFFSET 2) ORDER BY a LIMIT 7 OFFSET 1; +END +OUTPUT +(select * from t1 order by a desc limit 4, 5) union all (select * from t2 order by a desc limit 2, 4) order by a asc limit 1, 7 +END +INPUT +SELECT * FROM a LEFT JOIN vmerge AS v ON a.id = v.id UNION ALL SELECT * FROM a LEFT JOIN vmerge AS v ON a.id = v.id; +END +OUTPUT +(select * from a left join vmerge as v on a.id = v.id) union all (select * from a left join vmerge as v on a.id = v.id) +END +INPUT +(SELECT * FROM t1 ORDER BY a DESC LIMIT 5 OFFSET 4) UNION (SELECT * FROM t2 ORDER BY a DESC LIMIT 4 OFFSET 2) LIMIT 7 OFFSET 1; +END +OUTPUT +(select * from t1 order by a desc limit 4, 5) union (select * from t2 order by a desc limit 2, 4) limit 1, 7 +END +INPUT +(SELECT a FROM t1 ORDER BY COUNT(*) LIMIT 1) UNION SELECT a FROM t1; +END +OUTPUT +(select a from t1 order by COUNT(*) asc limit 1) union (select a from t1) +END +INPUT +select * from t1 union select * from t2 order by 1 limit 1; +END +OUTPUT +(select * from t1) union (select * from t2) order by 1 asc limit 1 +END +INPUT +SELECT '2' as "3" UNION SELECT '1'; +END +OUTPUT +(select '2' as `3` from dual) union (select '1' from dual) +END +INPUT +select ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 -14,13 -8),(-5 -3,8 7),(-6 18,17 -11,-12 19,19 5),(16 11,9 -5),(17 -5,5 10),(-4 17,6 4),(-12 15,17 13,-18 11,15 10),(7 0,2 -16,-18 13,-6 4),(-17 -6,-6 -7,1 4,-18 0)),MULTILINESTRING((-11 -2,17 -14),(18 -12,18 -8),(-13 -16,9 16,9 -10,-7 20),(-14 -5,10 -9,4 1,17 -8),(-9 -4,-2 -12,9 -13,-5 4),(15 17,13 20)))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((-13 -18,-16 0),(17 11,-1 11,-18 -19,-4 -18),(-8 -8,-15 -13,3 -18,6 8)),LINESTRING(5 16,0 -9,-6 4,-15 17))'))) as result; +END +OUTPUT +select ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 -14,13 -8),(-5 -3,8 7),(-6 18,17 -11,-12 19,19 5),(16 11,9 -5),(17 -5,5 10),(-4 17,6 4),(-12 15,17 13,-18 11,15 10),(7 0,2 -16,-18 13,-6 4),(-17 -6,-6 -7,1 4,-18 0)),MULTILINESTRING((-11 -2,17 -14),(18 -12,18 -8),(-13 -16,9 16,9 -10,-7 20),(-14 -5,10 -9,4 1,17 -8),(-9 -4,-2 -12,9 -13,-5 4),(15 17,13 20)))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((-13 -18,-16 0),(17 11,-1 11,-18 -19,-4 -18),(-8 -8,-15 -13,3 -18,6 8)),LINESTRING(5 16,0 -9,-6 4,-15 17))'))) as result from dual +END +INPUT +SELECT 1 LOCK IN SHARE MODE UNION SELECT 2; +END +OUTPUT +(select 1 from dual lock in share mode) union (select 2 from dual) +END +INPUT +select a.text, b.id, b.betreff from t2 a inner join t3 b on a.id = b.forum inner join t1 c on b.id = c.thread where match(b.betreff) against ('+abc' in boolean mode) group by a.text, b.id, b.betreff union select a.text, b.id, b.betreff from t2 a inner join t3 b on a.id = b.forum inner join t1 c on b.id = c.thread where match(c.beitrag) against ('+abc' in boolean mode) group by a.text, b.id, b.betreff order by match(b.betreff) against ('+abc' in boolean mode) desc; +END +OUTPUT +(select a.`text`, b.id, b.betreff from t2 as a join t3 as b on a.id = b.forum join t1 as c on b.id = c.thread where match(b.betreff) against ('+abc' in boolean mode) group by a.`text`, b.id, b.betreff) union (select a.`text`, b.id, b.betreff from t2 as a join t3 as b on a.id = b.forum join t1 as c on b.id = c.thread where match(c.beitrag) against ('+abc' in boolean mode) group by a.`text`, b.id, b.betreff) order by match(b.betreff) against ('+abc' in boolean mode) desc +END +INPUT +SELECT 'н1234567890' UNION SELECT 1; +END +OUTPUT +(select 'н1234567890' from dual) union (select 1 from dual) +END +INPUT +SELECT t1.i FROM t1 WHERE FALSE AND t1.i > (SELECT MAX(a) FROM (SELECT 8 AS a UNION SELECT 3) AS tt); +END +OUTPUT +select t1.i from t1 where false and t1.i > (select MAX(a) from ((select 8 as a from dual) union (select 3 from dual)) as tt) +END +INPUT +(SELECT a FROM t1 ORDER BY COUNT(*)) UNION SELECT a FROM t1; +END +OUTPUT +(select a from t1 order by COUNT(*) asc) union (select a from t1) +END +INPUT +select 1 union select 1; +END +OUTPUT +(select 1 from dual) union (select 1 from dual) +END +INPUT +SELECT 2 as "my_col1",NULL AS "my_col2" UNION SELECT 1,NULL; +END +OUTPUT +(select 2 as my_col1, null as my_col2 from dual) union (select 1, null from dual) +END +INPUT +(SELECT * FROM t1 LIMIT 5) UNION ALL SELECT * FROM t2 LIMIT 8; +END +OUTPUT +(select * from t1 limit 5) union all (select * from t2) limit 8 +END +INPUT +SELECT 1 UNION ALL SELECT f1_two_inserts(); +END +OUTPUT +(select 1 from dual) union all (select f1_two_inserts() from dual) +END +INPUT +SELECT ST_AsText(ST_Union(ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(MULTIPOINT(0 0,100 100), MULTIPOINT(1 1, 2 2)))'), ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(),GEOMETRYCOLLECTION())'))) as result; +END +OUTPUT +select ST_AsText(ST_Union(ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(MULTIPOINT(0 0,100 100), MULTIPOINT(1 1, 2 2)))'), ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(),GEOMETRYCOLLECTION())'))) as result from dual +END +INPUT +SELECT (a DIV 254576881) FROM t1 UNION ALL SELECT (a DIV 254576881) FROM t1; +END +OUTPUT +(select a div 254576881 from t1) union all (select a div 254576881 from t1) +END +INPUT +SELECT a FROM t1 UNION (SELECT a FROM t1 ORDER BY COUNT(*) LIMIT 1 OFFSET 1); +END +OUTPUT +(select a from t1) union (select a from t1 order by COUNT(*) asc limit 1, 1) +END +INPUT +(SELECT * FROM t1 LIMIT 5) UNION SELECT * FROM t2 LIMIT 8; +END +OUTPUT +(select * from t1 limit 5) union (select * from t2) limit 8 +END +INPUT +select st_crosses(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_crosses(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +SELECT 1 UNION SELECT 2 FOR UPDATE; +END +OUTPUT +(select 1 from dual) union (select 2 from dual) for update +END +INPUT +select st_disjoint(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_disjoint(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +(SELECT MAX(f1) FROM t1) UNION (SELECT MAX(f1) FROM t1); +END +OUTPUT +(select MAX(f1) from t1) union (select MAX(f1) from t1) +END +INPUT +SELECT c FROM t1 UNION SELECT b FROM t2; +END +OUTPUT +(select c from t1) union (select b from t2) +END +INPUT +select * from t1 union all select * from t2; +END +OUTPUT +(select * from t1) union all (select * from t2) +END +INPUT +SELECT ST_ISVALID(ST_UNION(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 40,40 40,40 0,0 0),(10 10,30 10,30 30,10 30,10 10)))'), ST_GEOMFROMTEXT('MULTIPOLYGON(((15 10,10 15,10 17,15 10)),((15 10,10 20,10 22,15 10)),((15 10,10 25,10 27,15 10)),((25 10,30 17,30 15,25 10)),((25 10,30 22,30 20,25 10)),((25 10,30 27,30 25,25 10)),((18 10,20 30,19 10,18 10)),((21 10,20 30,22 10,21 10)))'))); +END +OUTPUT +select ST_ISVALID(ST_UNION(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 40,40 40,40 0,0 0),(10 10,30 10,30 30,10 30,10 10)))'), ST_GEOMFROMTEXT('MULTIPOLYGON(((15 10,10 15,10 17,15 10)),((15 10,10 20,10 22,15 10)),((15 10,10 25,10 27,15 10)),((25 10,30 17,30 15,25 10)),((25 10,30 22,30 20,25 10)),((25 10,30 27,30 25,25 10)),((18 10,20 30,19 10,18 10)),((21 10,20 30,22 10,21 10)))'))) from dual +END +INPUT +SELECT a, SUM(a), SUM(a)+1, CONCAT(SUM(a),'x'), SUM(a)+SUM(a), SUM(a) FROM (SELECT 1 a, 2 b UNION SELECT 2,3 UNION SELECT 5,6 ) d GROUP BY a WITH ROLLUP ORDER BY GROUPING(a),a; +END +ERROR +syntax error at position 154 near 'WITH' +END +INPUT +SELECT ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())))'))) as geom; +END +OUTPUT +select ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())))'))) as geom from dual +END +INPUT +SELECT ST_AsText(ST_Union(ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(linestring(0 0,100 100), MULTIPOINT(1 1, 2 2)))'), ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(),GEOMETRYCOLLECTION())'))) as result; +END +OUTPUT +select ST_AsText(ST_Union(ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(linestring(0 0,100 100), MULTIPOINT(1 1, 2 2)))'), ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(),GEOMETRYCOLLECTION())'))) as result from dual +END +INPUT +(SELECT a FROM t1 ORDER BY COUNT(*) LIMIT 1) UNION (SELECT a FROM t1 ORDER BY COUNT(*) LIMIT 1 OFFSET 1); +END +OUTPUT +(select a from t1 order by COUNT(*) asc limit 1) union (select a from t1 order by COUNT(*) asc limit 1, 1) +END +INPUT +SELECT 2 as "my_col" UNION SELECT 1; +END +OUTPUT +(select 2 as my_col from dual) union (select 1 from dual) +END +INPUT +select (with recursive dt as (select t1.a as a union select a+1 from dt where a<10) select concat(count(*), ' - ', avg(dt.a)) from dt ) as subq from t1; +END +ERROR +syntax error at position 15 near 'with' +END +INPUT +SELECT 'before' AS t, id, val1, hex(val1) FROM t1 UNION SELECT 'after' AS t, id, val1, hex(val1) FROM t2 ORDER BY id,t DESC; +END +OUTPUT +(select 'before' as t, id, val1, hex(val1) from t1) union (select 'after' as t, id, val1, hex(val1) from t2) order by id asc, t desc +END +INPUT +SELECT 1 UNION SELECT 'н1234567890'; +END +OUTPUT +(select 1 from dual) union (select 'н1234567890' from dual) +END +INPUT +(SELECT * FROM t1 ORDER BY a DESC LIMIT 5) UNION (SELECT * FROM t2 ORDER BY a DESC LIMIT 4) ORDER BY a LIMIT 7; +END +OUTPUT +(select * from t1 order by a desc limit 5) union (select * from t2 order by a desc limit 4) order by a asc limit 7 +END +INPUT +select st_contains(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_contains(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +SELECT ST_AsText(ST_Union(ST_GEOMFROMTEXT( 'GEOMETRYCOLLECTION(LINESTRING(3 1, 6 1), LINESTRING(0 1, 4 1))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))) as result; +END +OUTPUT +select ST_AsText(ST_Union(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(3 1, 6 1), LINESTRING(0 1, 4 1))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))) as result from dual +END +INPUT +select * from (select * from t1 union all select * from t1) a; +END +OUTPUT +select * from ((select * from t1) union all (select * from t1)) as a +END +INPUT +SELECT sleep(0.5) FROM t17059925 UNION SELECT * FROM (SELECT * FROM t17059925 WHERE a= 10) t WHERE a = 10 UNION SELECT * from t2; +END +OUTPUT +(select sleep(0.5) from t17059925) union (select * from (select * from t17059925 where a = 10) as t where a = 10) union (select * from t2) +END +INPUT +(SELECT max(b), a FROM t1 GROUP BY a) UNION (SELECT max(b), a FROM t1 GROUP BY a); +END +OUTPUT +(select max(b), a from t1 group by a) union (select max(b), a from t1 group by a) +END +INPUT +SELECT a FROM t1 UNION ALL (SELECT a FROM t1 ORDER BY COUNT(*) LIMIT 1 OFFSET 1); +END +OUTPUT +(select a from t1) union all (select a from t1 order by COUNT(*) asc limit 1, 1) +END +INPUT +(SELECT p1 FROM v2 LEFT JOIN v1 ON b = a WHERE p2 = 1 GROUP BY p1 ORDER BY p1) UNION (SELECT NULL LIMIT 0); +END +OUTPUT +(select p1 from v2 left join v1 on b = a where p2 = 1 group by p1 order by p1 asc) union (select null from dual limit 0) +END +INPUT +SELECT * FROM t17059925 WHERE a= 10 UNION SELECT sleep(0.5); +END +OUTPUT +(select * from t17059925 where a = 10) union (select sleep(0.5) from dual) +END +INPUT +SELECT a, SUM(a), SUM(a)+1 FROM (SELECT 1 a UNION select 2) d GROUP BY a; +END +OUTPUT +select a, SUM(a), SUM(a) + 1 from ((select 1 as a from dual) union (select 2 from dual)) as d group by a +END +INPUT +SELECT 2, 3 UNION SELECT 4, 5; +END +OUTPUT +(select 2, 3 from dual) union (select 4, 5 from dual) +END +INPUT +SELECT 1 FOR SHARE UNION SELECT 2; +END +ERROR +syntax error at position 19 near 'SHARE' +END +INPUT +SELECT ST_AsText(ST_Union(shore, boundary)) FROM lakes, named_places WHERE lakes.name = 'Blue Lake' AND named_places.name = 'Goose Island'; +END +OUTPUT +select ST_AsText(ST_Union(shore, boundary)) from lakes, named_places where lakes.`name` = 'Blue Lake' and named_places.`name` = 'Goose Island' +END +INPUT +(SELECT max(b), a FROM t1 GROUP BY a) UNION (SELECT max(b), a FROM t1 GROUP BY a); +END +OUTPUT +(select max(b), a from t1 group by a) union (select max(b), a from t1 group by a) +END +INPUT +SELECT ST_AsText(ST_Union(ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(polygon((0 0,10 0, 10 10, 0 10, 0 0)), MULTIPOINT(1 1, 2 2)))'), ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(),GEOMETRYCOLLECTION())'))) as result; +END +OUTPUT +select ST_AsText(ST_Union(ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(polygon((0 0,10 0, 10 10, 0 10, 0 0)), MULTIPOINT(1 1, 2 2)))'), ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(),GEOMETRYCOLLECTION())'))) as result from dual +END +INPUT +(SELECT * FROM t1 ORDER BY a DESC LIMIT 5 OFFSET 4) UNION ALL SELECT * FROM t2 LIMIT 8 OFFSET 1; +END +OUTPUT +(select * from t1 order by a desc limit 4, 5) union all (select * from t2) limit 1, 8 +END +INPUT +SELECT ST_ISVALID(ST_UNION(ST_GEOMFROMTEXT('LINESTRING(12 6,9 4,-9 1,-4 -6,12 -9,-9 -17,17 -11,-16 17,19 -19,0 -16,6 -5,15 3,14 -5,18 13,-9 10,-11 8)'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((-18 2,1 7),(-19 -3,-16 -12),(10 0,3 8,12 19,8 -15)),MULTILINESTRING((8 16,-8 -3),(18 3,8 12),(-19 4,20 14)),POLYGON((2 3,-9 -7,12 -13,2 3)),MULTILINESTRING((16 -7,-2 2,11 -10,-1 8),(6 0,-15 0,16 0,-6 -14)))'))); +END +OUTPUT +select ST_ISVALID(ST_UNION(ST_GEOMFROMTEXT('LINESTRING(12 6,9 4,-9 1,-4 -6,12 -9,-9 -17,17 -11,-16 17,19 -19,0 -16,6 -5,15 3,14 -5,18 13,-9 10,-11 8)'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((-18 2,1 7),(-19 -3,-16 -12),(10 0,3 8,12 19,8 -15)),MULTILINESTRING((8 16,-8 -3),(18 3,8 12),(-19 4,20 14)),POLYGON((2 3,-9 -7,12 -13,2 3)),MULTILINESTRING((16 -7,-2 2,11 -10,-1 8),(6 0,-15 0,16 0,-6 -14)))'))) from dual +END +INPUT +select s1 from t1 where s1 in (select version from information_schema.tables) union select version from information_schema.tables; +END +OUTPUT +(select s1 from t1 where s1 in (select version from information_schema.`tables`)) union (select version from information_schema.`tables`) +END +INPUT +SELECT /*+ MAX_EXECUTION_TIME(0) */ * FROM t1 WHERE a IN (SELECT a FROM t1 UNION SELECT /*+ MAX_EXECUTION_TIME(0) */ a FROM t1); +END +OUTPUT +select /*+ MAX_EXECUTION_TIME(0) */ * from t1 where a in ((select a from t1) union (select /*+ MAX_EXECUTION_TIME(0) */ a from t1)) +END +INPUT +SELECT '2' as "my_col1",2 as "my_col2" UNION SELECT '1',1 from t2; +END +OUTPUT +(select '2' as my_col1, 2 as my_col2 from dual) union (select '1', 1 from t2) +END +INPUT +SELECT ST_AsText(ST_Union(ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(MULTIPOINT(0 0,100 100), linestring(1 1, 2 2)))'), ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(),GEOMETRYCOLLECTION())'))) as result; +END +OUTPUT +select ST_AsText(ST_Union(ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(MULTIPOINT(0 0,100 100), linestring(1 1, 2 2)))'), ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(),GEOMETRYCOLLECTION())'))) as result from dual +END +INPUT +SELECT 'case+union+test' UNION SELECT CASE '1' WHEN '2' THEN 'BUG' ELSE 'nobug' END; +END +OUTPUT +(select 'case+union+test' from dual) union (select case '1' when '2' then 'BUG' else 'nobug' end from dual) +END +INPUT +SELECT ST_AsText(ST_Union(ST_GEOMFROMTEXT( 'GEOMETRYCOLLECTION(POLYGON((0 0, 3 0, 3 3, 0 3, 0 0)), LINESTRING(3 0, 3 1, 4 2))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))) as result; +END +OUTPUT +select ST_AsText(ST_Union(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0, 3 0, 3 3, 0 3, 0 0)), LINESTRING(3 0, 3 1, 4 2))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))) as result from dual +END +INPUT +SELECT 1 UNION SELECT 1 FOR UPDATE INTO @var; +END +ERROR +syntax error at position 40 near 'INTO' +END +INPUT +SELECT ST_ASTEXT(ST_VALIDATE(ST_UNION(ST_GEOMFROMTEXT('MULTIPOLYGON(((-7 -9,-3 7,0 -10,-6 5,10 10,-3 -4,7 9,2 -9)),((1 -10,-3 10,-2 5)))'), ST_GEOMFROMTEXT('POLYGON((6 10,-7 10,-1 -6,0 5,5 4,1 -9,1 3,-10 -7,-10 8))')))) as result; +END +OUTPUT +select ST_ASTEXT(ST_VALIDATE(ST_UNION(ST_GEOMFROMTEXT('MULTIPOLYGON(((-7 -9,-3 7,0 -10,-6 5,10 10,-3 -4,7 9,2 -9)),((1 -10,-3 10,-2 5)))'), ST_GEOMFROMTEXT('POLYGON((6 10,-7 10,-1 -6,0 5,5 4,1 -9,1 3,-10 -7,-10 8))')))) as result from dual +END +INPUT +SELECT a, SUM(a), SUM(a)+1, CONCAT(SUM(a),'x'), SUM(a)+SUM(a), SUM(a) FROM (SELECT 1 a, 2 b UNION SELECT 2,3 UNION SELECT 5,6 ) d GROUP BY a WITH ROLLUP ORDER BY SUM(a); +END +ERROR +syntax error at position 154 near 'WITH' +END +INPUT +select 'a' union select concat('a', -0.0); +END +OUTPUT +(select 'a' from dual) union (select concat('a', -0.0) from dual) +END +INPUT +select st_within(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_within(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +(SELECT a FROM t1 ORDER BY COUNT(*) LIMIT 1) UNION ALL (SELECT a FROM t1 ORDER BY COUNT(*) LIMIT 1 OFFSET 1); +END +OUTPUT +(select a from t1 order by COUNT(*) asc limit 1) union all (select a from t1 order by COUNT(*) asc limit 1, 1) +END +INPUT +select 'a' union select concat('a', -(4 + 1)); +END +OUTPUT +(select 'a' from dual) union (select concat('a', -(4 + 1)) from dual) +END +INPUT +SELECT ST_AsText(ST_Union(ST_GeomFromText('MULTIPOINT(0 0,100 100)'), ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(),GEOMETRYCOLLECTION())'))) as result; +END +OUTPUT +select ST_AsText(ST_Union(ST_GeomFromText('MULTIPOINT(0 0,100 100)'), ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(),GEOMETRYCOLLECTION())'))) as result from dual +END +INPUT +SELECT * FROM t1 UNION ALL SELECT * FROM t2 ORDER BY a LIMIT 5; +END +OUTPUT +(select * from t1) union all (select * from t2) order by a asc limit 5 +END +INPUT +SELECT * FROM (SELECT * FROM t17059925 WHERE a= 10) t WHERE a = 10 UNION SELECT sleep(0.5); +END +OUTPUT +(select * from (select * from t17059925 where a = 10) as t where a = 10) union (select sleep(0.5) from dual) +END +INPUT +SELECT ST_ISVALID(ST_UNION(ST_GEOMFROMTEXT('POLYGON((4 5,12 11,-12 -3,4 5))'), ST_GEOMFROMTEXT('MULTIPOLYGON(((5 4,-14 0,1 0,5 4)),((1 6,13 0,10 12,1 6)))'))); +END +OUTPUT +select ST_ISVALID(ST_UNION(ST_GEOMFROMTEXT('POLYGON((4 5,12 11,-12 -3,4 5))'), ST_GEOMFROMTEXT('MULTIPOLYGON(((5 4,-14 0,1 0,5 4)),((1 6,13 0,10 12,1 6)))'))) from dual +END +INPUT +select 1 as a from t1 union all select 1 from dual limit 1; +END +OUTPUT +(select 1 as a from t1) union all (select 1 from dual) limit 1 +END +INPUT +SELECT * FROM a LEFT JOIN vmerge AS v ON a.id = v.id UNION DISTINCT SELECT * FROM a LEFT JOIN vmerge AS v ON a.id = v.id; +END +OUTPUT +(select * from a left join vmerge as v on a.id = v.id) union (select * from a left join vmerge as v on a.id = v.id) +END +INPUT +(select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 DAY)),'%H') As H) union (select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 DAY)),'%H') As H); +END +OUTPUT +(select time_format(timediff(now(), DATE_SUB(now(), interval 5 DAY)), '%H') as H from dual) union (select time_format(timediff(now(), DATE_SUB(now(), interval 5 DAY)), '%H') as H from dual) +END +INPUT +select st_overlaps(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_overlaps(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +SELECT ST_AsText(ST_Union(ST_GEOMFROMTEXT( 'GEOMETRYCOLLECTION(LINESTRING(3 1, 3 3), LINESTRING(0 1, 4 1))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))) as result; +END +OUTPUT +select ST_AsText(ST_Union(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(3 1, 3 3), LINESTRING(0 1, 4 1))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))) as result from dual +END +INPUT +SELECT * FROM t1 UNION ALL SELECT * FROM t2 LIMIT 5; +END +OUTPUT +(select * from t1) union all (select * from t2) limit 5 +END +INPUT +SELECT * FROM t17059925 WHERE a= 10 AND a= 20 UNION SELECT sleep(0.5); +END +OUTPUT +(select * from t17059925 where a = 10 and a = 20) union (select sleep(0.5) from dual) +END +INPUT +SELECT TIME_FORMAT(SEC_TO_TIME(a),"%H:%i:%s") FROM (SELECT 3020399 AS a UNION SELECT 3020398 ) x GROUP BY 1; +END +OUTPUT +select TIME_FORMAT(SEC_TO_TIME(a), '%H:%i:%s') from ((select 3020399 as a from dual) union (select 3020398 from dual)) as x group by 1 +END +INPUT +(SELECT * FROM t1 ORDER BY a DESC LIMIT 5 OFFSET 4) UNION SELECT * FROM t2 LIMIT 8 OFFSET 1; +END +OUTPUT +(select * from t1 order by a desc limit 4, 5) union (select * from t2) limit 1, 8 +END +INPUT +SELECT ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(1 1), GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())))'))) as geom; +END +OUTPUT +select ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(1 1), GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())))'))) as geom from dual +END +INPUT +select 'a' union select concat('a', -4.5); +END +OUTPUT +(select 'a' from dual) union (select concat('a', -4.5) from dual) +END +INPUT +(SELECT a FROM t1 ORDER BY COUNT(*)) UNION ALL (SELECT a FROM t1 ORDER BY COUNT(*)); +END +OUTPUT +(select a from t1 order by COUNT(*) asc) union all (select a from t1 order by COUNT(*) asc) +END +INPUT +select 1 as a union all select 1 union all select 2 union select 1 union all select 2; +END +OUTPUT +(select 1 as a from dual) union all (select 1 from dual) union all (select 2 from dual) union (select 1 from dual) union all (select 2 from dual) +END +INPUT +select (ST_aswkb(cast(st_union(multipoint( point(8,6), point(1,-17679), point(-9,-9)), linestring(point(91,12), point(-77,49), point(53,-81)))as char(18)))) in ('1','2'); +END +OUTPUT +select ST_aswkb(convert(st_union(multipoint(point(8, 6), point(1, -17679), point(-9, -9)), linestring(point(91, 12), point(-77, 49), point(53, -81))), char(18))) in ('1', '2') from dual +END +INPUT +select st_astext(st_union(cast(point(1,1)as char(15)),point(1,1))) as res; +END +OUTPUT +select st_astext(st_union(convert(point(1, 1), char(15)), point(1, 1))) as res from dual +END +INPUT +select st_crosses(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_crosses(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 -14,13 -8),(-5 -3,8 7),(-6 18,17 -11,-12 19,19 5),(16 11,9 -5),(17 -5,5 10),(-4 17,6 4),(-12 15,17 13,-18 11,15 10),(7 0,2 -16,-18 13,-6 4),(-17 -6,-6 -7,1 4,-18 0)),MULTIPOINT(0 14,-9 -11),MULTILINESTRING((-11 -2,17 -14),(18 -12,18 -8),(-13 -16,9 16,9 -10,-7 20),(-14 -5,10 -9,4 1,17 -8),(-9 -4,-2 -12,9 -13,-5 4),(15 17,13 20)),MULTIPOINT(16 1,-9 -17,-16 6,-17 3),POINT(-18 13))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(7 0),MULTILINESTRING((-13 -18,-16 0),(17 11,-1 11,-18 -19,-4 -18),(-8 -8,-15 -13,3 -18,6 8)),LINESTRING(5 16,0 -9,-6 4,-15 17),MULTIPOINT(-9 -5,5 15,12 -11,12 11))'))) as result; +END +OUTPUT +select ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 -14,13 -8),(-5 -3,8 7),(-6 18,17 -11,-12 19,19 5),(16 11,9 -5),(17 -5,5 10),(-4 17,6 4),(-12 15,17 13,-18 11,15 10),(7 0,2 -16,-18 13,-6 4),(-17 -6,-6 -7,1 4,-18 0)),MULTIPOINT(0 14,-9 -11),MULTILINESTRING((-11 -2,17 -14),(18 -12,18 -8),(-13 -16,9 16,9 -10,-7 20),(-14 -5,10 -9,4 1,17 -8),(-9 -4,-2 -12,9 -13,-5 4),(15 17,13 20)),MULTIPOINT(16 1,-9 -17,-16 6,-17 3),POINT(-18 13))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(7 0),MULTILINESTRING((-13 -18,-16 0),(17 11,-1 11,-18 -19,-4 -18),(-8 -8,-15 -13,3 -18,6 8)),LINESTRING(5 16,0 -9,-6 4,-15 17),MULTIPOINT(-9 -5,5 15,12 -11,12 11))'))) as result from dual +END +INPUT +SELECT * FROM t1 UNION SELECT * FROM t2 LIMIT 5 OFFSET 6; +END +OUTPUT +(select * from t1) union (select * from t2) limit 6, 5 +END +INPUT +SELECT 1 FROM t1 AS alias1 JOIN t2 AS alias2 ON alias1.col_int = alias2.col_int JOIN t1 AS alias3 ON 1 WHERE ( SELECT 1 UNION SELECT MAX(alias1.pk) ) = alias3.pk; +END +OUTPUT +select 1 from t1 as alias1 join t2 as alias2 on alias1.col_int = alias2.col_int join t1 as alias3 on 1 where ((select 1 from dual) union (select MAX(alias1.pk) from dual)) = alias3.pk +END +INPUT +select (with recursive dt as (select t1.a as a union all select a+1 from dt where a<10) select concat(count(*), ' - ', avg(dt.a)) from dt ) as subq from t1; +END +ERROR +syntax error at position 15 near 'with' +END +INPUT +select a.text, b.id, b.betreff from t2 a inner join t3 b on a.id = b.forum inner join t1 c on b.id = c.thread where match(b.betreff) against ('+abc' in boolean mode) union select a.text, b.id, b.betreff from t2 a inner join t3 b on a.id = b.forum inner join t1 c on b.id = c.thread where match(c.beitrag) against ('+abc' in boolean mode) order by match(b.betreff) against ('+abc' in boolean mode) desc; +END +OUTPUT +(select a.`text`, b.id, b.betreff from t2 as a join t3 as b on a.id = b.forum join t1 as c on b.id = c.thread where match(b.betreff) against ('+abc' in boolean mode)) union (select a.`text`, b.id, b.betreff from t2 as a join t3 as b on a.id = b.forum join t1 as c on b.id = c.thread where match(c.beitrag) against ('+abc' in boolean mode)) order by match(b.betreff) against ('+abc' in boolean mode) desc +END +INPUT +SELECT ST_AsText(ST_Union(ST_GEOMFROMTEXT( 'GEOMETRYCOLLECTION(POLYGON((5 0,0 10,10 10,5 0)), POLYGON((5 0,0 -10,10 -10,5 0)))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))) as result; +END +OUTPUT +select ST_AsText(ST_Union(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((5 0,0 10,10 10,5 0)), POLYGON((5 0,0 -10,10 -10,5 0)))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))) as result from dual +END +INPUT +SELECT a DIV 2 FROM t1 UNION SELECT a DIV 2 FROM t1; +END +OUTPUT +(select a div 2 from t1) union (select a div 2 from t1) +END +INPUT +SELECT a FROM t1 UNION ALL (SELECT a FROM t1 ORDER BY COUNT(*)); +END +OUTPUT +(select a from t1) union all (select a from t1 order by COUNT(*) asc) +END +INPUT +SELECT ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('MULTIPOLYGON(((-7 -9,-3 7,0 -10,-6 5,10 10,-3 -4,7 9,2 -9)),((1 -10,-3 10,-2 5)))'), ST_GEOMFROMTEXT('POLYGON((6 10,-7 10,-1 -6,0 5,5 4,1 -9,1 3,-10 -7,-10 8))'))) as result; +END +OUTPUT +select ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('MULTIPOLYGON(((-7 -9,-3 7,0 -10,-6 5,10 10,-3 -4,7 9,2 -9)),((1 -10,-3 10,-2 5)))'), ST_GEOMFROMTEXT('POLYGON((6 10,-7 10,-1 -6,0 5,5 4,1 -9,1 3,-10 -7,-10 8))'))) as result from dual +END +INPUT +(SELECT * FROM t1 LIMIT 5) UNION ALL (SELECT * FROM t2 LIMIT 4) ORDER BY a LIMIT 7; +END +OUTPUT +(select * from t1 limit 5) union all (select * from t2 limit 4) order by a asc limit 7 +END +INPUT +SELECT sleep(0.5) FROM t17059925 UNION SELECT 1 FROM dual WHERE 1= 0 UNION SELECT * FROM t2; +END +OUTPUT +(select sleep(0.5) from t17059925) union (select 1 from dual where 1 = 0) union (select * from t2) +END +INPUT +SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c; +END +OUTPUT +(select * from t1) union (select * from t2) order by a asc, b asc, c asc +END +INPUT +select repeat(_utf8mb4'+',3) as h union select NULL; +END +OUTPUT +(select repeat(_utf8mb4 '+', 3) as h from dual) union (select null from dual) +END +INPUT +select * from (select * from t1 union distinct select * from t2 union all select * from t3) X; +END +OUTPUT +select * from ((select * from t1) union (select * from t2) union all (select * from t3)) as X +END +INPUT +SELECT sleep(0.5) from t17059925 UNION SELECT t17059925_func1(1); +END +OUTPUT +(select sleep(0.5) from t17059925) union (select t17059925_func1(1) from dual) +END +INPUT +select a.text, b.id, b.betreff from t2 a inner join t3 b on a.id = b.forum inner join t1 c on b.id = c.thread where match(b.betreff) against ('+abc' in boolean mode) union select a.text, b.id, b.betreff from t2 a inner join t3 b on a.id = b.forum inner join t1 c on b.id = c.thread where match(c.beitrag) against ('+abc' in boolean mode) order by match(betreff) against ('+abc' in boolean mode) desc; +END +OUTPUT +(select a.`text`, b.id, b.betreff from t2 as a join t3 as b on a.id = b.forum join t1 as c on b.id = c.thread where match(b.betreff) against ('+abc' in boolean mode)) union (select a.`text`, b.id, b.betreff from t2 as a join t3 as b on a.id = b.forum join t1 as c on b.id = c.thread where match(c.beitrag) against ('+abc' in boolean mode)) order by match(betreff) against ('+abc' in boolean mode) desc +END +INPUT +(SELECT * FROM t1 ORDER BY a DESC LIMIT 5) UNION SELECT * FROM t2 LIMIT 8; +END +OUTPUT +(select * from t1 order by a desc limit 5) union (select * from t2) limit 8 +END +INPUT +SELECT ST_AsText(ST_Union(ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(polygon((0 0,10 0, 10 10, 0 10, 0 0)), polygon((0 0, 1 0, 1 1, 0 1, 0 0))))'), ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(),GEOMETRYCOLLECTION())'))) as result; +END +OUTPUT +select ST_AsText(ST_Union(ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(polygon((0 0,10 0, 10 10, 0 10, 0 0)), polygon((0 0, 1 0, 1 1, 0 1, 0 0))))'), ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(),GEOMETRYCOLLECTION())'))) as result from dual +END +INPUT +select st_astext(st_union(ST_GeometryFromText('geometrycollection(polygon((0 0, 1 0, 1 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 2 0, 2 1, 1 1, 1 0)))'))); +END +OUTPUT +select st_astext(st_union(ST_GeometryFromText('geometrycollection(polygon((0 0, 1 0, 1 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 2 0, 2 1, 1 1, 1 0)))'))) from dual +END +INPUT +select st_within(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_within(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +SELECT ST_AsText(ST_Union(ST_GEOMFROMTEXT( 'GEOMETRYCOLLECTION(LINESTRING(3 0, 3 3), LINESTRING(0 1, 4 1))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))) as result; +END +OUTPUT +select ST_AsText(ST_Union(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(3 0, 3 3), LINESTRING(0 1, 4 1))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))) as result from dual +END +INPUT +(SELECT * FROM t1 ORDER BY a DESC LIMIT 5 OFFSET 4) UNION SELECT * FROM t2 ORDER BY a LIMIT 8 OFFSET 1; +END +OUTPUT +(select * from t1 order by a desc limit 4, 5) union (select * from t2) order by a asc limit 1, 8 +END +INPUT +SELECT * FROM t1 UNION SELECT * FROM t2 LIMIT 5; +END +OUTPUT +(select * from t1) union (select * from t2) limit 5 +END +INPUT +SELECT ST_Union('', ''), md5(1); +END +OUTPUT +select ST_Union('', ''), md5(1) from dual +END +INPUT +select st_union((cast(linestring(point(6,-68), point(-22,-4)) as binary(13))), st_intersection(point(6,8),multipoint(point(3,1),point(-4,-6),point(1,6),point(-3,-5),point(5,4)))); +END +OUTPUT +select st_union(convert(linestring(point(6, -68), point(-22, -4)), binary(13)), st_intersection(point(6, 8), multipoint(point(3, 1), point(-4, -6), point(1, 6), point(-3, -5), point(5, 4)))) from dual +END +INPUT +SELECT ST_ISVALID(ST_UNION(ST_GEOMFROMTEXT('POLYGON((0 0,10 10,20 0,0 0))'), ST_GEOMFROMTEXT('POLYGON((10 5,20 7,10 10,30 10,20 0,20 5,10 5))'))); +END +OUTPUT +select ST_ISVALID(ST_UNION(ST_GEOMFROMTEXT('POLYGON((0 0,10 10,20 0,0 0))'), ST_GEOMFROMTEXT('POLYGON((10 5,20 7,10 10,30 10,20 0,20 5,10 5))'))) from dual +END +INPUT +select * from t1 union select * from t2 order by 1, 2; +END +OUTPUT +(select * from t1) union (select * from t2) order by 1 asc, 2 asc +END +INPUT +(SELECT * FROM t1 ORDER BY a DESC LIMIT 5 OFFSET 4) UNION ALL SELECT * FROM t2 ORDER BY a LIMIT 8 OFFSET 1; +END +OUTPUT +(select * from t1 order by a desc limit 4, 5) union all (select * from t2) order by a asc limit 1, 8 +END +INPUT +SELECT '1' as "my_col1",2 as "my_col2" UNION SELECT '2',1; +END +OUTPUT +(select '1' as my_col1, 2 as my_col2 from dual) union (select '2', 1 from dual) +END +INPUT +SELECT @a:= CAST(f1 AS SIGNED) FROM t1 UNION ALL SELECT CAST(f1 AS SIGNED) FROM t1; +END +ERROR +syntax error at position 11 near ':' +END +INPUT +(SELECT a FROM t1 ORDER BY COUNT(*)) UNION (SELECT a FROM t1 ORDER BY COUNT(*)); +END +OUTPUT +(select a from t1 order by COUNT(*) asc) union (select a from t1 order by COUNT(*) asc) +END +INPUT +SELECT GROUP_CONCAT(t.c) as c FROM t1 t UNION SELECT '' as c; +END +OUTPUT +(select group_concat(t.c) as c from t1 as t) union (select '' as c from dual) +END +INPUT +SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 UNION SELECT /*+ MAX_EXECUTION_TIME(0) */ a FROM t1); +END +OUTPUT +select * from t1 where a in ((select a from t1) union (select /*+ MAX_EXECUTION_TIME(0) */ a from t1)) +END +INPUT +select * from t1 union distinct select * from t2; +END +OUTPUT +(select * from t1) union (select * from t2) +END +INPUT +SELECT * FROM (SELECT 1 UNION SELECT a) b; +END +OUTPUT +select * from ((select 1 from dual) union (select a from dual)) as b +END +INPUT +SELECT a, SUM(a), SUM(a)+1 FROM (SELECT a FROM t1 UNION select 2) d GROUP BY a; +END +OUTPUT +select a, SUM(a), SUM(a) + 1 from ((select a from t1) union (select 2 from dual)) as d group by a END From cc1ff51143b06d9cfbb1e59b9bdc09213780c028 Mon Sep 17 00:00:00 2001 From: ritwizsinha Date: Wed, 15 Sep 2021 13:23:23 +0530 Subject: [PATCH 3/6] Added the select cases Signed-off-by: ritwizsinha --- go/vt/sqlparser/parse_test.go | 15 +- go/vt/sqlparser/testdata/select_cases.txt | 23124 ++++++++++++++++++++ 2 files changed, 23138 insertions(+), 1 deletion(-) create mode 100644 go/vt/sqlparser/testdata/select_cases.txt diff --git a/go/vt/sqlparser/parse_test.go b/go/vt/sqlparser/parse_test.go index d4637fed353..7ac759104cb 100644 --- a/go/vt/sqlparser/parse_test.go +++ b/go/vt/sqlparser/parse_test.go @@ -3495,7 +3495,7 @@ func BenchmarkParse3(b *testing.B) { }) } -func TestValidCases(t *testing.T) { +func TestValidUnionCases(t *testing.T) { testOutputTempDir, err := ioutil.TempDir("", "parse_test") require.NoError(t, err) defer func() { @@ -3506,6 +3506,19 @@ func TestValidCases(t *testing.T) { testFile(t, "union_cases.txt", testOutputTempDir) } + +func TestValidSelectCases(t *testing.T) { + testOutputTempDir, err := ioutil.TempDir("", "parse_test") + require.NoError(t, err) + defer func() { + if !t.Failed() { + os.RemoveAll(testOutputTempDir) + } + }() + + testFile(t, "select_cases.txt", testOutputTempDir) +} + type testCase struct { file string lineno int diff --git a/go/vt/sqlparser/testdata/select_cases.txt b/go/vt/sqlparser/testdata/select_cases.txt new file mode 100644 index 00000000000..d8bb2249583 --- /dev/null +++ b/go/vt/sqlparser/testdata/select_cases.txt @@ -0,0 +1,23124 @@ +INPUT +select round(5.5),round(-5.5); +END +OUTPUT +select round(5.5), round(-5.5) from dual +END +INPUT +select concat(a, if(b>10, _utf8 0xC3A6, _utf8 0xC3AF)) from t1; +END +OUTPUT +select concat(a, if(b > 10, _utf8 0xC3A6, _utf8 0xC3AF)) from t1 +END +INPUT +select a as 'x', t1.*, b as 'x' from t1; +END +OUTPUT +select a as x, t1.*, b as x from t1 +END +INPUT +select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner); +END +OUTPUT +select t1.`name`, t2.`name`, t2.id from t1 left join t2 on t1.id = t2.owner +END +INPUT +select from ((t1 natural join t2), (t3 natural join t4)) natural join t5; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select ref_mag from t1 where match ref_mag against ('+test' in boolean mode); +END +ERROR +syntax error at position 43 near 'ref_mag' +END +INPUT +select week(20010101,0) as '0', week(20010101,1) as '1', week(20010101,2) as '2', week(20010101,3) as '3', week(20010101,4) as '4', week(20010101,5) as '5', week(20010101,6) as '6', week(20010101,7) as '7'; +END +OUTPUT +select week(20010101, 0) as `0`, week(20010101, 1) as `1`, week(20010101, 2) as `2`, week(20010101, 3) as `3`, week(20010101, 4) as `4`, week(20010101, 5) as `5`, week(20010101, 6) as `6`, week(20010101, 7) as `7` from dual +END +INPUT +select a1,a2,b, max(c) from t1 where (c < 'a0') or (c > 'b1') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c) from t1 where c < 'a0' or c > 'b1' group by a1, a2, b +END +INPUT +select from t1 left join t2 on venue_id = entity_id where match(name) against('aberdeen' in boolean mode) and dt = '2003-05-23 19:30:00'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner) where t2.id is null; +END +OUTPUT +select t1.`name`, t2.`name`, t2.id from t1 left join t2 on t1.id = t2.owner where t2.id is null +END +INPUT +select to_days("0000-00-00"),to_days(d),to_days(dt),to_days(t),to_days(c) from t1; +END +OUTPUT +select to_days('0000-00-00'), to_days(d), to_days(dt), to_days(t), to_days(c) from t1 +END +INPUT +select week(19981231),week(19971231),week(19981231,1),week(19971231,1); +END +OUTPUT +select week(19981231), week(19971231), week(19981231, 1), week(19971231, 1) from dual +END +INPUT +select substring_index('www.tcx.se','tcx',1),substring_index('www.tcx.se','tcx',-1); +END +OUTPUT +select substring_index('www.tcx.se', 'tcx', 1), substring_index('www.tcx.se', 'tcx', -1) from dual +END +INPUT +select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296; +END +OUTPUT +select 0, 256, 00000000000000065536, 2147483647, -2147483648, 2147483648, 4294967296 from dual +END +INPUT +select a1, max(c) from t2 where a1 >= 'c' or a1 < 'b' group by a1,a2,b; +END +OUTPUT +select a1, max(c) from t2 where a1 >= 'c' or a1 < 'b' group by a1, a2, b +END +INPUT +select from t1 order by b; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select lpad('hello', 4294967296, '1'); +END +OUTPUT +select lpad('hello', 4294967296, '1') from dual +END +INPUT +select from v3 order by a; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES WHERE ROUTINE_SCHEMA='test' ORDER BY ROUTINE_NAME; +END +OUTPUT +select ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_SCHEMA = 'test' order by ROUTINE_NAME asc +END +INPUT +select get_lock("test_lock1", 20); +END +OUTPUT +select get_lock('test_lock1', 20) from dual +END +INPUT +select sum(col1) from t1 group by col_t1 having col_t1 in (select sum(t2.col1) from t2 group by t2.col2, t2.col1 having t2.col1 = t1.col1); +END +OUTPUT +select sum(col1) from t1 group by col_t1 having col_t1 in (select sum(t2.col1) from t2 group by t2.col2, t2.col1 having t2.col1 = t1.col1) +END +INPUT +select t,count(*) from t1 group by t order by t limit 10; +END +OUTPUT +select t, count(*) from t1 group by t order by t asc limit 10 +END +INPUT +select 'andre%' like 'andreñ%' escape 'ñ'; +END +OUTPUT +select 'andre%' like 'andreñ%' escape 'ñ' from dual +END +INPUT +select inet_aton(""); +END +OUTPUT +select inet_aton('') from dual +END +INPUT +select from t1 where word like 'AE'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select yearweek('1987-01-01',1),yearweek('1987-01-01'); +END +OUTPUT +select yearweek('1987-01-01', 1), yearweek('1987-01-01') from dual +END +INPUT +select date_sub("0069-01-01 00:00:01",INTERVAL 2 SECOND); +END +OUTPUT +select date_sub('0069-01-01 00:00:01', interval 2 SECOND) from dual +END +INPUT +select count(distinct a) from t1 group by b; +END +OUTPUT +select count(distinct a) from t1 group by b +END +INPUT +select insert('hello', 1, 18446744073709551616, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select @sum; +END +OUTPUT +select @sum from dual +END +INPUT +select s1 from t1 group by 1 having 1 = 0; +END +OUTPUT +select s1 from t1 group by 1 having 1 = 0 +END +INPUT +select from performance_schema.session_status where variable_name like 'COMPRESSION%' order by 1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select (min(a4)+max(a4))/2 from t1; +END +OUTPUT +select (min(a4) + max(a4)) / 2 from t1 +END +INPUT +select from mysqltest1.t11; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select c1 from t1 where c2='ZZZZ'; +END +OUTPUT +select c1 from t1 where c2 = 'ZZZZ' +END +INPUT +select from t1 natural join (t3 cross join t4); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t3 natural right join t2 natural right join t1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select "hep"; +END +OUTPUT +select 'hep' from dual +END +INPUT +select from t1 where match a against ("+aaa* +bbb1*" in boolean mode); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select locate('lo','hello',18446744073709551615); +END +OUTPUT +select locate('lo', 'hello', 18446744073709551615) from dual +END +INPUT +select 'andre%' like 'andre�%' escape '�'; +END +OUTPUT +select 'andre%' like 'andre�%' escape '�' from dual +END +INPUT +select week("2000-01-06",0) as '2000', week("2001-01-06",0) as '2001', week("2002-01-06",0) as '2002',week("2003-01-06",0) as '2003', week("2004-01-06",0) as '2004', week("2005-01-06",0) as '2005', week("2006-01-06",0) as '2006'; +END +OUTPUT +select week('2000-01-06', 0) as `2000`, week('2001-01-06', 0) as `2001`, week('2002-01-06', 0) as `2002`, week('2003-01-06', 0) as `2003`, week('2004-01-06', 0) as `2004`, week('2005-01-06', 0) as `2005`, week('2006-01-06', 0) as `2006` from dual +END +INPUT +select @topic3_id:= 10103; +END +ERROR +syntax error at position 19 near ':' +END +INPUT +select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a); +END +OUTPUT +select t1.*, t2.*, t3.a from t1 left join t2 on t3.a = t2.a left join t1 as t3 on t1.a = t3.a +END +INPUT +select from v2 where renamed=1 group by renamed; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select get_format(TIMESTAMP, 'eur') as a; +END +OUTPUT +select get_format(`TIMESTAMP`, 'eur') as a from dual +END +INPUT +select mbrwithin(ST_GeomFromText("point(2 4)"), ST_GeomFromText("point(2 4)")); +END +OUTPUT +select mbrwithin(ST_GeomFromText('point(2 4)'), ST_GeomFromText('point(2 4)')) from dual +END +INPUT +select concat(@a, table_name), @a, table_name from information_schema.tables where table_schema = 'test' order by table_name; +END +OUTPUT +select concat(@a, table_name), @a, table_name from information_schema.`tables` where table_schema = 'test' order by table_name asc +END +INPUT +select "a" as col1, "c" as col2; +END +OUTPUT +select 'a' as col1, 'c' as col2 from dual +END +INPUT +select if(1>2,a,avg(a)) from t1; +END +OUTPUT +select if(1 > 2, a, avg(a)) from t1 +END +INPUT +select substring_index('aaaaaaaaa1','aaa',3); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aaa', 3) from dual +END +INPUT +select log2(8),log2(15),log2(-2),log2(0),log2(NULL); +END +OUTPUT +select log2(8), log2(15), log2(-2), log2(0), log2(null) from dual +END +INPUT +select field(NULL,"a",NULL),field(NULL,0,NULL)+0,field(NULL,0.0,NULL)+0.0,field(NULL,0.0e1,NULL)+0.0e1; +END +OUTPUT +select field(null, 'a', null), field(null, 0, null) + 0, field(null, 0.0, null) + 0.0, field(null, 0.0e1, null) + 0.0e1 from dual +END +INPUT +select from t2 order by id; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select "strawberry","blueberry","potato"; +END +OUTPUT +select 'strawberry', 'blueberry', 'potato' from dual +END +INPUT +select 1+2; +END +OUTPUT +select 1 + 2 from dual +END +INPUT +select 3 into @v1; +END +ERROR +syntax error at position 18 near 'v1' +END +INPUT +select /lib64/ user, host, db, info from information_schema.processlist where state = 'User lock' and info = 'select get_lock('ee_16407_5', 60)'; +END +ERROR +syntax error at position 9 +END +INPUT +select from t1 where a like '%ESKA%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 1; +END +OUTPUT +select 1 from dual +END +INPUT +select date,format,concat('',str_to_date(date, format)) as con from t1; +END +OUTPUT +select `date`, `format`, concat('', str_to_date(`date`, `format`)) as con from t1 +END +INPUT +select 'A' like 'a' collate utf8_bin; +END +OUTPUT +select 'A' like 'a' collate utf8_bin from dual +END +INPUT +select timestampdiff(SQL_TSI_SECOND, '2001-02-01 12:59:59', '2001-05-01 12:58:58') as a; +END +OUTPUT +select timestampdiff(SQL_TSI_SECOND, '2001-02-01 12:59:59', '2001-05-01 12:58:58') as a from dual +END +INPUT +select concat(f1, 2) a from t1 union select 'x' a from t1; +END +OUTPUT +(select concat(f1, 2) as a from t1) union (select 'x' as a from t1) +END +INPUT +select t2.* as 'with_alias' from t2; +END +ERROR +syntax error at position 15 near 'as' +END +INPUT +select last_insert_id(); +END +OUTPUT +select last_insert_id() from dual +END +INPUT +select a from t1 group by b order by 1; +END +OUTPUT +select a from t1 group by b order by 1 asc +END +INPUT +select locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2 collate utf8_bin); +END +OUTPUT +select locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2 collate utf8_bin) from dual +END +INPUT +select hex('a'), hex('a '); +END +OUTPUT +select hex('a'), hex('a ') from dual +END +INPUT +select insert("aa",100,1,"b"),insert("aa",1,3,"b"); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select sum(if(num is null,0.00,num)) from t1; +END +OUTPUT +select sum(if(num is null, 0.00, num)) from t1 +END +INPUT +select locate('lo','hello',18446744073709551617); +END +OUTPUT +select locate('lo', 'hello', 18446744073709551617) from dual +END +INPUT +select ST_Crosses(ST_GeomFromText('MULTIPOINT(1 0,15 0,10 10)'),ST_GeomFromText('MULTILINESTRING((15 0,20 0,20 20),(10 10,20 20,15 0))')) as result; +END +OUTPUT +select ST_Crosses(ST_GeomFromText('MULTIPOINT(1 0,15 0,10 10)'), ST_GeomFromText('MULTILINESTRING((15 0,20 0,20 20),(10 10,20 20,15 0))')) as result from dual +END +INPUT +select std(s1/s2) from bug22555 where i=1 group by i; +END +OUTPUT +select std(s1 / s2) from bug22555 where i = 1 group by i +END +INPUT +select from INFORMATION_SCHEMA.TABLE_PRIVILEGES WHERE table_schema NOT IN ('sys','mysql'); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*) from t1 group by s1 having s1 is null; +END +OUTPUT +select count(*) from t1 group by s1 having s1 is null +END +INPUT +select concat(c1,'�'), concat('�',c1) from t1; +END +OUTPUT +select concat(c1, '�'), concat('�', c1) from t1 +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_slovak_ci +END +INPUT +select from t1 where match(s) against('par*' in boolean mode); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where a = 'b' and a != 'b'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select left('aaa','1'); +END +OUTPUT +select left('aaa', '1') from dual +END +INPUT +select from v_bug5719; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select -9223372036854775808 -1 as result; +END +OUTPUT +select -9223372036854775808 - 1 as result from dual +END +INPUT +select 'a' union select concat('a', -4); +END +OUTPUT +(select 'a' from dual) union (select concat('a', -4) from dual) +END +INPUT +select t1.* as 'with_alias', a as 'x' from t1; +END +ERROR +syntax error at position 15 near 'as' +END +INPUT +select date_add("1997-12-31",INTERVAL "10.09" SECOND_MICROSECOND) as a; +END +OUTPUT +select date_add('1997-12-31', interval '10.09' SECOND_MICROSECOND) as a from dual +END +INPUT +select substring('hello', 18446744073709551616, 1); +END +OUTPUT +select substr('hello', 18446744073709551616, 1) from dual +END +INPUT +select str_to_date( 1, IF(1=1,NULL,NULL) ); +END +OUTPUT +select str_to_date(1, if(1 = 1, null, null)) from dual +END +INPUT +select substring('hello', 1, 4294967296); +END +OUTPUT +select substr('hello', 1, 4294967296) from dual +END +INPUT +select count(not_existing_database.t1.a) from t1; +END +OUTPUT +select count(not_existing_database.t1.a) from t1 +END +INPUT +select load_file("lkjlkj"); +END +OUTPUT +select load_file('lkjlkj') from dual +END +INPUT +select substring_index('the king of thethethe.the hill','the',-1); +END +OUTPUT +select substring_index('the king of thethethe.the hill', 'the', -1) from dual +END +INPUT +select from (t1 natural join t2) join (t3 natural join t4) on a = y; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select strcmp(_koi8r'a', _latin1'A'); +END +OUTPUT +select strcmp(_koi8r as a, _latin1 'A') from dual +END +INPUT +select SUBSTRING_INDEX(_latin1'abcdabcdabcd' COLLATE latin1_general_ci,_latin1'd' COLLATE latin1_bin,2); +END +OUTPUT +select SUBSTRING_INDEX(_latin1 'abcdabcdabcd' collate latin1_general_ci, _latin1 'd' collate latin1_bin, 2) from dual +END +INPUT +select inet_aton("122.256"); +END +OUTPUT +select inet_aton('122.256') from dual +END +INPUT +select fld3 from t2 order by fld3 desc limit 5; +END +OUTPUT +select fld3 from t2 order by fld3 desc limit 5 +END +INPUT +select substring(concat(t1.str, t2.str), 1, 15) "name" from t1, t2 where t2.id=t1.id order by name; +END +OUTPUT +select substr(concat(t1.str, t2.str), 1, 15) as `name` from t1, t2 where t2.id = t1.id order by `name` asc +END +INPUT +select count(*) from t2 where id2 > 5; +END +OUTPUT +select count(*) from t2 where id2 > 5 +END +INPUT +select hex(convert(_ujis 0xA5FE41 using ucs2)); +END +ERROR +syntax error at position 34 near '0xA5FE41' +END +INPUT +select 0x6a8473fc1c64ce4f2684c05a400c5e7ca4a01a like '%emailin%'; +END +OUTPUT +select 0x6a8473fc1c64ce4f2684c05a400c5e7ca4a01a like '%emailin%' from dual +END +INPUT +select col1 from test limit 1 into tmp; +END +ERROR +syntax error at position 39 near 'tmp' +END +INPUT +select substring_index(null,null,null); +END +OUTPUT +select substring_index(null, null, null) from dual +END +INPUT +select hex(soundex(_utf32 0x000000BF000000C0)); +END +ERROR +syntax error at position 45 near '0x000000BF000000C0' +END +INPUT +select from t1 where 'cH' = s1 and s1 <> 'ch'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from ((t1 natural join t2) natural join t3) natural join t4; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(substr(_utf16 0x00e400e5D800DC00,3)); +END +ERROR +syntax error at position 44 near '0x00e400e5D800DC00' +END +INPUT +select 1+1; +END +OUTPUT +select 1 + 1 from dual +END +INPUT +select verbose_comment, user_host, argument from mysql.general_log join join_test on (mysql.general_log.command_type = join_test.command_type); +END +OUTPUT +select verbose_comment, user_host, argument from mysql.general_log join join_test on mysql.general_log.command_type = join_test.command_type +END +INPUT +select hex(substr(_ucs2 0x00e400e50068,2)); +END +ERROR +syntax error at position 39 near '0x00e400e50068' +END +INPUT +select insert('txs',null,null,'hi'),insert(null,null,null,null); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select 'is still running; +END +ERROR +syntax error at position 26 near 'is still running;' +END +INPUT +select count(*) from t1 group by col2 having col2 = 'hello'; +END +OUTPUT +select count(*) from t1 group by col2 having col2 = 'hello' +END +INPUT +select j from v2 where j = 1 into k; +END +ERROR +syntax error at position 36 near 'k' +END +INPUT +select substring('hello', -18446744073709551615, -18446744073709551615); +END +OUTPUT +select substr('hello', -18446744073709551615, -18446744073709551615) from dual +END +INPUT +select concat(':',trim(' m '),':',trim(BOTH FROM ' y '),':',trim('*' FROM '*s*'),':'); +END +ERROR +syntax error at position 49 near 'FROM' +END +INPUT +select ceiling(cast(-2 as unsigned)), ceiling(18446744073709551614), ceiling(-2); +END +OUTPUT +select ceiling(convert(-2, unsigned)), ceiling(18446744073709551614), ceiling(-2) from dual +END +INPUT +select substr(null,null,null),mid(null,null,null); +END +OUTPUT +select substr(null, null, null), mid(null, null, null) from dual +END +INPUT +select from t1 where a=if(b<10,_ucs2 0x00C0,_ucs2 0x0062); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select substring('hello', 1, -4294967295); +END +OUTPUT +select substr('hello', 1, -4294967295) from dual +END +INPUT +select if (query_time >= '00:00:01', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log where sql_text = 'select get_lock('bug27638', 2)'; +END +ERROR +syntax error at position 132 near 'bug27638' +END +INPUT +select _latin1'B' in (_latin1'a' collate latin1_bin,_latin1'b'); +END +OUTPUT +select _latin1 'B' in (_latin1 'a' collate latin1_bin, _latin1 'b') from dual +END +INPUT +select date_add(date,INTERVAL "1 1" YEAR_MONTH) from t1; +END +OUTPUT +select date_add(`date`, interval '1 1' YEAR_MONTH) from t1 +END +INPUT +select a1, a2, b, min(c), max(c) from t1 group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 group by a1, a2, b +END +INPUT +select t1.*, (select t2.* from t2) from t1; +END +OUTPUT +select t1.*, (select t2.* from t2) from t1 +END +INPUT +select 6; +END +OUTPUT +select 6 from dual +END +INPUT +select _latin1'B' COLLATE latin1_general_ci in (_latin1'a' COLLATE latin1_bin,_latin1'b'); +END +OUTPUT +select _latin1 'B' collate latin1_general_ci in (_latin1 'a' collate latin1_bin, _latin1 'b') from dual +END +INPUT +select _latin2'1'=1; +END +ERROR +syntax error at position 19 +END +INPUT +select from t1 where word= 0xe4 or word=CAST(0xe4 as CHAR); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 left join t2 on t1.a=t2.a having not (t2.a <=> t1.a); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select format(pi(), NULL); +END +OUTPUT +select format(pi(), null) from dual +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL "1:1" MINUTE_SECOND); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval '1:1' MINUTE_SECOND) from dual +END +INPUT +select st_contains(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_contains(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select space(-18446744073709551617); +END +OUTPUT +select space(-18446744073709551617) from dual +END +INPUT +select extract(HOUR_MINUTE FROM "10:11:12"); +END +ERROR +syntax error at position 32 near 'FROM' +END +INPUT +select hex(soundex('a')); +END +OUTPUT +select hex(soundex('a')) from dual +END +INPUT +select field(0,NULL,1,0), field("",NULL,"bar",""), field(0.0,NULL,1.0,0.0); +END +OUTPUT +select field(0, null, 1, 0), field('', null, 'bar', ''), field(0.0, null, 1.0, 0.0) from dual +END +INPUT +select from information_schema.table_privileges where table_schema NOT IN ('sys','mysql'); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select t1.a, t1.b,t2.a, t2.b from t1 left join t2 on t1.a=t2.a where t1.b=1 and t2.b=1 or t2.a is NULL; +END +OUTPUT +select t1.a, t1.b, t2.a, t2.b from t1 left join t2 on t1.a = t2.a where t1.b = 1 and t2.b = 1 or t2.a is null +END +INPUT +select from tm; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select fld3 FROM t2 where (fld3 like "C%" and fld3 = "Chantilly"); +END +OUTPUT +select fld3 from t2 where fld3 like 'C%' and fld3 = 'Chantilly' +END +INPUT +select makedate(100,1); +END +OUTPUT +select makedate(100, 1) from dual +END +INPUT +select ST_astext(ST_intersection(ST_GeomFromText('polygon((0 0, 1 0, 0 1, 0 0))'), ST_GeomFromText('polygon((0 0, 1 1, 0 2, 0 0))'))); +END +OUTPUT +select ST_astext(ST_intersection(ST_GeomFromText('polygon((0 0, 1 0, 0 1, 0 0))'), ST_GeomFromText('polygon((0 0, 1 1, 0 2, 0 0))'))) from dual +END +INPUT +select from t1 left join t2 on m_id = id where match(d, e, f) against ('+aword +bword' in boolean mode); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a2 from ((t1 natural join t2) join t3 on b=c1) natural join t4; +END +OUTPUT +select a2 from ((t1 natural join t2) join t3 on b = c1) natural join t4 +END +INPUT +select "put something into general_log"; +END +OUTPUT +select 'put something into general_log' from dual +END +INPUT +select subdate("1997-12-31 23:59:59.000001", 10); +END +OUTPUT +select subdate('1997-12-31 23:59:59.000001', 10) from dual +END +INPUT +select col1 as count_col1 from t1 as tmp1 group by col1 having col1 = 10; +END +OUTPUT +select col1 as count_col1 from t1 as tmp1 group by col1 having col1 = 10 +END +INPUT +select date_add(date,INTERVAL "1" WEEK) from t1; +END +OUTPUT +select date_add(`date`, interval '1' WEEK) from t1 +END +INPUT +select timestampdiff(month,'2004-09-11','2004-09-11'); +END +OUTPUT +select timestampdiff(month, '2004-09-11', '2004-09-11') from dual +END +INPUT +select from t3 join (t2 outr2 join t2 outr join t1) on (outr.pk = t3.pk) and (t1.col_int_key = t3.pk) and isnull(t1.col_date_key) and (outr2.pk <> t3.pk); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a.CONSTRAINT_SCHEMA, b.TABLE_NAME, CONSTRAINT_TYPE, b.CONSTRAINT_NAME, UNIQUE_CONSTRAINT_SCHEMA, UNIQUE_CONSTRAINT_NAME, MATCH_OPTION, UPDATE_RULE, DELETE_RULE, b.REFERENCED_TABLE_NAME from information_schema.TABLE_CONSTRAINTS a, information_schema.REFERENTIAL_CONSTRAINTS b where a.CONSTRAINT_SCHEMA COLLATE UTF8_GENERAL_CI = 'test' and a.CONSTRAINT_SCHEMA COLLATE UTF8_GENERAL_CI = b.CONSTRAINT_SCHEMA and a.CONSTRAINT_NAME = b.CONSTRAINT_NAME; +END +OUTPUT +select a.CONSTRAINT_SCHEMA, b.TABLE_NAME, CONSTRAINT_TYPE, b.CONSTRAINT_NAME, UNIQUE_CONSTRAINT_SCHEMA, UNIQUE_CONSTRAINT_NAME, MATCH_OPTION, UPDATE_RULE, DELETE_RULE, b.REFERENCED_TABLE_NAME from information_schema.TABLE_CONSTRAINTS as a, information_schema.REFERENTIAL_CONSTRAINTS as b where a.CONSTRAINT_SCHEMA collate UTF8_GENERAL_CI = 'test' and a.CONSTRAINT_SCHEMA collate UTF8_GENERAL_CI = b.CONSTRAINT_SCHEMA and a.CONSTRAINT_NAME = b.CONSTRAINT_NAME +END +INPUT +select from t2 order by a,b; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select _latin1'B' between _latin1'a' and _latin1'c' collate latin1_bin; +END +OUTPUT +select _latin1 'B' between _latin1 'a' and _latin1 'c' collate latin1_bin from dual +END +INPUT +select min(a1) from t1 where a1 > 'KKK'; +END +OUTPUT +select min(a1) from t1 where a1 > 'KKK' +END +INPUT +select ST_astext(fn3()); +END +OUTPUT +select ST_astext(fn3()) from dual +END +INPUT +select 1 | -1, 1 ^ -1, 1 & -1; +END +OUTPUT +select 1 | -1, 1 ^ -1, 1 & -1 from dual +END +INPUT +select hex(s2) from t1; +END +OUTPUT +select hex(s2) from t1 +END +INPUT +select 0 | -1, 0 ^ -1, 0 & -1; +END +OUTPUT +select 0 | -1, 0 ^ -1, 0 & -1 from dual +END +INPUT +select from words; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1, t2 where t1.value64=17156792991891826145 and t2.value64=t1.value64; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select cast(s1 as decimal(7,2)) from t1; +END +OUTPUT +select convert(s1, decimal(7, 2)) from t1 +END +INPUT +select 3 from (select 1) as qn, (select 2) as QN; +END +OUTPUT +select 3 from (select 1 from dual) as qn, (select 2 from dual) as QN +END +INPUT +select count(*) from t1 where match a against ('aaaxxx'); +END +ERROR +syntax error at position 38 near 'a' +END +INPUT +select benchmark(100, NULL); +END +OUTPUT +select benchmark(100, null) from dual +END +INPUT +select cast("1:2:3" as TIME); +END +OUTPUT +select convert('1:2:3', TIME) from dual +END +INPUT +select soundex(_utf8 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB); +END +OUTPUT +select soundex(_utf8 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB) from dual +END +INPUT +select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1 join t2 on t1.a=t2.c where b=11120436154190595086 order by d; +END +OUTPUT +select t1.a, case t1.a when 0 then 0 else t1.b end as d from t1 join t2 on t1.a = t2.c where b = 11120436154190595086 order by d asc +END +INPUT +select date_sub("90-01-01 00:00:01",INTERVAL 2 SECOND); +END +OUTPUT +select date_sub('90-01-01 00:00:01', interval 2 SECOND) from dual +END +INPUT +select grp,group_concat(distinct c order by c) from t1 group by grp; +END +OUTPUT +select grp, group_concat(distinct c order by c asc) from t1 group by grp +END +INPUT +select from t1 where xxx regexp('is a test of some long text to '); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select repeat('hello', 18446744073709551615); +END +OUTPUT +select repeat('hello', 18446744073709551615) from dual +END +INPUT +select t1.a, group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a) desc) as grp from t1 group by 1; +END +OUTPUT +select t1.a, group_concat(c order by (select mid(group_concat(c order by a asc), 1, 5) from t2 where t2.a = t1.a) desc) as grp from t1 group by 1 +END +INPUT +select a as like_lll from t1 where a like 'lll%'; +END +OUTPUT +select a as like_lll from t1 where a like 'lll%' +END +INPUT +select from t1 where upper(b)='BBB'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name like 't%' order by table_name; +END +OUTPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name like 't%' order by table_name asc +END +INPUT +select t1.col1 from t1 where t1.col2 in (select t2.col2 from t2 group by t2.col1, t2.col2 having col_t1 <= 10) group by col_t1 having col_t1 <= 20; +END +OUTPUT +select t1.col1 from t1 where t1.col2 in (select t2.col2 from t2 group by t2.col1, t2.col2 having col_t1 <= 10) group by col_t1 having col_t1 <= 20 +END +INPUT +select right('hello',null),right(null,1),right(null,null); +END +OUTPUT +select right('hello', null), right(null, 1), right(null, null) from dual +END +INPUT +select from `information_schema`.`REFERENTIAL_CONSTRAINTS` where `CONSTRAINT_SCHEMA` = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),truncate(52.64,-2), truncate(-52.64,1),truncate(-52.64,-1); +END +OUTPUT +select truncate(52.64, 1), truncate(52.64, 2), truncate(52.64, -1), truncate(52.64, -2), truncate(-52.64, 1), truncate(-52.64, -1) from dual +END +INPUT +select substring('hello', 4294967295, 1); +END +OUTPUT +select substr('hello', 4294967295, 1) from dual +END +INPUT +select cast(@v1 as decimal(22, 2)); +END +OUTPUT +select convert(@v1, decimal(22, 2)) from dual +END +INPUT +select count(a) from t1 where a >= 10; +END +OUTPUT +select count(a) from t1 where a >= 10 +END +INPUT +select from information_schema.USER_PRIVILEGES where grantee like '%mysqltest_1%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select text1, length(text1) from t1 where text1='teststring' or text1 >= 'teststring '; +END +OUTPUT +select text1, length(text1) from t1 where text1 = 'teststring' or text1 >= 'teststring\t' +END +INPUT +select 141427 + datediff(curdate(),'1970-01-01') into @my_uuid_synthetic; +END +ERROR +syntax error at position 73 near 'my_uuid_synthetic' +END +INPUT +select makedate(1997,0); +END +OUTPUT +select makedate(1997, 0) from dual +END +INPUT +select from mysqltest.mysqltest; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select c, substring_index(lcase(c), @q:=',', -1) as res from t1; +END +ERROR +syntax error at position 40 near ':' +END +INPUT +select concat(a, if(b>10, _utf8mb4'æ', _utf8mb4'ß')) from t1; +END +OUTPUT +select concat(a, if(b > 10, _utf8mb4 'æ', _utf8mb4 'ß')) from t1 +END +INPUT +select a, group_concat(b order by b) from t1 group by a with rollup; +END +ERROR +syntax error at position 61 near 'with' +END +INPUT +select t1.a, t2.a, t2.b, bit_count(t2.b) from t1 left join t2 on t1.a=t2.a; +END +OUTPUT +select t1.a, t2.a, t2.b, bit_count(t2.b) from t1 left join t2 on t1.a = t2.a +END +INPUT +select substring_index(c1,'����',2) from t1; +END +OUTPUT +select substring_index(c1, '����', 2) from t1 +END +INPUT +select a from t1 where mid(a+0,6,3) in ( mid(20040106123400,6,3) ); +END +OUTPUT +select a from t1 where mid(a + 0, 6, 3) in (mid(20040106123400, 6, 3)) +END +INPUT +select word, word=binary 0xdf as t from t1 having t > 0; +END +OUTPUT +select word, word = binary 0xdf as t from t1 having t > 0 +END +INPUT +select ST_astext(st_difference(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))); +END +OUTPUT +select ST_astext(st_difference(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))) from dual +END +INPUT +select a as like_l from t1 where a like 'l%'; +END +OUTPUT +select a as like_l from t1 where a like 'l%' +END +INPUT +select concat(a, if(b>10, _utf8mb4 0x78, _utf8mb4 0x79)) from t1; +END +OUTPUT +select concat(a, if(b > 10, _utf8mb4 0x78, _utf8mb4 0x79)) from t1 +END +INPUT +select from t1 where match a against ("+aaa* +bbb*" in boolean mode); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select @keyword3_id:= 10203; +END +ERROR +syntax error at position 21 near ':' +END +INPUT +select from t3 where x = 1 and y < 5 order by y desc; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a1, max(a2) from t1 group by a1; +END +OUTPUT +select a1, max(a2) from t1 group by a1 +END +INPUT +select SUBPARTITION_METHOD FROM information_schema.partitions WHERE table_schema="test" AND table_name="t1"; +END +OUTPUT +select SUBPARTITION_METHOD from information_schema.partitions where table_schema = 'test' and table_name = 't1' +END +INPUT +select grp,group_concat(a,null) from t1 group by grp; +END +OUTPUT +select grp, group_concat(a, null) from t1 group by grp +END +INPUT +select (@unpaked_keys_size > @paked_keys_size); +END +OUTPUT +select @unpaked_keys_size > @paked_keys_size from dual +END +INPUT +select st_crosses(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_crosses(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select ST_astext(st_intersection(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))); +END +OUTPUT +select ST_astext(st_intersection(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))) from dual +END +INPUT +select distinct t1.a from t1,t2 order by t2.a; +END +OUTPUT +select distinct t1.a from t1, t2 order by t2.a asc +END +INPUT +select from t1 where not(not(not(a > 10))); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 'Glazgo' sounds like 'Liverpool'; +END +ERROR +syntax error at position 28 near 'like' +END +INPUT +select 12 mod null as 'NULL'; +END +OUTPUT +select 12 % null as `NULL` from dual +END +INPUT +select TABLE_NAME from information_schema.views where table_schema='test' order by TABLE_NAME; +END +OUTPUT +select TABLE_NAME from information_schema.views where table_schema = 'test' order by TABLE_NAME asc +END +INPUT +select c from t2 where a = 2 and b = 'val-2' group by c; +END +OUTPUT +select c from t2 where a = 2 and b = 'val-2' group by c +END +INPUT +select maketime(25,11,12); +END +OUTPUT +select maketime(25, 11, 12) from dual +END +INPUT +select t1.a,t4.y from t1,(select t2.a as y from t2,(select t3.b from t3 where t3.a>3) as t5 where t2.b=t5.b) as t4 where t1.a = t4.y; +END +OUTPUT +select t1.a, t4.y from t1, (select t2.a as y from t2, (select t3.b from t3 where t3.a > 3) as t5 where t2.b = t5.b) as t4 where t1.a = t4.y +END +INPUT +select timediff("2005-01-11 15:48:49.999999", "2005-01-11 15:48:50"); +END +OUTPUT +select timediff('2005-01-11 15:48:49.999999', '2005-01-11 15:48:50') from dual +END +INPUT +select hex(_utf32 0x103344); +END +ERROR +syntax error at position 27 near '0x103344' +END +INPUT +select value,description,COUNT(bug_id) from t2 left join t1 on t2.program=t1.product and t2.value=t1.component where program="AAAAA" group by value having COUNT(bug_id) IN (0,2); +END +OUTPUT +select value, description, COUNT(bug_id) from t2 left join t1 on t2.program = t1.product and t2.value = t1.component where program = 'AAAAA' group by value having COUNT(bug_id) in (0, 2) +END +INPUT +select from t1 where s1 < 'K' and s1 = 'Y'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select DATE_ADD(20071108, INTERVAL 1 DAY); +END +OUTPUT +select DATE_ADD(20071108, interval 1 DAY) from dual +END +INPUT +select distinct concat(c1, repeat('xx', 250)) as cc from t2 order by 1; +END +OUTPUT +select distinct concat(c1, repeat('xx', 250)) as cc from t2 order by 1 asc +END +INPUT +select trim(c1 from '�'),trim('�' from c1) from t1; +END +ERROR +syntax error at position 20 near 'from' +END +INPUT +select extract(DAY_MICROSECOND FROM "1999-01-02 10:11:12.000123"); +END +ERROR +syntax error at position 36 near 'FROM' +END +INPUT +select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin2 0xa3, 2); +END +ERROR +syntax error at position 58 near '0xa3' +END +INPUT +select (ST_aswkb(cast(st_union(multipoint( point(8,6), point(1,-17679), point(-9,-9)), linestring(point(91,12), point(-77,49), point(53,-81)))as char(18)))) in ('1','2'); +END +OUTPUT +select ST_aswkb(convert(st_union(multipoint(point(8, 6), point(1, -17679), point(-9, -9)), linestring(point(91, 12), point(-77, 49), point(53, -81))), char(18))) in ('1', '2') from dual +END +INPUT +select 12%0 as 'NULL'; +END +OUTPUT +select 12 % 0 as `NULL` from dual +END +INPUT +select a1,a2,b, max(c) from t2 where (c < 'k321') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c) from t2 where c < 'k321' group by a1, a2, b +END +INPUT +select bit_and(col), bit_or(col) from t1; +END +OUTPUT +select bit_and(col), bit_or(col) from t1 +END +INPUT +select from sakila.film_text where match(title,description) against("SCISSORHANDS"); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select time_format(19980131131415,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); +END +OUTPUT +select time_format(19980131131415, '%H|%I|%k|%l|%i|%p|%r|%S|%T') from dual +END +INPUT +select "Det här är svenska" regexp "h[[:alpha:]]+r", "aba" regexp "^(a|b)*$"; +END +OUTPUT +select 'Det här är svenska' regexp 'h[[:alpha:]]+r', 'aba' regexp '^(a|b)*$' from dual +END +INPUT +select std(s1/s2) from bug22555 where i=3 group by i; +END +OUTPUT +select std(s1 / s2) from bug22555 where i = 3 group by i +END +INPUT +select null mod 0 as 'NULL'; +END +OUTPUT +select null % 0 as `NULL` from dual +END +INPUT +select cast("2001-1-1" as DATE), cast("2001-1-1" as DATETIME); +END +OUTPUT +select convert('2001-1-1', DATE), convert('2001-1-1', DATETIME) from dual +END +INPUT +select case when s1 = 0xfffd then 1 else 0 end from t1; +END +OUTPUT +select case when s1 = 0xfffd then 1 else 0 end from t1 +END +INPUT +select a from t1 where left(a+0,6) = ( left(20040106,6) ); +END +OUTPUT +select a from t1 where left(a + 0, 6) = left(20040106, 6) +END +INPUT +select from t1 where a like concat("abc","%"); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a1,a2,b,min(c),max(c) from t2 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t2 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and a2 > 'a' group by a1, a2, b +END +INPUT +select locate('lo','hello',-18446744073709551615); +END +OUTPUT +select locate('lo', 'hello', -18446744073709551615) from dual +END +INPUT +select f1 from t1 where date(f1) between cast("2006-1-1" as date) and cast("2006.1.1" as date); +END +OUTPUT +select f1 from t1 where date(f1) between convert('2006-1-1', date) and convert('2006.1.1', date) +END +INPUT +select ST_astext(ST_MPointFromWKB(ST_AsWKB(MultiPoint(Point('0', '-0'),Point('-0', '0'), Point('0', '0'))))) as result; +END +OUTPUT +select ST_astext(ST_MPointFromWKB(ST_AsWKB(MultiPoint(Point('0', '-0'), Point('-0', '0'), Point('0', '0'))))) as result from dual +END +INPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name = 'tm' order by table_name; +END +OUTPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name = 'tm' order by table_name asc +END +INPUT +select strcmp(_koi8r'a', _koi8r'A'); +END +OUTPUT +select strcmp(_koi8r as a, _koi8r as A) from dual +END +INPUT +select t1.* from t1; +END +OUTPUT +select t1.* from t1 +END +INPUT +select count(*) from t1 where match a against ('aaazzz' in boolean mode); +END +ERROR +syntax error at position 38 near 'a' +END +INPUT +select find_in_set("d","a,b,c"),find_in_set("dd","a,bbb,d"),find_in_set("bb","a,bbb,dd"); +END +OUTPUT +select find_in_set('d', 'a,b,c'), find_in_set('dd', 'a,bbb,d'), find_in_set('bb', 'a,bbb,dd') from dual +END +INPUT +select data_type, character_octet_length, character_maximum_length from information_schema.columns where table_name='t1'; +END +OUTPUT +select data_type, character_octet_length, character_maximum_length from information_schema.`columns` where table_name = 't1' +END +INPUT +select ST_asbinary(g) from t1; +END +OUTPUT +select ST_asbinary(g) from t1 +END +INPUT +select from t1 join t2 using(`t1_id`) where match (t1.name, t2.name) against('xxfoo' in boolean mode); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select sql_big_result distinct t1.a from t1,t2; +END +ERROR +syntax error at position 31 near 'distinct' +END +INPUT +select from t1 where a = 'b' and a = 'b'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select (select d from t2 where d > a), t1.* from t1; +END +OUTPUT +select (select d from t2 where d > a), t1.* from t1 +END +INPUT +select floor(5.5),floor(-5.5); +END +OUTPUT +select floor(5.5), floor(-5.5) from dual +END +INPUT +select timestampdiff(YEAR, '2002-05-01', '2001-01-01') as a; +END +OUTPUT +select timestampdiff(YEAR, '2002-05-01', '2001-01-01') as a from dual +END +INPUT +select ST_AsText(Polygon(LineString(Point(0, 0), Point(1, 0), Point(1,1), Point(0, 1), Point(0, 0)))); +END +OUTPUT +select ST_AsText(Polygon(LineString(Point(0, 0), Point(1, 0), Point(1, 1), Point(0, 1), Point(0, 0)))) from dual +END +INPUT +select get_lock('ee_16407_5', 60); +END +OUTPUT +select get_lock('ee_16407_5', 60) from dual +END +INPUT +select 1=_latin1'1'; +END +OUTPUT +select 1 = _latin1 '1' from dual +END +INPUT +select coercibility(weight_string('test')); +END +OUTPUT +select coercibility(weight_string('test')) from dual +END +INPUT +select from (t1 natural join t2) natural join (t3 natural join t4); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t2 where MATCH inhalt AGAINST (t2.inhalt); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a from t1 order by rand(10); +END +OUTPUT +select a from t1 order by rand(10) +END +INPUT +select from t1 where MATCH(a,b) AGAINST("+search +(support vector)" IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select cast(NULL as decimal(6)) as t1; +END +OUTPUT +select convert(null, decimal(6)) as t1 from dual +END +INPUT +select count(*) from t1 where t like 'a%'; +END +OUTPUT +select count(*) from t1 where t like 'a%' +END +INPUT +select t1.id FROM t2 as ttxt,t1,t1 as ticket2 WHERE ticket2.id = ttxt.ticket AND t1.id = ticket2.ticket and match(ttxt.inhalt) against ('foobar'); +END +OUTPUT +select t1.id from t2 as ttxt, t1, t1 as ticket2 where ticket2.id = ttxt.ticket and t1.id = ticket2.ticket and match(ttxt.inhalt) against ('foobar') +END +INPUT +select t1.b from v1a; +END +OUTPUT +select t1.b from v1a +END +INPUT +select table_schema, table_name, table_comment from information_schema.tables where table_schema like 'mysqltest_%' and table_name like 't_bug44738_%' order by table_name; +END +OUTPUT +select table_schema, table_name, table_comment from information_schema.`tables` where table_schema like 'mysqltest_%' and table_name like 't_bug44738_%' order by table_name asc +END +INPUT +select 12 mod 0 as 'NULL'; +END +OUTPUT +select 12 % 0 as `NULL` from dual +END +INPUT +select right('hello', -18446744073709551616); +END +OUTPUT +select right('hello', -18446744073709551616) from dual +END +INPUT +select st_touches(ST_GeometryFromText('geometrycollection(polygon((0 0, 1 0, 1 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 2 0, 2 1, 1 1, 1 0)))')); +END +OUTPUT +select st_touches(ST_GeometryFromText('geometrycollection(polygon((0 0, 1 0, 1 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 2 0, 2 1, 1 1, 1 0)))')) from dual +END +INPUT +select 'c' like '_' as want0; +END +OUTPUT +select 'c' like '_' as want0 from dual +END +INPUT +select count(distinct concat(x,y)) from t1; +END +OUTPUT +select count(distinct concat(x, y)) from t1 +END +INPUT +select length(v) from t1 where v=repeat('a',65530); +END +OUTPUT +select length(v) from t1 where v = repeat('a', 65530) +END +INPUT +select hex(a) from t1 where a = _big5 0xF9DC; +END +ERROR +syntax error at position 45 near '0xF9DC' +END +INPUT +select count(distinct n2), n1 from t1 group by n1; +END +OUTPUT +select count(distinct n2), n1 from t1 group by n1 +END +INPUT +select locate('LO','hello' collate utf8_bin,2); +END +OUTPUT +select locate('LO', 'hello' collate utf8_bin, 2) from dual +END +INPUT +select distinct a1,a1 from t1; +END +OUTPUT +select distinct a1, a1 from t1 +END +INPUT +select from t1 where not(a >= 10); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(soundex(_utf8 0xD091D092D093)); +END +OUTPUT +select hex(soundex(_utf8 0xD091D092D093)) from dual +END +INPUT +select from t1 where btn like "ff%"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 1<=>0,0<=>NULL,NULL<=>0; +END +OUTPUT +select 1 <=> 0, 0 <=> null, null <=> 0 from dual +END +INPUT +select left('hello', 18446744073709551616); +END +OUTPUT +select left('hello', 18446744073709551616) from dual +END +INPUT +select timestamp("2001-12-01"); +END +OUTPUT +select timestamp('2001-12-01') from dual +END +INPUT +select default(str), default(strnull), default(intg), default(rel) from t1; +END +OUTPUT +select default(str), default(strnull), default(intg), default(rel) from t1 +END +INPUT +select count(c) from t1 where c = 10; +END +OUTPUT +select count(c) from t1 where c = 10 +END +INPUT +select hex(CONVERT(@utf84 USING sjis)); +END +OUTPUT +select hex(convert(@utf84 using sjis)) from dual +END +INPUT +select lpad(f1, 12, "-o-/") from t1; +END +OUTPUT +select lpad(f1, 12, '-o-/') from t1 +END +INPUT +select max(id) from t1; +END +OUTPUT +select max(id) from t1 +END +INPUT +select from v1a natural join v2a; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 1 as a from t1 union all select 1 from dual limit 1; +END +OUTPUT +(select 1 as a from t1) union all (select 1 from dual) limit 1 +END +INPUT +select from t1 where a > _latin1 'B' collate latin1_bin; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from (select 1 union select 1) aaa; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from information_schema.STATISTICS where TABLE_SCHEMA = "mysqltest" order by table_name, index_name; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select convert(char(0xff,0x8f) using utf8mb4); +END +OUTPUT +select convert(char(0xff, 0x8f) using utf8mb4) from dual +END +INPUT +select definer, event_name from information_schema.events; +END +OUTPUT +select `definer`, event_name from information_schema.events +END +INPUT +select mbrcontains(ST_GeomFromText("polygon((2 2, 10 2, 10 10, 2 10, 2 2))"), ST_GeomFromText("point(2 4)")); +END +OUTPUT +select mbrcontains(ST_GeomFromText('polygon((2 2, 10 2, 10 10, 2 10, 2 2))'), ST_GeomFromText('point(2 4)')) from dual +END +INPUT +select t1.*,t2.* from { oj t2 left outer join t1 on (t1.a=t2.a) }; +END +ERROR +syntax error at position 24 near '{' +END +INPUT +select round(1e1, 2147483648), truncate(1e1, 2147483648); +END +OUTPUT +select round(1e1, 2147483648), truncate(1e1, 2147483648) from dual +END +INPUT +select from information_schema.character_sets order by 1 limit 3; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select get_lock('bug27638', 101); +END +OUTPUT +select get_lock('bug27638', 101) from dual +END +INPUT +select 2 || 3; +END +OUTPUT +select 2 or 3 from dual +END +INPUT +select from t1 where word=binary 0xDF; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from ( select from t1 union select from t1) a,(select from t1 union select from t1) b; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select find_in_set(binary 'a',binary 'A,B,C'); +END +OUTPUT +select find_in_set(binary 'a', binary 'A,B,C') from dual +END +INPUT +select left('hello', 4294967296); +END +OUTPUT +select left('hello', 4294967296) from dual +END +INPUT +select 2 in (3,2,5,9,5,1),"monty" in ("david","monty","allan"), 1.2 in (1.4,1.2,1.0); +END +OUTPUT +select 2 in (3, 2, 5, 9, 5, 1), 'monty' in ('david', 'monty', 'allan'), 1.2 in (1.4, 1.2, 1.0) from dual +END +INPUT +select from bug20691 order by x asc; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select i, count(*), std(e1/e2) from bug22555 group by i order by i; +END +OUTPUT +select i, count(*), std(e1 / e2) from bug22555 group by i order by i asc +END +INPUT +select sleep(@long_query_time + 1); +END +OUTPUT +select sleep(@long_query_time + 1) from dual +END +INPUT +select 'A' = 'a' collate latin2_czech_cs; +END +OUTPUT +select 'A' = 'a' collate latin2_czech_cs from dual +END +INPUT +select f2,group_concat(f1) from t1 group by f2; +END +OUTPUT +select f2, group_concat(f1) from t1 group by f2 +END +INPUT +select insert('hello', -18446744073709551615, 1, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select substring('hello', -18446744073709551616, 1); +END +OUTPUT +select substr('hello', -18446744073709551616, 1) from dual +END +INPUT +select STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T'); +END +OUTPUT +select STR_TO_DATE('2004.12.12 22.30.61', '%Y.%m.%d %T') from dual +END +INPUT +select a, MAX(b), CASE MAX(b) when 4 then 4 when 43 then 43 else 0 end from t1 group by a; +END +OUTPUT +select a, MAX(b), case MAX(b) when 4 then 4 when 43 then 43 else 0 end from t1 group by a +END +INPUT +select from t4 where c1 < f1(); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select concat("$",format(2500,2)); +END +OUTPUT +select concat('$', format(2500, 2)) from dual +END +INPUT +select unix_timestamp(from_unixtime(2147483647)); +END +OUTPUT +select unix_timestamp(from_unixtime(2147483647)) from dual +END +INPUT +select 1, max(a) from t1m where a=99; +END +OUTPUT +select 1, max(a) from t1m where a = 99 +END +INPUT +select sql_small_result t2.id, avg(rating+0.0e0) from t2 group by t2.id; +END +ERROR +syntax error at position 28 +END +INPUT +select 12 % null as 'NULL'; +END +OUTPUT +select 12 % null as `NULL` from dual +END +INPUT +select str_to_date('04/30 /2004', '%m /%d /%Y'); +END +OUTPUT +select str_to_date('04/30 /2004', '%m /%d /%Y') from dual +END +INPUT +select c1,min(c2) as c2 from t1 group by c1 order by c2; +END +OUTPUT +select c1, min(c2) as c2 from t1 group by c1 order by c2 asc +END +INPUT +select from mysqldump_dba.v1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select SUBSTR('abcdefg',-3,2) FROM DUAL; +END +OUTPUT +select substr('abcdefg', -3, 2) from dual +END +INPUT +select @@local.profiling_history_size; +END +OUTPUT +select @@local.profiling_history_size from dual +END +INPUT +select 0 % null as 'NULL'; +END +OUTPUT +select 0 % null as `NULL` from dual +END +INPUT +select hex(b) from t1 order by pk1; +END +OUTPUT +select hex(b) from t1 order by pk1 asc +END +INPUT +select c as c_a from t1 where c='б'; +END +OUTPUT +select c as c_a from t1 where c = 'б' +END +INPUT +select from v3a; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select ltrim("a"),rtrim("a"),trim(BOTH "" from "a"),trim(BOTH " " from "a"); +END +ERROR +syntax error at position 47 near 'from' +END +INPUT +select repeat("a",0),repeat("ab",5+5),repeat("ab",-1),reverse(NULL); +END +OUTPUT +select repeat('a', 0), repeat('ab', 5 + 5), repeat('ab', -1), reverse(null) from dual +END +INPUT +select date_add(date,INTERVAL "1:1" HOUR_MINUTE) from t1; +END +OUTPUT +select date_add(`date`, interval '1:1' HOUR_MINUTE) from t1 +END +INPUT +select timediff(cast('1 12:00:00' as time), '12:00:00'); +END +OUTPUT +select timediff(convert('1 12:00:00', time), '12:00:00') from dual +END +INPUT +select hex(a), hex(@a:=convert(a using utf8mb4)), hex(convert(@a using utf16)) from t1; +END +ERROR +syntax error at position 23 near ':' +END +INPUT +select event_name from information_schema.events where event_name = 'e1' and sql_mode = @full_mode; +END +OUTPUT +select event_name from information_schema.events where event_name = 'e1' and sql_mode = @full_mode +END +INPUT +select collation(lcase(_latin2'a')), coercibility(lcase(_latin2'a')); +END +OUTPUT +select collation(lcase(_latin2 as a)), coercibility(lcase(_latin2 as a)) from dual +END +INPUT +select date_format('1999-12-31','%x-%v'),date_format('2000-01-01','%x-%v'); +END +OUTPUT +select date_format('1999-12-31', '%x-%v'), date_format('2000-01-01', '%x-%v') from dual +END +INPUT +select mbrwithin(ST_GeomFromText("point(2 4)"), ST_GeomFromText("polygon((2 2, 10 2, 10 10, 2 10, 2 2))")); +END +OUTPUT +select mbrwithin(ST_GeomFromText('point(2 4)'), ST_GeomFromText('polygon((2 2, 10 2, 10 10, 2 10, 2 2))')) from dual +END +INPUT +select locate('HE','hello' collate utf8_bin); +END +OUTPUT +select locate('HE', 'hello' collate utf8_bin) from dual +END +INPUT +select if (query_time >= '00:00:59', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log where sql_text = 'select get_lock('bug27638', 60)'; +END +ERROR +syntax error at position 132 near 'bug27638' +END +INPUT +select row('a','b','c') = row('a','b','c'); +END +OUTPUT +select row('a', 'b', 'c') = row('a', 'b', 'c') from dual +END +INPUT +select ST_Disjoint(ST_GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), ST_GeomFromText('POLYGON((10 10, 10 15, 15 15, 15 10, 10 10))')); +END +OUTPUT +select ST_Disjoint(ST_GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), ST_GeomFromText('POLYGON((10 10, 10 15, 15 15, 15 10, 10 10))')) from dual +END +INPUT +select insert('hello', -4294967295, 1, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select count(distinct f1,if(1,'',f1)) from t1; +END +OUTPUT +select count(distinct f1, if(1, '', f1)) from t1 +END +INPUT +select hex(cast(9007199254740992 as decimal(30,0))); +END +OUTPUT +select hex(convert(9007199254740992, decimal(30, 0))) from dual +END +INPUT +select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sqty>2 and cqty>1; +END +OUTPUT +select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sqty > 2 and cqty > 1 +END +INPUT +select id from t1 group by id; +END +OUTPUT +select id from t1 group by id +END +INPUT +select load_file("/proc/modules"); +END +OUTPUT +select load_file('/proc/modules') from dual +END +INPUT +select insert('hello', 4294967297, 4294967297, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select 1, max(1) from t1i where a=99; +END +OUTPUT +select 1, max(1) from t1i where a = 99 +END +INPUT +select CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END; +END +OUTPUT +select case 2.0 when 1 then 'one' when 2.0 then 'two' else 'more' end from dual +END +INPUT +select 'A' like 'a'; +END +OUTPUT +select 'A' like 'a' from dual +END +INPUT +select count(a) from t1; +END +OUTPUT +select count(a) from t1 +END +INPUT +select t1.*, (select a from t2 where d > a) from t1; +END +OUTPUT +select t1.*, (select a from t2 where d > a) from t1 +END +INPUT +select makedate(9999,365); +END +OUTPUT +select makedate(9999, 365) from dual +END +INPUT +select a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, c from t1 where a2 >= 'b' and b = 'a' and c = 'i121' group by a1, a2, b +END +INPUT +select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3; +END +OUTPUT +select 5.1 % 3, 5.1 % -3, -5.1 % 3, -5.1 % -3 from dual +END +INPUT +select statistics.TABLE_NAME, statistics.COLUMN_NAME, statistics.TABLE_CATALOG, statistics.TABLE_SCHEMA, statistics.NON_UNIQUE, statistics.INDEX_SCHEMA, statistics.INDEX_NAME, statistics.SEQ_IN_INDEX, statistics.COLLATION, statistics.SUB_PART, statistics.PACKED, statistics.NULLABLE, statistics.INDEX_TYPE, statistics.COMMENT, columns.TABLE_CATALOG, columns.TABLE_SCHEMA, columns.COLUMN_DEFAULT, columns.IS_NULLABLE, columns.DATA_TYPE, columns.CHARACTER_MAXIMUM_LENGTH, columns.CHARACTER_OCTET_LENGTH, columns.NUMERIC_PRECISION, columns.NUMERIC_SCALE, columns.CHARACTER_SET_NAME, columns.COLLATION_NAME, columns.COLUMN_TYPE, columns.COLUMN_KEY, columns.EXTRA, columns.PRIVILEGES, columns.COLUMN_COMMENT from information_schema.statistics join information_schema.columns using(table_name,column_name) where table_name='user'; +END +OUTPUT +select statistics.TABLE_NAME, statistics.COLUMN_NAME, statistics.TABLE_CATALOG, statistics.TABLE_SCHEMA, statistics.NON_UNIQUE, statistics.INDEX_SCHEMA, statistics.INDEX_NAME, statistics.SEQ_IN_INDEX, statistics.`COLLATION`, statistics.SUB_PART, statistics.PACKED, statistics.NULLABLE, statistics.INDEX_TYPE, statistics.`COMMENT`, `columns`.TABLE_CATALOG, `columns`.TABLE_SCHEMA, `columns`.COLUMN_DEFAULT, `columns`.IS_NULLABLE, `columns`.DATA_TYPE, `columns`.CHARACTER_MAXIMUM_LENGTH, `columns`.CHARACTER_OCTET_LENGTH, `columns`.NUMERIC_PRECISION, `columns`.NUMERIC_SCALE, `columns`.CHARACTER_SET_NAME, `columns`.COLLATION_NAME, `columns`.COLUMN_TYPE, `columns`.COLUMN_KEY, `columns`.EXTRA, `columns`.`PRIVILEGES`, `columns`.COLUMN_COMMENT from information_schema.statistics join information_schema.`columns` using (table_name, column_name) where table_name = 'user' +END +INPUT +select c from t1 where c='cccc'; +END +OUTPUT +select c from t1 where c = 'cccc' +END +INPUT +select substring('hello', -4294967295, -4294967295); +END +OUTPUT +select substr('hello', -4294967295, -4294967295) from dual +END +INPUT +select cast(1.0e+300 as signed int); +END +ERROR +syntax error at position 35 near 'int' +END +INPUT +select mbrwithin(ST_GeomFromText("linestring(1 0, 2 0)"), ST_GeomFromText("linestring(0 0, 3 0)")); +END +OUTPUT +select mbrwithin(ST_GeomFromText('linestring(1 0, 2 0)'), ST_GeomFromText('linestring(0 0, 3 0)')) from dual +END +INPUT +select locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D091D0B2 collate utf8mb4_bin); +END +OUTPUT +select locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D091D0B2 collate utf8mb4_bin) from dual +END +INPUT +select week(20001231,0) as '0', week(20001231,1) as '1', week(20001231,2) as '2', week(20001231,3) as '3', week(20001231,4) as '4', week(20001231,5) as '5', week(20001231,6) as '6', week(20001231,7) as '7'; +END +OUTPUT +select week(20001231, 0) as `0`, week(20001231, 1) as `1`, week(20001231, 2) as `2`, week(20001231, 3) as `3`, week(20001231, 4) as `4`, week(20001231, 5) as `5`, week(20001231, 6) as `6`, week(20001231, 7) as `7` from dual +END +INPUT +select date_sub("1998-01-01 00:00:00",INTERVAL 1 DAY); +END +OUTPUT +select date_sub('1998-01-01 00:00:00', interval 1 DAY) from dual +END +INPUT +select "he"; +END +OUTPUT +select 'he' from dual +END +INPUT +select LENGTH(RANDOM_BYTES(1))=1; +END +OUTPUT +select LENGTH(RANDOM_BYTES(1)) = 1 from dual +END +INPUT +select hex(concat(_utf32 0x0410 collate utf32_general_ci, 0x61)); +END +ERROR +syntax error at position 32 near '0x0410' +END +INPUT +select a.id, b.category as catid, b.state as stateid, b.county as countyid from t1 a, t2 b where (a.token = 'a71250b7ed780f6ef3185bfffe027983') and (a.count = b.id) order by a.id; +END +OUTPUT +select a.id, b.category as catid, b.state as stateid, b.county as countyid from t1 as a, t2 as b where a.token = 'a71250b7ed780f6ef3185bfffe027983' and a.count = b.id order by a.id asc +END +INPUT +select sql_data_access from information_schema.routines where specific_name like 'p%' and ROUTINE_SCHEMA != 'sys'; +END +OUTPUT +select sql_data_access from information_schema.routines where specific_name like 'p%' and ROUTINE_SCHEMA != 'sys' +END +INPUT +select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A'); +END +ERROR +syntax error at position 32 near 'COLLATE' +END +INPUT +select from v1 group by id limit 0; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select char(2557 using utf8mb4); +END +ERROR +syntax error at position 23 near 'using' +END +INPUT +select compress(a), compress(a) from t1; +END +OUTPUT +select compress(a), compress(a) from t1 +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL 1 YEAR); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval 1 YEAR) from dual +END +INPUT +select monthname("1972-03-04"),monthname("1972-03-04")+0; +END +OUTPUT +select monthname('1972-03-04'), monthname('1972-03-04') + 0 from dual +END +INPUT +select object_id, ST_geometrytype(geo), ST_ISSIMPLE(GEO), ST_ASTEXT(ST_centroid(geo)) from t1 where object_id=85984; +END +OUTPUT +select object_id, ST_geometrytype(geo), ST_ISSIMPLE(GEO), ST_ASTEXT(ST_centroid(geo)) from t1 where object_id = 85984 +END +INPUT +select @@global.optimizer_switch; +END +OUTPUT +select @@global.optimizer_switch from dual +END +INPUT +select from t5; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select date_sub("1998-01-01 00:00:00.000001",INTERVAL "1:1.000002" MINUTE_MICROSECOND); +END +OUTPUT +select date_sub('1998-01-01 00:00:00.000001', interval '1:1.000002' MINUTE_MICROSECOND) from dual +END +INPUT +select locate('lo','hello',2); +END +OUTPUT +select locate('lo', 'hello', 2) from dual +END +INPUT +select date_add("1997-12-31 23:59:59.000002",INTERVAL "10000.999999" SECOND_MICROSECOND); +END +OUTPUT +select date_add('1997-12-31 23:59:59.000002', interval '10000.999999' SECOND_MICROSECOND) from dual +END +INPUT +select get_lock("mysqltest_lock", 100); +END +OUTPUT +select get_lock('mysqltest_lock', 100) from dual +END +INPUT +select group_concat('x') UNION ALL select 1; +END +OUTPUT +(select group_concat('x') from dual) union all (select 1 from dual) +END +INPUT +select sql_big_result trim(t),count(t) from t1 group by t order by t limit 10; +END +ERROR +syntax error at position 28 +END +INPUT +select cast(rtrim(' 20.06 ') as decimal(19,2)); +END +OUTPUT +select convert(rtrim(' 20.06 '), decimal(19, 2)) from dual +END +INPUT +select rpad(c1,3,'�'), rpad('�',3,c1) from t1; +END +OUTPUT +select rpad(c1, 3, '�'), rpad('�', 3, c1) from t1 +END +INPUT +select date("1997-13-31 23:59:59.000001"); +END +OUTPUT +select date('1997-13-31 23:59:59.000001') from dual +END +INPUT +select week(19980101),week(19970101),week(19980101,1),week(19970101,1); +END +OUTPUT +select week(19980101), week(19970101), week(19980101, 1), week(19970101, 1) from dual +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_slovenian_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_slovenian_ci +END +INPUT +select from t2 where MATCH ticket AGAINST ('foobar'); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select date_sub("1998-01-01 00:00:00",INTERVAL "1 1" YEAR_MONTH); +END +OUTPUT +select date_sub('1998-01-01 00:00:00', interval '1 1' YEAR_MONTH) from dual +END +INPUT +select min(b) from t1; +END +OUTPUT +select min(b) from t1 +END +INPUT +select collation(substring(_latin2'ab',1)), coercibility(substring(_latin2'ab',1)); +END +OUTPUT +select collation(substr(_latin2 as ab, 1)), coercibility(substr(_latin2 as ab, 1)) from dual +END +INPUT +select ST_astext(geom), ST_area(geom),ST_area(ST_buffer(geom,2)) from t1; +END +OUTPUT +select ST_astext(geom), ST_area(geom), ST_area(ST_buffer(geom, 2)) from t1 +END +INPUT +select from t1,t2 right join t3 on (t2.i=t3.i) order by t1.i,t2.i,t3.i; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select FROM t3 where fld3='bonfire'; +END +ERROR +syntax error at position 12 near 'FROM' +END +INPUT +select count(*) from t1 where id2 = 10; +END +OUTPUT +select count(*) from t1 where id2 = 10 +END +INPUT +select ST_astext(st_symdifference(ST_GeomFromText('polygon((0 0, 1 0, 0 1, 0 0))'), ST_GeomFromText('polygon((0 0, 0 1, 1 1, 1 0, 0 0))'))) as result; +END +OUTPUT +select ST_astext(st_symdifference(ST_GeomFromText('polygon((0 0, 1 0, 0 1, 0 0))'), ST_GeomFromText('polygon((0 0, 0 1, 1 1, 1 0, 0 0))'))) as result from dual +END +INPUT +select TRIGGER_NAME from information_schema.triggers where trigger_schema='test'; +END +OUTPUT +select TRIGGER_NAME from information_schema.`triggers` where trigger_schema = 'test' +END +INPUT +select from v1 where id=1 group by id; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select t2.isbn,city,t1.libname,count(t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city,t1.libname; +END +OUTPUT +select t2.isbn, city, t1.libname, count(t1.libname) as a from t3 left join t1 on t3.libname = t1.libname left join t2 on t3.isbn = t2.isbn group by city, t1.libname +END +INPUT +select from information_schema.partitions where table_schema="test" and table_name="t3"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select id from t2; +END +OUTPUT +select id from t2 +END +INPUT +select Case When Count(*) < MAX_REQ Then 1 Else 0 End from t1 where t1.USR_ID = 1 group by MAX_REQ; +END +OUTPUT +select case when Count(*) < MAX_REQ then 1 else 0 end from t1 where t1.USR_ID = 1 group by MAX_REQ +END +INPUT +select t1.*,t2.* from t1 inner join t2 using (a); +END +OUTPUT +select t1.*, t2.* from t1 join t2 using (a) +END +INPUT +select length(uuid()), charset(uuid()), length(unhex(replace(uuid(),_utf8'-',_utf8''))); +END +OUTPUT +select length(uuid()), charset(uuid()), length(unhex(replace(uuid(), _utf8 '-', _utf8 ''))) from dual +END +INPUT +select substring('hello', 4294967296, 4294967296); +END +OUTPUT +select substr('hello', 4294967296, 4294967296) from dual +END +INPUT +select cast("2001-1-1" as datetime) = "2001-01-01 00:00:00"; +END +OUTPUT +select convert('2001-1-1', datetime) = '2001-01-01 00:00:00' from dual +END +INPUT +select a1,a2,b, max(c) from t1 where (c < 'k321') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c) from t1 where c < 'k321' group by a1, a2, b +END +INPUT +select grp,group_concat(c) from t1 group by grp; +END +OUTPUT +select grp, group_concat(c) from t1 group by grp +END +INPUT +select a.id, b.category as catid, b.state as stateid, b.county as countyid from t1 a, t2 b ignore index (primary) where (a.token ='a71250b7ed780f6ef3185bfffe027983') and (a.count = b.id); +END +OUTPUT +select a.id, b.category as catid, b.state as stateid, b.county as countyid from t1 as a, t2 as b ignore index (`primary`) where a.token = 'a71250b7ed780f6ef3185bfffe027983' and a.count = b.id +END +INPUT +select count(distinct n2) from t1; +END +OUTPUT +select count(distinct n2) from t1 +END +INPUT +select data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, dtd_identifier from information_schema.routines where routine_schema='test'; +END +OUTPUT +select data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, dtd_identifier from information_schema.routines where routine_schema = 'test' +END +INPUT +select 'null' sounds like null; +END +ERROR +syntax error at position 26 near 'like' +END +INPUT +select from t1 left join t2 on t1.a = t2.a order by t1.b; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select date,format,concat(TIME(str_to_date(date, format))) as time2 from t1; +END +OUTPUT +select `date`, `format`, concat(TIME(str_to_date(`date`, `format`))) as time2 from t1 +END +INPUT +select cast(cast('1.2' as decimal(3,2)) as signed); +END +OUTPUT +select convert(convert('1.2', decimal(3, 2)), signed) from dual +END +INPUT +select from t1 where a = 7 or not(a < 15 and a > 5); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select concat('',left(right(concat('what ',concat('is ','happening')),9),4),'',substring('monty',5,1)); +END +OUTPUT +select concat('', left(right(concat('what ', concat('is ', 'happening')), 9), 4), '', substr('monty', 5, 1)) from dual +END +INPUT +select _cp1251'andre%' like convert('andre�%' using cp1251) escape '�'; +END +ERROR +syntax error at position 28 near 'like' +END +INPUT +select a from t3 order by a desc limit 300,10; +END +OUTPUT +select a from t3 order by a desc limit 300, 10 +END +INPUT +select count(*) from t1 group by col2 having col1 = 10; +END +OUTPUT +select count(*) from t1 group by col2 having col1 = 10 +END +INPUT +select from t1 where match a against ("+aaa* +ccc*" in boolean mode); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select max_data_length into @changed_max_data_length from information_schema.tables where table_name='t1'; +END +ERROR +syntax error at position 53 near 'changed_max_data_length' +END +INPUT +select 1 and min(a) is null from t1; +END +OUTPUT +select 1 and min(a) is null from t1 +END +INPUT +select ST_astext(st_difference(ST_GeomFromText('multipoint(2 2, 3 3)'), ST_GeomFromText('multipoint(0 0, 4 4)'))); +END +OUTPUT +select ST_astext(st_difference(ST_GeomFromText('multipoint(2 2, 3 3)'), ST_GeomFromText('multipoint(0 0, 4 4)'))) from dual +END +INPUT +select a1,a2,b, max(c) from t1 where (c > 'b1') or (c <= 'g1') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c) from t1 where c > 'b1' or c <= 'g1' group by a1, a2, b +END +INPUT +select distinct sum(b) from (select a,b from t1) y group by a; +END +OUTPUT +select distinct sum(b) from (select a, b from t1) as y group by a +END +INPUT +select _utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%'); +END +OUTPUT +select _utf8 0xD0B0D0B1D0B2 like concat(_utf8 '%', _utf8 0xD0B1, _utf8 '%') from dual +END +INPUT +select from t1 where MATCH(a,b) AGAINST ("indexes"); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select collation(lpad(_latin2'a',4,_latin2'b')), coercibility(lpad(_latin2'a',4,_latin2'b')); +END +OUTPUT +select collation(lpad(_latin2 as a, 4, _latin2 as b)), coercibility(lpad(_latin2 as a, 4, _latin2 as b)) from dual +END +INPUT +select DAYOFYEAR("1997-03-03"), WEEK("1998-03-03"), QUARTER(980303); +END +OUTPUT +select DAYOFYEAR('1997-03-03'), WEEK('1998-03-03'), QUARTER(980303) from dual +END +INPUT +select timestampdiff(SQL_TSI_HOUR, '2001-02-01', '2001-05-01') as a; +END +OUTPUT +select timestampdiff(SQL_TSI_HOUR, '2001-02-01', '2001-05-01') as a from dual +END +INPUT +select max(t2.a1) from t2 left outer join t1 on t2.a2=10 where t2.a2=10; +END +OUTPUT +select max(t2.a1) from t2 left join t1 on t2.a2 = 10 where t2.a2 = 10 +END +INPUT +select timestampadd(SQL_TSI_SECOND, 1, date) from t1; +END +OUTPUT +select timestampadd(SQL_TSI_SECOND, 1, `date`) from t1 +END +INPUT +select from (select 1 as a) b left join (select 2 as a) c using(a); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select s1 as after_delete_bin from t1 where s1 like 'ペテ%'; +END +OUTPUT +select s1 as after_delete_bin from t1 where s1 like 'ペテ%' +END +INPUT +select substring('hello', -4294967297, -4294967297); +END +OUTPUT +select substr('hello', -4294967297, -4294967297) from dual +END +INPUT +select 12 mod 2 as '0'; +END +OUTPUT +select 12 % 2 as `0` from dual +END +INPUT +select 1 as weight_string, 2 as reverse; +END +OUTPUT +select 1 as weight_string, 2 as reverse from dual +END +INPUT +select c,count(*) from t1 group by c order by c limit 10; +END +OUTPUT +select c, count(*) from t1 group by c order by c asc limit 10 +END +INPUT +select concat(a, if(b>10, _utf8'æ', _utf8'ß')) from t1; +END +OUTPUT +select concat(a, if(b > 10, _utf8 'æ', _utf8 'ß')) from t1 +END +INPUT +select hex(group_concat(a separator ',')) from t1; +END +OUTPUT +select hex(group_concat(a separator ',')) from t1 +END +INPUT +select collation(quote(_latin2'ab')), coercibility(quote(_latin2'ab')); +END +OUTPUT +select collation(quote(_latin2 as ab)), coercibility(quote(_latin2 as ab)) from dual +END +INPUT +select group_concat(f1) from t1; +END +OUTPUT +select group_concat(f1) from t1 +END +INPUT +select CAST(0xffffffffffffffff as unsigned); +END +OUTPUT +select convert(0xffffffffffffffff, unsigned) from dual +END +INPUT +select "a" as col1, "ct" as col2; +END +OUTPUT +select 'a' as col1, 'ct' as col2 from dual +END +INPUT +select hex(_utf8 X'616263FF'); +END +OUTPUT +select hex(_utf8 X'616263FF') from dual +END +INPUT +select t2.count, t1.name from t2 inner join t1 using (color); +END +OUTPUT +select t2.count, t1.`name` from t2 join t1 using (color) +END +INPUT +select st_touches(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_touches(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select a, t1.* as 'with_alias' from t1; +END +ERROR +syntax error at position 18 near 'as' +END +INPUT +select @x:=group_concat(x) from t1 group by y; +END +ERROR +syntax error at position 11 near ':' +END +INPUT +select cast('-10a' as signed integer); +END +OUTPUT +select convert('-10a', signed) from dual +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_vietnamese_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_vietnamese_ci +END +INPUT +select from information_schema.partitions where table_schema="test" and table_name="t1"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 join (t2, t3) using (b); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select group_concat(null) from t1; +END +OUTPUT +select group_concat(null) from t1 +END +INPUT +select hex(weight_string(_utf16 0xD800DC01 collate utf16_unicode_ci)); +END +ERROR +syntax error at position 43 near '0xD800DC01' +END +INPUT +select from t4 where a+0 > 90; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1 and swt2b=1 limit 5; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a from t1 where right(a+0,6) in ( right(20040106123400,6) ); +END +OUTPUT +select a from t1 where right(a + 0, 6) in (right(20040106123400, 6)) +END +INPUT +select 'vv: Following query must use ALL(t1), eq_ref(A), eq_ref(B): vv' Z; +END +OUTPUT +select 'vv: Following query must use ALL(t1), eq_ref(A), eq_ref(B): vv' as Z from dual +END +INPUT +select group_concat(distinct b) from t1 group by a; +END +OUTPUT +select group_concat(distinct b) from t1 group by a +END +INPUT +select collation(trim(BOTH _latin2' ' FROM _latin2'a')), coercibility(trim(BOTH _latin2'a' FROM _latin2'a')); +END +ERROR +syntax error at position 38 near ' ' +END +INPUT +select hex(weight_string(ch)) w, name from t1 order by ch; +END +OUTPUT +select hex(weight_string(ch)) as w, `name` from t1 order by ch asc +END +INPUT +select date_sub("1998-01-01 00:00:00",INTERVAL 1 SECOND); +END +OUTPUT +select date_sub('1998-01-01 00:00:00', interval 1 SECOND) from dual +END +INPUT +select from t6 order by a,b; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(weight_string(s1)) from t1 order by s1; +END +OUTPUT +select hex(weight_string(s1)) from t1 order by s1 asc +END +INPUT +select collation(substring(_latin2'a',1,1)), coercibility(substring(_latin2'a',1,1)); +END +OUTPUT +select collation(substr(_latin2 as a, 1, 1)), coercibility(substr(_latin2 as a, 1, 1)) from dual +END +INPUT +select substring_index('aaaaaaaaa1','aaa',4); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aaa', 4) from dual +END +INPUT +select ST_astext(ST_centroid(ST_PolyFromWKB(ST_AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(1, 0), Point(0, 0))))))); +END +OUTPUT +select ST_astext(ST_centroid(ST_PolyFromWKB(ST_AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(1, 0), Point(0, 0))))))) from dual +END +INPUT +select null sounds like 'null'; +END +ERROR +syntax error at position 24 near 'like' +END +INPUT +select ST_Contains(ST_GeomFromText('POLYGON((0 0,5 0,5 5,0 5,0 0))'),ST_GeomFromText('LINESTRING(1 2,5 5)')) as result; +END +OUTPUT +select ST_Contains(ST_GeomFromText('POLYGON((0 0,5 0,5 5,0 5,0 0))'), ST_GeomFromText('LINESTRING(1 2,5 5)')) as result from dual +END +INPUT +select from t1 where a like '%PESA%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b; +END +OUTPUT +select a1, a2, b from t1 where a2 >= 'b' and b = 'a' group by a1, a2, b +END +INPUT +select space(18446744073709551616); +END +OUTPUT +select space(18446744073709551616) from dual +END +INPUT +select t1.*,t2.* from t1 left join t2 on (t1.a=t2.a) where t2.id is null; +END +OUTPUT +select t1.*, t2.* from t1 left join t2 on t1.a = t2.a where t2.id is null +END +INPUT +select ST_astext(st_symdifference(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))); +END +OUTPUT +select ST_astext(st_symdifference(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))) from dual +END +INPUT +select @@session.transaction_isolation; +END +OUTPUT +select @@session.transaction_isolation from dual +END +INPUT +select hex(left(_utf16 0xD800DC00D87FDFFF, 1)); +END +ERROR +syntax error at position 42 near '0xD800DC00D87FDFFF' +END +INPUT +select timestampdiff(QUARTER, '2002-05-01', '2001-01-01') as a; +END +OUTPUT +select timestampdiff(QUARTER, '2002-05-01', '2001-01-01') as a from dual +END +INPUT +select from information_schema.TABLE_CONSTRAINTS where TABLE_NAME= "vo"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select distinct a1 from t1 where a2 = 'b'; +END +OUTPUT +select distinct a1 from t1 where a2 = 'b' +END +INPUT +select SUBSTRING('abcdefg',3,2); +END +OUTPUT +select substr('abcdefg', 3, 2) from dual +END +INPUT +select locate('HE','hello' collate utf8mb4_bin,2); +END +OUTPUT +select locate('HE', 'hello' collate utf8mb4_bin, 2) from dual +END +INPUT +select field("b","a",NULL),field(1,0,NULL)+0,field(1.0,0.0,NULL)+0.0,field(1.0e1,0.0e1,NULL)+0.0e1; +END +OUTPUT +select field('b', 'a', null), field(1, 0, null) + 0, field(1.0, 0.0, null) + 0.0, field(1.0e1, 0.0e1, null) + 0.0e1 from dual +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_roman_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_roman_ci +END +INPUT +select locate('lo','hello',4294967295); +END +OUTPUT +select locate('lo', 'hello', 4294967295) from dual +END +INPUT +select cast('-1' as unsigned); +END +OUTPUT +select convert('-1', unsigned) from dual +END +INPUT +select hex(cast(0x20000000000000 as unsigned) + 1); +END +OUTPUT +select hex(convert(0x20000000000000, unsigned) + 1) from dual +END +INPUT +select cast(-1e18 as decimal(22,2)); +END +OUTPUT +select convert(-1e18, decimal(22, 2)) from dual +END +INPUT +select str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE; +END +OUTPUT +select str_to_date('10:00 PM', '%h:%i %p') + interval 10 MINUTE from dual +END +INPUT +select 497, TMP.ID, NULL from (select 497 as ID, MAX(t3.DATA) as DATA from t1 join t2 on (t1.ObjectID = t2.ID) join t3 on (t1.ObjectID = t3.ID) group by t2.ParID order by DATA DESC) as TMP; +END +OUTPUT +select 497, TMP.ID, null from (select 497 as ID, MAX(t3.`DATA`) as `DATA` from t1 join t2 on t1.ObjectID = t2.ID join t3 on t1.ObjectID = t3.ID group by t2.ParID order by `DATA` desc) as TMP +END +INPUT +select cast(1000 as CHAR(3)); +END +OUTPUT +select convert(1000, CHAR(3)) from dual +END +INPUT +select Fld1, max(Fld2) from t1 group by Fld1 having avg(Fld2) is not null; +END +OUTPUT +select Fld1, max(Fld2) from t1 group by Fld1 having avg(Fld2) is not null +END +INPUT +select from t1 where tt like '%AA%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select concat(a, if(b>10, 'x' 'æ', 'y' 'ß')) from t1; +END +OUTPUT +select concat(a, if(b > 10, 'x' as `æ`, 'y' as `ß`)) from t1 +END +INPUT +select from (t1 natural join t2) natural join (t3 join (t4 natural join t5) on (b < z)); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a.* from (select 214748364 as v_small) a; +END +OUTPUT +select a.* from (select 214748364 as v_small from dual) as a +END +INPUT +select a as uci1 from t1 where a like 'さしすせそかきくけこあいうえお%'; +END +OUTPUT +select a as uci1 from t1 where a like 'さしすせそかきくけこあいうえお%' +END +INPUT +select from t2 right join t1 on t2.a=t1.a; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from information_schema.views where table_name='v1' or table_name='v2'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*) from t3 where id3; +END +OUTPUT +select count(*) from t3 where id3 +END +INPUT +select st_union((cast(linestring(point(6,-68), point(-22,-4)) as binary(13))), st_intersection(point(6,8),multipoint(point(3,1),point(-4,-6),point(1,6),point(-3,-5),point(5,4)))); +END +OUTPUT +select st_union(convert(linestring(point(6, -68), point(-22, -4)), binary(13)), st_intersection(point(6, 8), multipoint(point(3, 1), point(-4, -6), point(1, 6), point(-3, -5), point(5, 4)))) from dual +END +INPUT +select st_disjoint(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_disjoint(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select _latin1 0xFF regexp _latin1 '[[:lower:]]' COLLATE latin1_bin; +END +OUTPUT +select _latin1 0xFF regexp _latin1 '[[:lower:]]' collate latin1_bin from dual +END +INPUT +select hex(weight_string('x�' as char(2))); +END +ERROR +syntax error at position 41 +END +INPUT +select spid,count(*) from t1 where spid between 1 and 2 group by spid; +END +OUTPUT +select spid, count(*) from t1 where spid between 1 and 2 group by spid +END +INPUT +select benchmark(100, (select (a) from table_26093)); +END +OUTPUT +select benchmark(100, (select a from table_26093)) from dual +END +INPUT +select get_lock('ee_16407_2', 60); +END +OUTPUT +select get_lock('ee_16407_2', 60) from dual +END +INPUT +select sql_big_result score,count(*) from t1 group by score order by score desc; +END +OUTPUT +select `sql_big_result` as score, count(*) from t1 group by score order by score desc +END +INPUT +select from information_schema.TABLE_CONSTRAINTS where TABLE_SCHEMA= "test" order by constraint_name; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from `information_schema`.`VIEWS` where `TABLE_NAME` = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2); +END +OUTPUT +select locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2) from dual +END +INPUT +select group_concat(distinct a, c order by a desc, c desc) from t1; +END +OUTPUT +select group_concat(distinct a, c order by a desc, c desc) from t1 +END +INPUT +select from t1 natural join (t2 join t4 on b + 1 = y); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select _utf8mb4 0xD0B0D0B1D0B2 like concat(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4 '%'); +END +OUTPUT +select _utf8mb4 0xD0B0D0B1D0B2 like concat(_utf8mb4 '%', _utf8mb4 0xD0B1, _utf8mb4 '%') from dual +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval 1 SECOND) from dual +END +INPUT +select t1.id, count(t2.id) from t1,t2 where t2.id = t1.id group by t1.id; +END +OUTPUT +select t1.id, count(t2.id) from t1, t2 where t2.id = t1.id group by t1.id +END +INPUT +select @@global.Host_Cache_Size=@Default_host_cache_size; +END +OUTPUT +select @@global.Host_Cache_Size = @Default_host_cache_size from dual +END +INPUT +select substring_index('the king of thethethe.the hill','the',-3); +END +OUTPUT +select substring_index('the king of thethethe.the hill', 'the', -3) from dual +END +INPUT +select rpad('hello', 18446744073709551615, '1'); +END +OUTPUT +select rpad('hello', 18446744073709551615, '1') from dual +END +INPUT +select position(("1" in (1,2,3)) in "01"); +END +ERROR +syntax error at position 41 near '01' +END +INPUT +select cast(variance(ff) as decimal(10,3)) from t2; +END +OUTPUT +select convert(variance(ff), decimal(10, 3)) from t2 +END +INPUT +select insert('hello', 18446744073709551615, 18446744073709551615, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select now()-curdate()*1000000-curtime(); +END +OUTPUT +select now() - curdate() * 1000000 - curtime() from dual +END +INPUT +select MYSQLTEST.t1.* from MYSQLTEST.t1; +END +OUTPUT +select MYSQLTEST.t1.* from MYSQLTEST.t1 +END +INPUT +select a from t1 where a='http://www.foo.com/' order by abs(timediff(ts, 0)); +END +OUTPUT +select a from t1 where a = 'http://www.foo.com/' order by abs(timediff(ts, 0)) asc +END +INPUT +select from t1, t2 where t1.start >= t2.ctime1 and t1.start <= t2.ctime2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select substring_index('the king of the the hill','the',3); +END +OUTPUT +select substring_index('the king of the the hill', 'the', 3) from dual +END +INPUT +select release_lock("mysqltest_lock"); +END +OUTPUT +select release_lock('mysqltest_lock') from dual +END +INPUT +select a from t1 group by b order by b; +END +OUTPUT +select a from t1 group by b order by b asc +END +INPUT +select a, ifnull(b,cast(-7 as signed)) as b, ifnull(c,cast(7 as unsigned)) as c, ifnull(d,cast('2000-01-01' as date)) as d, ifnull(e,cast('b' as char)) as e, ifnull(f,cast('2000-01-01' as datetime)) as f, ifnull(g,cast('5:4:3' as time)) as g, ifnull(h,cast('yet another binary data' as binary)) as h, addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd from t1; +END +OUTPUT +select a, ifnull(b, convert(-7, signed)) as b, ifnull(c, convert(7, unsigned)) as c, ifnull(d, convert('2000-01-01', date)) as d, ifnull(e, convert('b', char)) as e, ifnull(f, convert('2000-01-01', datetime)) as f, ifnull(g, convert('5:4:3', time)) as g, ifnull(h, convert('yet another binary data', binary)) as h, addtime(convert('1:0:0', time), convert('1:0:0', time)) as dd from t1 +END +INPUT +select substring('hello', 1, 18446744073709551616); +END +OUTPUT +select substr('hello', 1, 18446744073709551616) from dual +END +INPUT +select from t1 where bob is null and cip=1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a.f1 as a, b.f1 as b, a.f1 > b.f1 as gt, a.f1 < b.f1 as lt, a.f1<=>b.f1 as eq from t1 a, t1 b; +END +OUTPUT +select a.f1 as a, b.f1 as b, a.f1 > b.f1 as gt, a.f1 < b.f1 as lt, a.f1 <=> b.f1 as eq from t1 as a, t1 as b +END +INPUT +select from t1 where a like "%abcd%"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select fld3,companynr FROM t2 where companynr = 58 order by fld3; +END +OUTPUT +select fld3, companynr from t2 where companynr = 58 order by fld3 asc +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL -100000 MINUTE); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval -100000 MINUTE) from dual +END +INPUT +select insert('hello', 18446744073709551616, 1, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select b, group_concat(a) from t1 order by 1, 2; +END +OUTPUT +select b, group_concat(a) from t1 order by 1 asc, 2 asc +END +INPUT +select insert('hello', -1, 1, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select from t1 join (t2 join t4 on b + 1 = y) on t1.c = t4.c; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select f3 from t1 where timestamp(f3) between cast("2006-1-1 12:1:1" as datetime) and cast("2006-1-1 12:1:2" as datetime); +END +OUTPUT +select f3 from t1 where timestamp(f3) between convert('2006-1-1 12:1:1', datetime) and convert('2006-1-1 12:1:2', datetime) +END +INPUT +select f1() from t1; +END +OUTPUT +select f1() from t1 +END +INPUT +select hex(soundex(_utf32 0x000004100000041100000412)); +END +ERROR +syntax error at position 53 near '0x000004100000041100000412' +END +INPUT +select from t1 where 'K' > s1 and s1 = 'Y'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select timediff(cast('2004-12-30 12:00:00' as time), '12:00:00'); +END +OUTPUT +select timediff(convert('2004-12-30 12:00:00', time), '12:00:00') from dual +END +INPUT +select i from t1 where a=repeat(_utf8 0xD0B1,200); +END +OUTPUT +select i from t1 where a = repeat(_utf8 0xD0B1, 200) +END +INPUT +select @@read_rnd_buffer_size; +END +OUTPUT +select @@read_rnd_buffer_size from dual +END +INPUT +select left(_utf8mb4 0xD0B0D0B1D0B2,1); +END +OUTPUT +select left(_utf8mb4 0xD0B0D0B1D0B2, 1) from dual +END +INPUT +select 1197.90 mod 50; +END +OUTPUT +select 1197.90 % 50 from dual +END +INPUT +select column_name, NUMERIC_PRECISION, NUMERIC_SCALE from information_schema.columns where table_name='t1' order by column_name; +END +OUTPUT +select column_name, NUMERIC_PRECISION, NUMERIC_SCALE from information_schema.`columns` where table_name = 't1' order by column_name asc +END +INPUT +select "xyz" as name union select "abc" as name order by name desc; +END +OUTPUT +(select 'xyz' as `name` from dual) union (select 'abc' as `name` from dual) order by `name` desc +END +INPUT +select from t1 where text1 like 'teststring_%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select week("2000-01-01",1) as '2000', week("2001-01-01",1) as '2001', week("2002-01-01",1) as '2002',week("2003-01-01",1) as '2003', week("2004-01-01",1) as '2004', week("2005-01-01",1) as '2005', week("2006-01-01",1) as '2006'; +END +OUTPUT +select week('2000-01-01', 1) as `2000`, week('2001-01-01', 1) as `2001`, week('2002-01-01', 1) as `2002`, week('2003-01-01', 1) as `2003`, week('2004-01-01', 1) as `2004`, week('2005-01-01', 1) as `2005`, week('2006-01-01', 1) as `2006` from dual +END +INPUT +select strcmp(date_format(date_sub(localtimestamp(), interval 3 hour),"%Y-%m-%d"), utc_date())=0; +END +OUTPUT +select strcmp(date_format(date_sub(localtimestamp(), interval 3 hour), '%Y-%m-%d'), utc_date()) = 0 from dual +END +INPUT +select trim(trailing NULL from 'xyz') as "must_be_null"; +END +ERROR +syntax error at position 26 near 'NULL' +END +INPUT +select 0<=>0.0, 0.0<=>0E0, 0E0<=>"0", 10.0<=>1E1, 10<=>10.0, 10<=>1E1; +END +OUTPUT +select 0 <=> 0.0, 0.0 <=> 0E0, 0E0 <=> '0', 10.0 <=> 1E1, 10 <=> 10.0, 10 <=> 1E1 from dual +END +INPUT +select from t1 where MATCH a,b AGAINST ("+call* +coll*" IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*) from t1 where id1; +END +OUTPUT +select count(*) from t1 where id1 +END +INPUT +select 1 as f1 from information_schema.tables where "COLUMN_PRIVILEGES"= (select cast(table_name as char) from information_schema.tables where table_schema != 'performance_schema' order by table_name limit 1) limit 1; +END +OUTPUT +select 1 as f1 from information_schema.`tables` where 'COLUMN_PRIVILEGES' = (select convert(table_name, char) from information_schema.`tables` where table_schema != 'performance_schema' order by table_name asc limit 1) limit 1 +END +INPUT +select date_sub("1998-01-01 00:00:00",INTERVAL "1:1" HOUR_MINUTE); +END +OUTPUT +select date_sub('1998-01-01 00:00:00', interval '1:1' HOUR_MINUTE) from dual +END +INPUT +select (select f from (select max(t1.a) as f) as dt) as g from t1; +END +OUTPUT +select (select f from (select max(t1.a) as f from dual) as dt) as g from t1 +END +INPUT +select 'st_Intersects'; +END +OUTPUT +select 'st_Intersects' from dual +END +INPUT +select from table_24562; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select grp,group_concat(distinct c order by c separator ",") from t1 group by grp; +END +OUTPUT +select grp, group_concat(distinct c order by c asc separator ',') from t1 group by grp +END +INPUT +select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b) where charset(t2.a) = _utf8'binary' order by t1.a,t2.a; +END +OUTPUT +select t1.*, t2.* from t1 left join t2 on t1.b = t2.b where charset(t2.a) = _utf8 'binary' order by t1.a asc, t2.a asc +END +INPUT +select 1 from (select 1) as a; +END +OUTPUT +select 1 from (select 1 from dual) as a +END +INPUT +select t1.name, t2.name, t2.id from t2 right join t1 on (t1.id = t2.owner); +END +OUTPUT +select t1.`name`, t2.`name`, t2.id from t2 right join t1 on t1.id = t2.owner +END +INPUT +select column_name from information_schema.columns where table_schema='test' and table_name='t1'; +END +OUTPUT +select column_name from information_schema.`columns` where table_schema = 'test' and table_name = 't1' +END +INPUT +select a1,a2,b,min(c) from t1 where (ord(a1) > 97) and (ord(a2) + ord(a1) > 194) and (b = 'c') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c) from t1 where ord(a1) > 97 and ord(a2) + ord(a1) > 194 and b = 'c' group by a1, a2, b +END +INPUT +select var_samp(s), var_pop(s) from bug22555; +END +OUTPUT +select var_samp(s), var_pop(s) from bug22555 +END +INPUT +select cast(sum(distinct ff) as decimal(5,2)) from t2; +END +OUTPUT +select convert(sum(distinct ff), decimal(5, 2)) from t2 +END +INPUT +select substring_index('the king of the the hill',' ',-1); +END +OUTPUT +select substring_index('the king of the the hill', ' ', -1) from dual +END +INPUT +select a1, max(c) from t2 where a1 in ('a','b','d') group by a1,a2,b; +END +OUTPUT +select a1, max(c) from t2 where a1 in ('a', 'b', 'd') group by a1, a2, b +END +INPUT +select sum(col1) as co12 from t1 group by col2 having col2 10; +END +ERROR +syntax error at position 62 near '10' +END +INPUT +select 1, min(a) from t1i where 1=99; +END +OUTPUT +select 1, min(a) from t1i where 1 = 99 +END +INPUT +select microsecond(19971231235959.01) as a; +END +OUTPUT +select microsecond(19971231235959.01) as a from dual +END +INPUT +select addtime("-01:01:01.01", "-23:59:59.1") as a; +END +OUTPUT +select addtime('-01:01:01.01', '-23:59:59.1') as a from dual +END +INPUT +select timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001"); +END +OUTPUT +select timediff('2000:01:01 00:00:00', '2000:01:01 00:00:00.000001') from dual +END +INPUT +select rpad('hello', -18446744073709551617, '1'); +END +OUTPUT +select rpad('hello', -18446744073709551617, '1') from dual +END +INPUT +select c,count(t) from t1 group by c order by c limit 10; +END +OUTPUT +select c, count(t) from t1 group by c order by c asc limit 10 +END +INPUT +select substring('hello', -1, 1); +END +OUTPUT +select substr('hello', -1, 1) from dual +END +INPUT +select from information_schema.user_privileges where grantee like '%user%' and grantee not like '%session%' order by grantee; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(substr(_utf32 0x000000e4000000e500000068,-3)); +END +ERROR +syntax error at position 52 near '0x000000e4000000e500000068' +END +INPUT +select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121'); +END +OUTPUT +select distinct a1, a2, b, c from t2 where a2 >= 'b' and b = 'a' and c = 'i121' +END +INPUT +select concat("-",a,"-",b,"-") from t1 where b="hello "; +END +OUTPUT +select concat('-', a, '-', b, '-') from t1 where b = 'hello ' +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_slovenian_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_slovenian_ci +END +INPUT +select 123; +END +OUTPUT +select 123 from dual +END +INPUT +select round(1.5, -4294967296), round(1.5, 4294967296); +END +OUTPUT +select round(1.5, -4294967296), round(1.5, 4294967296) from dual +END +INPUT +select from t1 where MATCH(a,b) AGAINST ("indexes collections" WITH QUERY EXPANSION); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a1,a2,b,min(c),max(c) from t1 where (b = 'b') group by a1,a2; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 where b = 'b' group by a1, a2 +END +INPUT +select round(5.64,1),round(5.64,2),round(5.64,-1),round(5.64,-2); +END +OUTPUT +select round(5.64, 1), round(5.64, 2), round(5.64, -1), round(5.64, -2) from dual +END +INPUT +select max(a5) from t1 where a5 < date'1970-01-01'; +END +ERROR +syntax error at position 51 near '1970-01-01' +END +INPUT +select i.name as k, f.name as c from information_schema.innodb_tables as t, information_schema.innodb_indexes as i, information_schema.innodb_fields as f where t.name='test/t1' and t.table_id = i.table_id and i.index_id = f.index_id order by k, c; +END +OUTPUT +select i.`name` as k, f.`name` as c from information_schema.innodb_tables as t, information_schema.innodb_indexes as i, information_schema.innodb_fields as f where t.`name` = 'test/t1' and t.table_id = i.table_id and i.index_id = f.index_id order by k asc, c asc +END +INPUT +select mid(@my_uuid,15,1); +END +OUTPUT +select mid(@my_uuid, 15, 1) from dual +END +INPUT +select collation(concat_ws(_latin2'a',_latin2'b')), coercibility(concat_ws(_latin2'a',_latin2'b')); +END +OUTPUT +select collation(concat_ws(_latin2 as a, _latin2 as b)), coercibility(concat_ws(_latin2 as a, _latin2 as b)) from dual +END +INPUT +select st_touches(ST_GeomFromText('polygon((0 0, 2 2, 0 4, 0 0))'), ST_GeomFromText('point(1 1)')); +END +OUTPUT +select st_touches(ST_GeomFromText('polygon((0 0, 2 2, 0 4, 0 0))'), ST_GeomFromText('point(1 1)')) from dual +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL 1 MINUTE); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval 1 MINUTE) from dual +END +INPUT +select hex(_utf32 X'103344'); +END +ERROR +syntax error at position 28 near '103344' +END +INPUT +select substring('hello', 4294967296, 1); +END +OUTPUT +select substr('hello', 4294967296, 1) from dual +END +INPUT +select last_day('2005-01-00'); +END +OUTPUT +select last_day('2005-01-00') from dual +END +INPUT +select t2.b,t1.b,t1.a from t2 inner join t1 on 1 cross join t2 a on 1 group by t1.b; +END +OUTPUT +select t2.b, t1.b, t1.a from t2 join t1 on 1 join t2 as a on 1 group by t1.b +END +INPUT +select FIELD(_latin2'b','A','B'); +END +OUTPUT +select FIELD(_latin2 as b, 'A', 'B') from dual +END +INPUT +select from t1 where name='patnom' and author='patauteur' and category=0; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select std(s1/s2) from bug22555 where i=1; +END +OUTPUT +select std(s1 / s2) from bug22555 where i = 1 +END +INPUT +select ST_astext(st_intersection(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_difference(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))); +END +OUTPUT +select ST_astext(st_intersection(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_difference(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))) from dual +END +INPUT +select 'a' union select concat('a', -0.0); +END +OUTPUT +(select 'a' from dual) union (select concat('a', -0.0) from dual) +END +INPUT +select 9223372036854775808+1; +END +OUTPUT +select 9223372036854775808 + 1 from dual +END +INPUT +select inet_ntoa(1099511627775),inet_ntoa(4294902271),inet_ntoa(511); +END +OUTPUT +select inet_ntoa(1099511627775), inet_ntoa(4294902271), inet_ntoa(511) from dual +END +INPUT +select a1,a2,b,min(c),max(c) from t2 where (c > 'b1') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t2 where c > 'b1' group by a1, a2, b +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL "1 1" YEAR_MONTH); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval '1 1' YEAR_MONTH) from dual +END +INPUT +select distinct pk from v1; +END +OUTPUT +select distinct pk from v1 +END +INPUT +select ST_DISTANCE(ST_GeomFromText('polygon((0 0, 1 2, 2 1, 0 0))'), ST_GeomFromText('linestring(0 1, 1 0)')); +END +OUTPUT +select ST_DISTANCE(ST_GeomFromText('polygon((0 0, 1 2, 2 1, 0 0))'), ST_GeomFromText('linestring(0 1, 1 0)')) from dual +END +INPUT +select mod(12.0, NULL) as 'NULL'; +END +OUTPUT +select mod(12.0, null) as `NULL` from dual +END +INPUT +select from v1c join v2a on v1c.b = v2a.c; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*) from t1 where match a against ('aaaxxx' in boolean mode); +END +ERROR +syntax error at position 38 near 'a' +END +INPUT +select date_add("1997-12-31 23:59:59.000002",INTERVAL "10000 99:99:99.999999" DAY_MICROSECOND); +END +OUTPUT +select date_add('1997-12-31 23:59:59.000002', interval '10000 99:99:99.999999' DAY_MICROSECOND) from dual +END +INPUT +select from t5 where a < 3; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*) from t1 where a = 100; +END +OUTPUT +select count(*) from t1 where a = 100 +END +INPUT +select ST_area(ST_PolygonFromText('POLYGON((10 10,20 10,20 20,10 20, 10 10))')); +END +OUTPUT +select ST_area(ST_PolygonFromText('POLYGON((10 10,20 10,20 20,10 20, 10 10))')) from dual +END +INPUT +select min(a3) from t1 where a2 = 2 and a3 >= 'SEA' and a3 = 'MIN'; +END +OUTPUT +select min(a3) from t1 where a2 = 2 and a3 >= 'SEA' and a3 = 'MIN' +END +INPUT +select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2); +END +OUTPUT +select log(exp(10)), exp(log(sqrt(10)) * 2), log(-1), log(null), log(1, 1), log(3, 9), log(-1, 2), log(null, 2) from dual +END +INPUT +select max(t2.a2), max(t1.a1) from t1, t2; +END +OUTPUT +select max(t2.a2), max(t1.a1) from t1, t2 +END +INPUT +select from `information_schema`.`VIEWS` where `TABLE_SCHEMA` = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 1 like 2 xor 2 like 1; +END +OUTPUT +select 1 like 2 xor 2 like 1 from dual +END +INPUT +select from bug15205_2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*) from t where id>=8894754949779693574 and id <=17790886498483827171; +END +OUTPUT +select count(*) from t where id >= 8894754949779693574 and id <= 17790886498483827171 +END +INPUT +select hex(weight_string(_utf32 0x10001)); +END +ERROR +syntax error at position 40 near '0x10001' +END +INPUT +select t2.isbn,city,@bar:=t1.libname,count(distinct t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city having count(distinct t1.libname) > 1; +END +ERROR +syntax error at position 26 near ':' +END +INPUT +select format('f','')<=replace(1,1,mid(0xd9,2,1)); +END +OUTPUT +select format('f', '') <= replace(1, 1, mid(0xd9, 2, 1)) from dual +END +INPUT +select substring('hello', 4294967295, 4294967295); +END +OUTPUT +select substr('hello', 4294967295, 4294967295) from dual +END +INPUT +select @@warning_count; +END +OUTPUT +select @@warning_count from dual +END +INPUT +select 2 as a from (select from t1) b; +END +ERROR +syntax error at position 32 near 'from' +END +INPUT +select benchmark(100, (select avg(func_26093_a(a)) from table_26093)); +END +OUTPUT +select benchmark(100, (select avg(func_26093_a(a)) from table_26093)) from dual +END +INPUT +select abs(cast(-2 as unsigned)), abs(18446744073709551614), abs(-2); +END +OUTPUT +select abs(convert(-2, unsigned)), abs(18446744073709551614), abs(-2) from dual +END +INPUT +select hex(substr(_utf32 0x000000e4000000e500000068,3)); +END +ERROR +syntax error at position 52 near '0x000000e4000000e500000068' +END +INPUT +select concat('|',c,'|') from t1; +END +OUTPUT +select concat('|', c, '|') from t1 +END +INPUT +select group_concat(c order by (select concat(t1.c,group_concat(c)) from t2 where a=t1.a)) as grp from t1; +END +OUTPUT +select group_concat(c order by (select concat(t1.c, group_concat(c)) from t2 where a = t1.a) asc) as grp from t1 +END +INPUT +select s1,count(s1) from t1 group by s1 collate latin1_swedish_ci having s1 = 'y'; +END +OUTPUT +select s1, count(s1) from t1 group by s1 collate latin1_swedish_ci having s1 = 'y' +END +INPUT +select group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a)) as grp from t1; +END +OUTPUT +select group_concat(c order by (select mid(group_concat(c order by a asc), 1, 5) from t2 where t2.a = t1.a) asc) as grp from t1 +END +INPUT +select a1,a2,b,min(c) from t1 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c < 'h112') or (c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122')) group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c) from t1 where (a1 > 'a' or a1 < '9') and (a2 >= 'b' and a2 < 'z') and b = 'a' and (c < 'h112' or c = 'j121' or c > 'k121' and c < 'm122' or c > 'o122') group by a1, a2, b +END +INPUT +select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1; +END +OUTPUT +select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1 +END +INPUT +select count(*) from t3; +END +OUTPUT +select count(*) from t3 +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_turkish_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_turkish_ci +END +INPUT +select round(1.5, 18446744073709551615), truncate(1.5, 18446744073709551615); +END +OUTPUT +select round(1.5, 18446744073709551615), truncate(1.5, 18446744073709551615) from dual +END +INPUT +select a2 from t1 join t2 using (a1) join t3 on b=c1 join t4 using (c2); +END +OUTPUT +select a2 from t1 join t2 using (a1) join t3 on b = c1 join t4 using (c2) +END +INPUT +select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4 group by c2; +END +OUTPUT +select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4 group by c2 +END +INPUT +select count(*) from t1 where t='a'; +END +OUTPUT +select count(*) from t1 where t = 'a' +END +INPUT +select row_number() over (), value,description,COUNT(bug_id) from t2 left join t1 on t2.program=t1.product and t2.value=t1.component where program="AAAAA" group by value having COUNT(bug_id) IN (0,2); +END +ERROR +syntax error at position 27 +END +INPUT +select from t1 where lower(a)='aaa'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a1,min(c),max(c) from t2 where a1 >= 'b' group by a1,a2,b; +END +OUTPUT +select a1, min(c), max(c) from t2 where a1 >= 'b' group by a1, a2, b +END +INPUT +select table_name,column_name from information_schema.COLUMNS where table_schema like "test%" order by table_name, column_name; +END +OUTPUT +select table_name, column_name from information_schema.`COLUMNS` where table_schema like 'test%' order by table_name asc, column_name asc +END +INPUT +select from v0; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select ST_astext(st_symdifference(ST_GeomFromText('multipoint(2 2, 3 3)'), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))); +END +OUTPUT +select ST_astext(st_symdifference(ST_GeomFromText('multipoint(2 2, 3 3)'), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))) from dual +END +INPUT +select 2; +END +OUTPUT +select 2 from dual +END +INPUT +select _latin1'B' in (_latin1'a',_latin2'b'); +END +ERROR +syntax error at position 44 near 'b' +END +INPUT +select right('hello', -4294967297); +END +OUTPUT +select right('hello', -4294967297) from dual +END +INPUT +select timestampdiff(month,'2003-02-28','2005-02-28'); +END +OUTPUT +select timestampdiff(month, '2003-02-28', '2005-02-28') from dual +END +INPUT +select t1.a,t3.a from t1,(select from t2 where b='c') as t3 where t1.a = t3.a; +END +ERROR +syntax error at position 38 near 'from' +END +INPUT +select ST_astext(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(1, 0), Point(0, 0)))); +END +OUTPUT +select ST_astext(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(1, 0), Point(0, 0)))) from dual +END +INPUT +select host,user from mysql.user where User='myuser'; +END +OUTPUT +select host, `user` from mysql.`user` where `User` = 'myuser' +END +INPUT +select from t5 natural right join (t4 natural right join ((t2 natural right join t1) natural right join t3)); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(distinct concat(c1, repeat('xx', 250))) as cc from t2 order by 1; +END +OUTPUT +select count(distinct concat(c1, repeat('xx', 250))) as cc from t2 order by 1 asc +END +INPUT +select X.a from t1 AS X group by X.b having (x.b = 1); +END +OUTPUT +select X.a from t1 as X group by X.b having x.b = 1 +END +INPUT +select count(*) from t1 where id IS NULL; +END +OUTPUT +select count(*) from t1 where id is null +END +INPUT +select SQL_BIG_RESULT distinct from t1, t2 order by 1, 2, 3, 4; +END +ERROR +syntax error at position 31 near 'distinct' +END +INPUT +select benchmark(100, (select avg(func_26093_b(a, rand())) from table_26093)); +END +OUTPUT +select benchmark(100, (select avg(func_26093_b(a, rand())) from table_26093)) from dual +END +INPUT +select @topic1_id:= 10101; +END +ERROR +syntax error at position 19 near ':' +END +INPUT +select locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3 collate ujis_bin); +END +ERROR +syntax error at position 27 near '0xa2a1' +END +INPUT +select 1 as a union all select 1 union all select 2 union select 1 union all select 2; +END +OUTPUT +(select 1 as a from dual) union all (select 1 from dual) union all (select 2 from dual) union (select 1 from dual) union all (select 2 from dual) +END +INPUT +select mod(5, cast(-2 as unsigned)), mod(5, 18446744073709551614), mod(5, -2); +END +OUTPUT +select mod(5, convert(-2, unsigned)), mod(5, 18446744073709551614), mod(5, -2) from dual +END +INPUT +select _koi8r'a' = _koi8r'A'; +END +ERROR +syntax error at position 19 +END +INPUT +select collation(char(130)), coercibility(hex(130)); +END +OUTPUT +select collation(char(130)), coercibility(hex(130)) from dual +END +INPUT +select from_unixtime(2147483647); +END +OUTPUT +select from_unixtime(2147483647) from dual +END +INPUT +select release_lock('mysqltest_lock'); +END +OUTPUT +select release_lock('mysqltest_lock') from dual +END +INPUT +select collation(make_set(255,_latin2'a',_latin2'b',_latin2'c')), coercibility(make_set(255,_latin2'a',_latin2'b',_latin2'c')); +END +OUTPUT +select collation(make_set(255, _latin2 as a, _latin2 as b, _latin2 as c)), coercibility(make_set(255, _latin2 as a, _latin2 as b, _latin2 as c)) from dual +END +INPUT +select a$1, $b, c$ from mysqltest.$test1; +END +OUTPUT +select a$1, $b, c$ from mysqltest.$test1 +END +INPUT +select database(), user(); +END +OUTPUT +select database(), user() from dual +END +INPUT +select group_concat(a,c,null) from t1; +END +OUTPUT +select group_concat(a, c, null) from t1 +END +INPUT +select a1,a2,b, max(c) from t1 where (b = 'b') group by a1,a2; +END +OUTPUT +select a1, a2, b, max(c) from t1 where b = 'b' group by a1, a2 +END +INPUT +select database() = _latin1"test"; +END +OUTPUT +select database() = _latin1 'test' from dual +END +INPUT +select date_add("1997-12-31 23:59:59.000002",INTERVAL "10000:99.999999" MINUTE_MICROSECOND); +END +OUTPUT +select date_add('1997-12-31 23:59:59.000002', interval '10000:99.999999' MINUTE_MICROSECOND) from dual +END +INPUT +select insert(_ucs2 0x006100620063,1,2,_ucs2 0x006400650066); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select hex(@utf81); +END +OUTPUT +select hex(@utf81) from dual +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_german2_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_german2_ci +END +INPUT +select case when 1>0 then "TRUE" else "FALSE" END; +END +OUTPUT +select case when 1 > 0 then 'TRUE' else 'FALSE' end from dual +END +INPUT +select aes_encrypt("a",NULL); +END +OUTPUT +select aes_encrypt('a', null) from dual +END +INPUT +select hex(weight_string('aa' as char(3))); +END +ERROR +syntax error at position 39 +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL "1:1" HOUR_MINUTE); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval '1:1' HOUR_MINUTE) from dual +END +INPUT +select ST_astext(ST_buffer(ST_geometryfromtext('point(1 1)'), 1)); +END +OUTPUT +select ST_astext(ST_buffer(ST_geometryfromtext('point(1 1)'), 1)) from dual +END +INPUT +select concat(a,if(b<10,_ucs2 0x00C0,_ucs2 0x0062)) from t1; +END +ERROR +syntax error at position 37 near '0x00C0' +END +INPUT +select substring_index('aaaaaaaaa1','aaaa',2); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aaaa', 2) from dual +END +INPUT +select t1.* as 'with_alias', t1.* as 'alias2' from t1; +END +ERROR +syntax error at position 15 near 'as' +END +INPUT +select @@session.time_zone into @save_tz; +END +ERROR +syntax error at position 41 near 'save_tz' +END +INPUT +select count(*), min(7), max(7) from t1m, t1i; +END +OUTPUT +select count(*), min(7), max(7) from t1m, t1i +END +INPUT +select password_lifetime from mysql.user where user='wl7131'; +END +OUTPUT +select password_lifetime from mysql.`user` where `user` = 'wl7131' +END +INPUT +select from myUC; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select id >= 0 and id <= 5 as grp,count(*) from t1 group by grp; +END +OUTPUT +select id >= 0 and id <= 5 as grp, count(*) from t1 group by grp +END +INPUT +select 'y'='~'; +END +OUTPUT +select 'y' = '~' from dual +END +INPUT +select from t1 where i between 2 and 4 and v in ('def','3r4f','lmn'); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where c1='b'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select datediff("1997-11-30 23:59:59.000001","1997-12-31"); +END +OUTPUT +select datediff('1997-11-30 23:59:59.000001', '1997-12-31') from dual +END +INPUT +select @topic2_id:= 10102; +END +ERROR +syntax error at position 19 near ':' +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_hungarian_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_hungarian_ci +END +INPUT +select hex(a) from t1 order by a; +END +OUTPUT +select hex(a) from t1 order by a asc +END +INPUT +select date_add(date,INTERVAL "1:1" DAY_HOUR) from t1; +END +OUTPUT +select date_add(`date`, interval '1:1' DAY_HOUR) from t1 +END +INPUT +select from v1a join v1b on t1.b = t2.b; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select date_sub("1998-01-01 00:00:00",INTERVAL "1 1:1:1" DAY_SECOND); +END +OUTPUT +select date_sub('1998-01-01 00:00:00', interval '1 1:1:1' DAY_SECOND) from dual +END +INPUT +select cast(rtrim(ltrim(' 20.06 ')) as decimal(19,2)); +END +OUTPUT +select convert(rtrim(ltrim(' 20.06 ')), decimal(19, 2)) from dual +END +INPUT +select from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select max(value) from t1 AS m LEFT JOIN t2 AS c1 ON m.c1id = c1.id AND c1.active = 'Yes' LEFT JOIN t3 AS c2 ON m.c2id = c2.id AND c2.active = 'Yes' WHERE m.pid=1 AND (c1.id IS NOT NULL OR c2.id IS NOT NULL); +END +OUTPUT +select max(value) from t1 as m left join t2 as c1 on m.c1id = c1.id and c1.active = 'Yes' left join t3 as c2 on m.c2id = c2.id and c2.active = 'Yes' where m.pid = 1 and (c1.id is not null or c2.id is not null) +END +INPUT +select from t1 where a in (select a from t11) order by 1, 2, 3 limit 1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where a='807780' and b='477' and c='165'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select timestampdiff(month,'1999-09-11','2001-9-11'); +END +OUTPUT +select timestampdiff(month, '1999-09-11', '2001-9-11') from dual +END +INPUT +select ST_astext(st_intersection(ST_GeomFromText('multipoint(2 2, 3 3)'), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))); +END +OUTPUT +select ST_astext(st_intersection(ST_GeomFromText('multipoint(2 2, 3 3)'), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))) from dual +END +INPUT +select st_astext(st_intersection( st_geomfromtext('polygon((0 0, 1 0, 1 1, 0 1, 0 0))'), st_geomfromtext('polygon((2 0, 3 0, 3 1, 2 1, 2 0))'))) select st_astext(st_intersection( st_geomfromtext('polygon((0 0, 2 0, 2 1, 0 1, 0 0))'), st_geomfromtext('polygon((1 0, 3 0, 3 1, 1 1, 1 0))'))) select st_astext(st_intersection( st_geomfromtext('polygon((0 0, 1 0, 1 1, 0 1, 0 0))'), st_geomfromtext('polygon((1 0, 2 0, 2 1, 1 1, 1 0))'))) select st_astext(st_intersection( st_geomfromtext('polygon((0 0, 10 0, 10 3, 0 3, 0 0))'), st_geomfromtext('polygon((0 5, 1 3, 2 5, 0 5))'))) select st_astext(st_intersection( st_geomfromtext('polygon((0 0, 10 0, 10 3, 0 3, 0 0))'), st_geomfromtext('polygon((0 5, 1 3, 2 5, 3 3, 4 3, 4 5, 0 5))'))) select st_astext(st_intersection( st_geomfromtext('polygon((0 0, 10 0, 10 3, 0 3, 0 0))'), st_geomfromtext('polygon((0 5, 1 3, 2 5, 3 2, 6 2, 6 5, 0 5))'))) select st_astext(st_intersection( st_geomfromtext('polygon((0 0, 10 0, 10 3, 0 3, 0 0))'), st_geomfromtext('polygon((0 5, 1 3, 4 3, 4 2, 6 2, 6 5, 0 5))'))) select st_astext(st_intersection( st_geomfromtext('polygon((0 0, 10 0, 10 3, 0 3, 0 0))'), st_geomfromtext('polygon((0 5, 1 3, 4 3, 4 0, 6 0, 6 3, 5 3, 5 5, 0 5))'))) select st_astext(st_intersection( st_geomfromtext('polygon((0 0, 10 0, 10 3, 0 3, 0 0))'), st_geomfromtext('polygon((0 5, 1 3, 2 5, 3 3, 4 3, 4 2, 6 2, 6 5, 0 5))'))) select st_astext(st_intersection( st_geomfromtext('polygon((0 0, 10 0, 10 3, 0 3, 0 0))'), st_geomfromtext('polygon((0 5, 1 3, 2 5, 3 3, 4 3, 4 0, 10 0, 10 3, 6 3, 6 5, 0 5))'))) SELECT ST_AsText(ST_GeomFromText("POINT(10 11) POINT(11 12)")) as result; +END +ERROR +syntax error at position 152 near 'select' +END +INPUT +select a1,a2,b,min(c),max(c) from t2 where (c > 'f123') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t2 where c > 'f123' group by a1, a2, b +END +INPUT +select from t1_base; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select @iv; +END +OUTPUT +select @iv from dual +END +INPUT +select from t1 where str is null; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select _koi8r 0xFF regexp _koi8r '[[:upper:]]' COLLATE koi8r_bin; +END +ERROR +syntax error at position 19 near '0xFF' +END +INPUT +select from t1 left join t2 on (t1.i=t2.i) left join t3 on (t2.i=t3.i); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from mysqltest1.t22; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select round(999999999999999999, -18); +END +OUTPUT +select round(999999999999999999, -18) from dual +END +INPUT +select locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D0B1D0B2); +END +OUTPUT +select locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D0B1D0B2) from dual +END +INPUT +select from t1 where str="foo"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select date_add(datetime, INTERVAL 1 SECOND) from t1; +END +OUTPUT +select date_add(`datetime`, interval 1 SECOND) from t1 +END +INPUT +select max(a) from t1; +END +OUTPUT +select max(a) from t1 +END +INPUT +select t1.a1, t1.a2, t2.a1, t2.a2 from t1,t2; +END +OUTPUT +select t1.a1, t1.a2, t2.a1, t2.a2 from t1, t2 +END +INPUT +select replace('aaaa','a','b'),replace('aaaa','aa','b'),replace('aaaa','a','bb'),replace('aaaa','','b'),replace('bbbb','a','c'); +END +OUTPUT +select replace('aaaa', 'a', 'b'), replace('aaaa', 'aa', 'b'), replace('aaaa', 'a', 'bb'), replace('aaaa', '', 'b'), replace('bbbb', 'a', 'c') from dual +END +INPUT +select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci; +END +ERROR +syntax error at position 19 +END +INPUT +select fld3 from t2 where fld3 like "%cultivation"; +END +OUTPUT +select fld3 from t2 where fld3 like '%cultivation' +END +INPUT +select t1.id, t2.id from t1, t2 where t2.id = t1.id; +END +OUTPUT +select t1.id, t2.id from t1, t2 where t2.id = t1.id +END +INPUT +select avg ( (select ( (select sum(outr.a + innr.a) from t1 as innr limit 1)) as tt from t1 as outr order by count(outr.a) limit 1)) as tt from t1 as most_outer; +END +OUTPUT +select avg((select (select sum(outr.a + innr.a) from t1 as innr limit 1) as tt from t1 as outr order by count(outr.a) asc limit 1)) as tt from t1 as most_outer +END +INPUT +select a1,a2,b,min(c),max(c) from t2 where a1 >= 'c' or a2 < 'b' group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t2 where a1 >= 'c' or a2 < 'b' group by a1, a2, b +END +INPUT +select from t1 where id <=>id; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(cast(9007199254740993 as decimal(30,0))); +END +OUTPUT +select hex(convert(9007199254740993, decimal(30, 0))) from dual +END +INPUT +select min(a3) from t1 where a2 = 4; +END +OUTPUT +select min(a3) from t1 where a2 = 4 +END +INPUT +select count(T1.a) from t1; +END +OUTPUT +select count(T1.a) from t1 +END +INPUT +select aes_decrypt("a","a"); +END +OUTPUT +select aes_decrypt('a', 'a') from dual +END +INPUT +select collation(group_concat(a,_koi8r'test')) from t1; +END +OUTPUT +select collation(group_concat(a, _koi8r as test)) from t1 +END +INPUT +select from t1 where match title against ('test' in boolean mode); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a1,a2,b,min(c) from t2 where (a2 = 'a') and b is NULL group by a1; +END +OUTPUT +select a1, a2, b, min(c) from t2 where a2 = 'a' and b is null group by a1 +END +INPUT +select *,substring(b,1),substring(b,-1),substring(b,-2),substring(b,-3),substring(b,-4),substring(b,-5) from t1; +END +OUTPUT +select *, substr(b, 1), substr(b, -1), substr(b, -2), substr(b, -3), substr(b, -4), substr(b, -5) from t1 +END +INPUT +select TABLE_NAME,TABLE_TYPE,ENGINE from information_schema.tables where table_schema='information_schema' order by table_name collate utf8_general_ci limit 2; +END +OUTPUT +select TABLE_NAME, TABLE_TYPE, `ENGINE` from information_schema.`tables` where table_schema = 'information_schema' order by table_name collate utf8_general_ci asc limit 2 +END +INPUT +select grp,group_concat(a order by a,d+c-ascii(c)-a) from t1 group by grp; +END +OUTPUT +select grp, group_concat(a order by a asc, d + c - ascii(c) - a asc) from t1 group by grp +END +INPUT +select from t1 union select from t2 order by 1, 2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select CAST(1-2 AS UNSIGNED); +END +OUTPUT +select convert(1 - 2, UNSIGNED) from dual +END +INPUT +select (with recursive dt as (select t1.a as a union all select a+1 from dt where a<10) select concat(count(*), ' - ', avg(dt.a)) from dt ) as subq from t1; +END +ERROR +syntax error at position 13 near 'with' +END +INPUT +select substring_index('the king of the the hill',' ',-5); +END +OUTPUT +select substring_index('the king of the the hill', ' ', -5) from dual +END +INPUT +select min(f1),max(f1) from t1; +END +OUTPUT +select min(f1), max(f1) from t1 +END +INPUT +select 1 as a limit 4294967296,10; +END +OUTPUT +select 1 as a from dual limit 4294967296, 10 +END +INPUT +select timestampadd(MINUTE, 1, date) from t1; +END +OUTPUT +select timestampadd(MINUTE, 1, `date`) from t1 +END +INPUT +select ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('LINESTRING(-10 -10, 200 200)'))); +END +OUTPUT +select ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('LINESTRING(-10 -10, 200 200)'))) from dual +END +INPUT +select TABLE_SCHEMA,TABLE_NAME FROM information_schema.TABLES where TABLE_SCHEMA ='mysqltest_LC2'; +END +OUTPUT +select TABLE_SCHEMA, TABLE_NAME from information_schema.`TABLES` where TABLE_SCHEMA = 'mysqltest_LC2' +END +INPUT +select hex(weight_string(0x010203)); +END +OUTPUT +select hex(weight_string(0x010203)) from dual +END +INPUT +select max(t2.a1) from t2 left outer join t1 on t2.a2=10 where t2.a2=20; +END +OUTPUT +select max(t2.a1) from t2 left join t1 on t2.a2 = 10 where t2.a2 = 20 +END +INPUT +select length(_latin1'; +END +ERROR +syntax error at position 24 near ';' +END +INPUT +select _latin1'B' collate latin1_bin between _latin1'a' and _latin1'c'; +END +OUTPUT +select _latin1 'B' collate latin1_bin between _latin1 'a' and _latin1 'c' from dual +END +INPUT +select t1.i,t2.i,t3.i from t2 natural left join t3,t1 order by t1.i,t2.i,t3.i; +END +OUTPUT +select t1.i, t2.i, t3.i from t2 natural left join t3, t1 order by t1.i asc, t2.i asc, t3.i asc +END +INPUT +select char(2557 using utf8); +END +ERROR +syntax error at position 23 near 'using' +END +INPUT +select uncompressed_length(""); +END +OUTPUT +select uncompressed_length('') from dual +END +INPUT +select -1 >> 0, -1 << 0; +END +OUTPUT +select -1 >> 0, -1 << 0 from dual +END +INPUT +select a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, c from t2 where a2 >= 'b' and b = 'a' and c = 'i121' group by a1, a2, b +END +INPUT +select char_length(a), length(a), a from t1 order by a; +END +OUTPUT +select char_length(a), length(a), a from t1 order by a asc +END +INPUT +select t1.*,t2.* from t1 left join t2 on (t1.a=t2.a) order by t1.grp,t1.a,t2.c; +END +OUTPUT +select t1.*, t2.* from t1 left join t2 on t1.a = t2.a order by t1.grp asc, t1.a asc, t2.c asc +END +INPUT +select QN.a from (select 1 as a) as qn; +END +OUTPUT +select QN.a from (select 1 as a from dual) as qn +END +INPUT +select cast(pow(2,63)-1024 as signed) as pp; +END +OUTPUT +select convert(pow(2, 63) - 1024, signed) as pp from dual +END +INPUT +select yearweek("2000-01-01",1) as '2000', yearweek("2001-01-01",1) as '2001', yearweek("2002-01-01",1) as '2002',yearweek("2003-01-01",1) as '2003', yearweek("2004-01-01",1) as '2004', yearweek("2005-01-01",1) as '2005', yearweek("2006-01-01",1) as '2006'; +END +OUTPUT +select yearweek('2000-01-01', 1) as `2000`, yearweek('2001-01-01', 1) as `2001`, yearweek('2002-01-01', 1) as `2002`, yearweek('2003-01-01', 1) as `2003`, yearweek('2004-01-01', 1) as `2004`, yearweek('2005-01-01', 1) as `2005`, yearweek('2006-01-01', 1) as `2006` from dual +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_turkish_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_turkish_ci +END +INPUT +select char_length(_utf16 0xD87FDFFF), octet_length(_utf16 0xD87FDFFF); +END +ERROR +syntax error at position 37 near '0xD87FDFFF' +END +INPUT +select min(a) from t1i; +END +OUTPUT +select min(a) from t1i +END +INPUT +select from t1 where t1="ABCD"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 1e18 cast('1.2' as decimal(3,2)); +END +ERROR +syntax error at position 17 near 'cast' +END +INPUT +select count(*) from t1 where a >= 10; +END +OUTPUT +select count(*) from t1 where a >= 10 +END +INPUT +select extract(HOUR FROM "1999-01-02 10:11:12"); +END +ERROR +syntax error at position 25 near 'FROM' +END +INPUT +select a.text, b.id, b.betreff from t2 a inner join t3 b on a.id = b.forum inner join t1 c on b.id = c.thread where match(b.betreff) against ('+abc' in boolean mode) group by a.text, b.id, b.betreff union select a.text, b.id, b.betreff from t2 a inner join t3 b on a.id = b.forum inner join t1 c on b.id = c.thread where match(c.beitrag) against ('+abc' in boolean mode) group by a.text, b.id, b.betreff order by match(b.betreff) against ('+abc' in boolean mode) desc; +END +OUTPUT +(select a.`text`, b.id, b.betreff from t2 as a join t3 as b on a.id = b.forum join t1 as c on b.id = c.thread where match(b.betreff) against ('+abc' in boolean mode) group by a.`text`, b.id, b.betreff) union (select a.`text`, b.id, b.betreff from t2 as a join t3 as b on a.id = b.forum join t1 as c on b.id = c.thread where match(c.beitrag) against ('+abc' in boolean mode) group by a.`text`, b.id, b.betreff) order by match(b.betreff) against ('+abc' in boolean mode) desc +END +INPUT +select count(s1) from t1 group by s1 having count(1+1)=2; +END +OUTPUT +select count(s1) from t1 group by s1 having count(1 + 1) = 2 +END +INPUT +select ST_AsText(a) from t2; +END +OUTPUT +select ST_AsText(a) from t2 +END +INPUT +select count(distinct f) from t1; +END +OUTPUT +select count(distinct f) from t1 +END +INPUT +select repeat('hello', -4294967297); +END +OUTPUT +select repeat('hello', -4294967297) from dual +END +INPUT +select a1, b, min(c), a1, max(c), b, a2, max(c), max(c) from t1 group by a1, a2, b; +END +OUTPUT +select a1, b, min(c), a1, max(c), b, a2, max(c), max(c) from t1 group by a1, a2, b +END +INPUT +select max(t1.a1), max(t2.a2) from t1, t2; +END +OUTPUT +select max(t1.a1), max(t2.a2) from t1, t2 +END +INPUT +select from (select 2 from DUAL) b; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where field = '2006-11-06'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select _latin1'B' COLLATE latin1_general_ci in (_latin1'a',_latin1'b' COLLATE latin1_bin); +END +OUTPUT +select _latin1 'B' collate latin1_general_ci in (_latin1 'a', _latin1 'b' collate latin1_bin) from dual +END +INPUT +select substring_index('aaaaaaaaa1','aa',-5); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aa', -5) from dual +END +INPUT +select count(*) from t3 where t = "cc"; +END +OUTPUT +select count(*) from t3 where t = 'cc' +END +INPUT +select date_add('1998-01-30',Interval 1 month); +END +OUTPUT +select date_add('1998-01-30', interval 1 month) from dual +END +INPUT +select from t12; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select row('A' COLLATE latin1_general_ci,'b','c') = row('a' COLLATE latin1_bin,'b','c'); +END +OUTPUT +select row('A' collate latin1_general_ci, 'b', 'c') = row('a' collate latin1_bin, 'b', 'c') from dual +END +INPUT +select group_concat(t1.id) FROM t1,t2; +END +OUTPUT +select group_concat(t1.id) from t1, t2 +END +INPUT +select 50, 'abc'; +END +OUTPUT +select 50, 'abc' from dual +END +INPUT +select trim(leading NULL from 'kate') as "must_be_null"; +END +ERROR +syntax error at position 25 near 'NULL' +END +INPUT +select min(f4),max(f4) from t1; +END +OUTPUT +select min(f4), max(f4) from t1 +END +INPUT +select uncompress(a), uncompressed_length(a) from t1; +END +OUTPUT +select uncompress(a), uncompressed_length(a) from t1 +END +INPUT +select 1, ST_Intersects(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))')); +END +OUTPUT +select 1, ST_Intersects(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))')) from dual +END +INPUT +select substring_index('aaaaaaaaa1','aaa',2); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aaa', 2) from dual +END +INPUT +select now()-now(),weekday(curdate())-weekday(now()),unix_timestamp()-unix_timestamp(now()); +END +OUTPUT +select now() - now(), weekday(curdate()) - weekday(now()), unix_timestamp() - unix_timestamp(now()) from dual +END +INPUT +select insert('hello', -18446744073709551616, 1, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select sql_big_result trim(v),count(t) from t1 group by v order by v limit 10; +END +ERROR +syntax error at position 28 +END +INPUT +select count(distinct x.id_aams) into not_installed from (select from (select t1.id_aams, t2.* from t1 left join t2 on t2.code_id = vlt_code_id and t1.id_aams = t2.id_game where t1.id_aams = 1715000360 order by t2.id desc ) as g group by g.id_aams having g.id is null ) as x; +END +ERROR +syntax error at position 52 near 'not_installed' +END +INPUT +select "... and something more ..."; +END +OUTPUT +select '... and something more ...' from dual +END +INPUT +select from v1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select f1(), f2(); +END +OUTPUT +select f1(), f2() from dual +END +INPUT +select cast(-5 as unsigned) | 1, cast(-5 as unsigned) & -1; +END +OUTPUT +select convert(-5, unsigned) | 1, convert(-5, unsigned) & -1 from dual +END +INPUT +select 5 div 2.0; +END +OUTPUT +select 5 div 2.0 from dual +END +INPUT +select unix_timestamp('2039-01-20 01:00:00'); +END +OUTPUT +select unix_timestamp('2039-01-20 01:00:00') from dual +END +INPUT +select count(distinct a) from t1; +END +OUTPUT +select count(distinct a) from t1 +END +INPUT +select case 'str' when 'STR' then 'str' when null then 'null' end as c01, case 'str' when null then 'null' when 'STR' then 'str' end as c02, field(null, 'str1', 'str2') as c03, field('str1','STR1', null) as c04, field('str1', null, 'STR1') as c05, 'string' in ('STRING', null) as c08, 'string' in (null, 'STRING') as c09; +END +OUTPUT +select case 'str' when 'STR' then 'str' when null then 'null' end as c01, case 'str' when null then 'null' when 'STR' then 'str' end as c02, field(null, 'str1', 'str2') as c03, field('str1', 'STR1', null) as c04, field('str1', null, 'STR1') as c05, 'string' in ('STRING', null) as c08, 'string' in (null, 'STRING') as c09 from dual +END +INPUT +select @@sql_mode; +END +OUTPUT +select @@sql_mode from dual +END +INPUT +select /*1*/ user, host, db, info from information_schema.processlist where state = 'User lock' and info = 'select get_lock('test_bug16407', 60)'; +END +ERROR +syntax error at position 139 near 'test_bug16407' +END +INPUT +select from t1 where bigint_col='17666000000000000000'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select date_add(date,INTERVAL 1 DAY) from t1; +END +OUTPUT +select date_add(`date`, interval 1 DAY) from t1 +END +INPUT +select from t1 where word between binary 0xDF and binary 0xDF; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select left('hello', -4294967297); +END +OUTPUT +select left('hello', -4294967297) from dual +END +INPUT +select CASE "b" when "a" then 1 when "b" then 2 END; +END +OUTPUT +select case 'b' when 'a' then 1 when 'b' then 2 end from dual +END +INPUT +select @@global.profiling; +END +OUTPUT +select @@global.profiling from dual +END +INPUT +select a1,a2,b,min(c),max(c) from t2 where (c < 'k321') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t2 where c < 'k321' group by a1, a2, b +END +INPUT +select 1 /*!32301 +1 */; +END +OUTPUT +select 1 + 1 from dual +END +INPUT +select st_distance(ST_GeomFromText('geometrycollection(geometrycollection(),polygon((0 0,0 10,10 10,10 0,0 0)))'),ST_GeomFromText('point(100 100)')); +END +OUTPUT +select st_distance(ST_GeomFromText('geometrycollection(geometrycollection(),polygon((0 0,0 10,10 10,10 0,0 0)))'), ST_GeomFromText('point(100 100)')) from dual +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_polish_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_polish_ci +END +INPUT +select insert('hello', 18446744073709551617, 1, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select distinct n2 from t1; +END +OUTPUT +select distinct n2 from t1 +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_icelandic_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_icelandic_ci +END +INPUT +select from t1 where a = 0; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select _latin1'B' in (_latin1'a',_latin1'b'); +END +OUTPUT +select _latin1 'B' in (_latin1 'a', _latin1 'b') from dual +END +INPUT +select from t1 where word2=binary 0xDF; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select min(a2) from t1 group by a1; +END +OUTPUT +select min(a2) from t1 group by a1 +END +INPUT +select find_in_set("","a,b,c"),find_in_set("","a,b,c,"),find_in_set("",",a,b,c"); +END +OUTPUT +select find_in_set('', 'a,b,c'), find_in_set('', 'a,b,c,'), find_in_set('', ',a,b,c') from dual +END +INPUT +select ''; +END +OUTPUT +select '' from dual +END +INPUT +select concat('0',mid(@my_uuid,16,3),mid(@my_uuid,10,4),left(@my_uuid,8)) into @my_uuidate; +END +ERROR +syntax error at position 91 near 'my_uuidate' +END +INPUT +select locate('he','hello',null),locate('he',null,2),locate(null,'hello',2); +END +OUTPUT +select locate('he', 'hello', null), locate('he', null, 2), locate(null, 'hello', 2) from dual +END +INPUT +select CASE BINARY "b" when "a" then 1 when "B" then 2 WHEN "b" then "ok" END; +END +OUTPUT +select case binary 'b' when 'a' then 1 when 'B' then 2 when 'b' then 'ok' end from dual +END +INPUT +select space(4294967297); +END +OUTPUT +select space(4294967297) from dual +END +INPUT +select st_crosses(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_crosses(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select from v1c; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t4 order by a,b; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a1,a2,b,min(c),max(c) from t2 where a1 >= 'b' group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t2 where a1 >= 'b' group by a1, a2, b +END +INPUT +select substring_index('aaaaaaaaa1','aa',5); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aa', 5) from dual +END +INPUT +select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A' COLLATE koi8r_bin); +END +ERROR +syntax error at position 32 near 'COLLATE' +END +INPUT +select from t1 union distinct select from t2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(soundex(_ucs2 0x00BF00C0)); +END +ERROR +syntax error at position 36 near '0x00BF00C0' +END +INPUT +select insert('hello', -4294967297, 1, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select from (t3 cross join t4) natural join t1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select format(cast(-2 as unsigned), 2), format(18446744073709551614, 2), format(-2, 2); +END +OUTPUT +select format(convert(-2, unsigned), 2), format(18446744073709551614, 2), format(-2, 2) from dual +END +INPUT +select max(7) from t1m; +END +OUTPUT +select max(7) from t1m +END +INPUT +select collation(insert(_latin2'abcd',2,3,_latin2'ef')), coercibility(insert(_latin2'abcd',2,3,_latin2'ef')); +END +ERROR +syntax error at position 24 near 'insert' +END +INPUT +select grp, group_concat(a separator "")+0 from t1 group by grp; +END +OUTPUT +select grp, group_concat(a separator '') + 0 from t1 group by grp +END +INPUT +select FIND_IN_SET(_latin1'B',_latin1'a,b,c,d' COLLATE latin1_bin); +END +OUTPUT +select FIND_IN_SET(_latin1 'B', _latin1 'a,b,c,d' collate latin1_bin) from dual +END +INPUT +select t1.id, avg(rating) from t1 left join t2 on ( t1.id = t2.id ) group by t1.id; +END +OUTPUT +select t1.id, avg(rating) from t1 left join t2 on t1.id = t2.id group by t1.id +END +INPUT +select column_name, column_default from columns where table_schema='test' and table_name='t1'; +END +OUTPUT +select column_name, column_default from `columns` where table_schema = 'test' and table_name = 't1' +END +INPUT +select trim(trailing 'foo' from 'foo'); +END +ERROR +syntax error at position 32 near 'from' +END +INPUT +select from (t1 natural join t2) natural left join (t3 natural join t4); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select max_data_length into @orig_max_data_length from information_schema.tables where table_name='t1'; +END +ERROR +syntax error at position 50 near 'orig_max_data_length' +END +INPUT +select hex(substr(_utf16 0x00e400e50068,-3)); +END +ERROR +syntax error at position 40 near '0x00e400e50068' +END +INPUT +select collation(conv(130,16,10)), coercibility(conv(130,16,10)); +END +OUTPUT +select collation(conv(130, 16, 10)), coercibility(conv(130, 16, 10)) from dual +END +INPUT +select from mysqldump_dbb.v1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where match a against ("+(+aaa* +bbb1*)" in boolean mode); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where isnull(to_days(mydate)); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(distinct i) from v1; +END +OUTPUT +select count(distinct i) from v1 +END +INPUT +select null,isnull(null),isnull(1/0),isnull(1/0 = null),ifnull(null,1),ifnull(null,"TRUE"),ifnull("TRUE","ERROR"),1/0 is null,1 is not null; +END +OUTPUT +select null, isnull(null), isnull(1 / 0), isnull(1 / 0 = null), ifnull(null, 1), ifnull(null, 'TRUE'), ifnull('TRUE', 'ERROR'), 1 / 0 is null, 1 is not null from dual +END +INPUT +select format(4.55, 1), format(4.551, 1); +END +OUTPUT +select format(4.55, 1), format(4.551, 1) from dual +END +INPUT +select timestampdiff(month,'2004-02-29','2005-02-28'); +END +OUTPUT +select timestampdiff(month, '2004-02-29', '2005-02-28') from dual +END +INPUT +select extract(MONTH FROM "2001-02-00"); +END +ERROR +syntax error at position 26 near 'FROM' +END +INPUT +select t1.col1 from t1 where t1.col2 in (select t2.col2 from t2 group by t2.col1, t2.col2 having t1.col1 <= 10); +END +OUTPUT +select t1.col1 from t1 where t1.col2 in (select t2.col2 from t2 group by t2.col1, t2.col2 having t1.col1 <= 10) +END +INPUT +select from t1 where match a against('ab c' in boolean mode); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select @ujis2 = CONVERT(@utf82 USING ujis); +END +OUTPUT +select @ujis2 = convert(@utf82 using ujis) from dual +END +INPUT +select (with dt as (select t1.a as a, t2.a as b from t2) select dt2.a from dt dt1, dt dt2 where dt1.b=t1.a and dt2.b=dt1.b) as subq from t1; +END +ERROR +syntax error at position 13 near 'with' +END +INPUT +select count(*), case interval(qty,2,3,4,5,6,7,8) when -1 then NULL when 0 then "zero" when 1 then "one" when 2 then "two" end as category from t1 group by category; +END +ERROR +syntax error at position 55 near 'when' +END +INPUT +select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1"; +END +OUTPUT +select table_priv, column_priv from mysql.tables_priv where `user` = 'mysqltest_1' +END +INPUT +select position('bb' in 'abba'); +END +ERROR +syntax error at position 31 near 'abba' +END +INPUT +select min(7) from t1m; +END +OUTPUT +select min(7) from t1m +END +INPUT +select _cp866'aaaaaaaaa' like _cp866'%aaaa%' collate cp866_bin; +END +ERROR +syntax error at position 30 near 'like' +END +INPUT +select position("0" in "baaa" in (1)),position("0" in "1" in (1,2,3)),position("sql" in ("mysql")); +END +ERROR +syntax error at position 30 near 'baaa' +END +INPUT +select count(*) from t1 where a = 'aaayyy'; +END +OUTPUT +select count(*) from t1 where a = 'aaayyy' +END +INPUT +select sum(num) from t1 group by user; +END +OUTPUT +select sum(num) from t1 group by `user` +END +INPUT +select a from t1 where a > 3 order by a; +END +OUTPUT +select a from t1 where a > 3 order by a asc +END +INPUT +select t1.*, a as 'x' from t1; +END +OUTPUT +select t1.*, a as x from t1 +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_romanian_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_romanian_ci +END +INPUT +select round(15000111000111000155,-1); +END +OUTPUT +select round(15000111000111000155, -1) from dual +END +INPUT +select yearweek("2000-01-01",0) as '2000', yearweek("2001-01-01",0) as '2001', yearweek("2002-01-01",0) as '2002',yearweek("2003-01-01",0) as '2003', yearweek("2004-01-01",0) as '2004', yearweek("2005-01-01",0) as '2005', yearweek("2006-01-01",0) as '2006'; +END +OUTPUT +select yearweek('2000-01-01', 0) as `2000`, yearweek('2001-01-01', 0) as `2001`, yearweek('2002-01-01', 0) as `2002`, yearweek('2003-01-01', 0) as `2003`, yearweek('2004-01-01', 0) as `2004`, yearweek('2005-01-01', 0) as `2005`, yearweek('2006-01-01', 0) as `2006` from dual +END +INPUT +select fld3 from t2; +END +OUTPUT +select fld3 from t2 +END +INPUT +select distinct(a1) from t1 where ord(a2) = 98; +END +OUTPUT +select distinct a1 from t1 where ord(a2) = 98 +END +INPUT +select count(*) FROM t3; +END +OUTPUT +select count(*) from t3 +END +INPUT +select benchmark(0, NULL); +END +OUTPUT +select benchmark(0, null) from dual +END +INPUT +select sql_big_result spid,sum(userid) from t1 group by spid order by spid desc; +END +OUTPUT +select `sql_big_result` as spid, sum(userid) from t1 group by spid order by spid desc +END +INPUT +select from t1 where f1='test' and (f2= md5("test") or f2= md5("TEST")); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*) from t1 /bin /boot /cdrom /dev /etc /home /lib /lib32 /lib64 /libx32 /lost+found /media /mnt /opt /proc /root /run /sbin /snap /srv /swapfile /sys /tmp /usr /var must be 0 */; +END +ERROR +syntax error at position 26 +END +INPUT +select std(s1/s2) from bug22555 group by i; +END +OUTPUT +select std(s1 / s2) from bug22555 group by i +END +INPUT +select ceiling(5.5),ceiling(-5.5); +END +OUTPUT +select ceiling(5.5), ceiling(-5.5) from dual +END +INPUT +select hex(convert(0xFF using utf8)); +END +OUTPUT +select hex(convert(0xFF using utf8)) from dual +END +INPUT +select from t1, t3 where t1.start between t3.ctime1 and t3.ctime2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select substring_index('the king of the.the hill','the',-2); +END +OUTPUT +select substring_index('the king of the.the hill', 'the', -2) from dual +END +INPUT +select @@table_type='MyISAM'; +END +OUTPUT +select @@table_type = 'MyISAM' from dual +END +INPUT +select cast(sum(distinct ff) as signed) from t2; +END +OUTPUT +select convert(sum(distinct ff), signed) from t2 +END +INPUT +select substring_index(null,null,3); +END +OUTPUT +select substring_index(null, null, 3) from dual +END +INPUT +select a1,a2,b,min(c),max(c) from t1 where (c < 'c5') or (c = 'g412') or (c = 'k421') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 where c < 'c5' or c = 'g412' or c = 'k421' group by a1, a2, b +END +INPUT +select s1 from t1 where s1 in (select version from information_schema.tables) union select version from information_schema.tables; +END +OUTPUT +(select s1 from t1 where s1 in (select version from information_schema.`tables`)) union (select version from information_schema.`tables`) +END +INPUT +select from t1 where a='a'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select concat(_latin1'a',_latin2'a'); +END +OUTPUT +select concat(_latin1 'a', _latin2 as a) from dual +END +INPUT +select find_in_set("b","a,b,c"),find_in_set("c","a,b,c"),find_in_set("dd","a,bbb,dd"),find_in_set("bbb","a,bbb,dd"); +END +OUTPUT +select find_in_set('b', 'a,b,c'), find_in_set('c', 'a,b,c'), find_in_set('dd', 'a,bbb,dd'), find_in_set('bbb', 'a,bbb,dd') from dual +END +INPUT +select fld3 FROM t2 where fld3 like "%cultivation"; +END +OUTPUT +select fld3 from t2 where fld3 like '%cultivation' +END +INPUT +select length(format('nan', 2)) > 0; +END +OUTPUT +select length(format('nan', 2)) > 0 from dual +END +INPUT +select concat(a1,min(c)),b from t1 where a1 < 'd' group by a1,a2,b; +END +OUTPUT +select concat(a1, min(c)), b from t1 where a1 < 'd' group by a1, a2, b +END +INPUT +select timestampdiff(MONTH, '2000-03-28', '2000-02-29') as a; +END +OUTPUT +select timestampdiff(MONTH, '2000-03-28', '2000-02-29') as a from dual +END +INPUT +select concat(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci); +END +ERROR +syntax error at position 55 near 'collate' +END +INPUT +select hex(substr(_utf16 0x00e400e5D800DC00,2)); +END +ERROR +syntax error at position 44 near '0x00e400e5D800DC00' +END +INPUT +select week("2000-01-01",0) as '2000', week("2001-01-01",0) as '2001', week("2002-01-01",0) as '2002',week("2003-01-01",0) as '2003', week("2004-01-01",0) as '2004', week("2005-01-01",0) as '2005', week("2006-01-01",0) as '2006'; +END +OUTPUT +select week('2000-01-01', 0) as `2000`, week('2001-01-01', 0) as `2001`, week('2002-01-01', 0) as `2002`, week('2003-01-01', 0) as `2003`, week('2004-01-01', 0) as `2004`, week('2005-01-01', 0) as `2005`, week('2006-01-01', 0) as `2006` from dual +END +INPUT +select from (t1 natural join t2), (t3 natural join t4); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*) from t3 where id3 > 95; +END +OUTPUT +select count(*) from t3 where id3 > 95 +END +INPUT +select st_intersects(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_intersects(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select from t1 where id=000000000001; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +END +OUTPUT +select a, count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a +END +INPUT +select a1,a2,b,min(c),max(c) from t2 where (c < 'a0') or (c > 'b1') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t2 where c < 'a0' or c > 'b1' group by a1, a2, b +END +INPUT +select from t1 natural left join t2 where (t2.i is not null)=0; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1; +END +ERROR +syntax error at position 34 near 'between' +END +INPUT +select from (t1 join t2 on t1.b=t2.b) natural join (t3 natural join t4); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select round(999999999.0, -9); +END +OUTPUT +select round(999999999.0, -9) from dual +END +INPUT +select table_name, table_type, auto_increment, table_comment from information_schema.tables where table_schema='test' and table_name='t2'; +END +OUTPUT +select table_name, table_type, `auto_increment`, table_comment from information_schema.`tables` where table_schema = 'test' and table_name = 't2' +END +INPUT +select vq1.b,dt.b from v1 vq1, lateral (select vq1.b) dt; +END +ERROR +syntax error at position 41 +END +INPUT +select right('hello', -1); +END +OUTPUT +select right('hello', -1) from dual +END +INPUT +select index_name from information_schema.statistics where table_schema='test' order by index_name; +END +OUTPUT +select index_name from information_schema.statistics where table_schema = 'test' order by index_name asc +END +INPUT +select (select from (select from (select t1.a from t2) as dt limit 1) dt2) from t1; +END +ERROR +syntax error at position 20 near 'from' +END +INPUT +select substring_index('the king of the the hill',' the ',-2); +END +OUTPUT +select substring_index('the king of the the hill', ' the ', -2) from dual +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_roman_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_roman_ci +END +INPUT +select distinct a1,a2,b from t1; +END +OUTPUT +select distinct a1, a2, b from t1 +END +INPUT +select from t1 where city = 'Durban'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select CAST(0xb3 as signed); +END +OUTPUT +select convert(0xb3, signed) from dual +END +INPUT +select 'a' union select concat('a', -'3'); +END +OUTPUT +(select 'a' from dual) union (select concat('a', -'3') from dual) +END +INPUT +select st_crosses(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_crosses(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin2'd',2); +END +OUTPUT +select SUBSTRING_INDEX(_latin1 'abcdabcdabcd', _latin2 as d, 2) from dual +END +INPUT +select from t1 where tt like 'AA%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select repeat('hello', -4294967295); +END +OUTPUT +select repeat('hello', -4294967295) from dual +END +INPUT +select from (t3 natural join t4) natural join (t1 join t2 on t1.b=t2.b); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(c1) as h, c1 from t1 order by c1, h; +END +OUTPUT +select hex(c1) as h, c1 from t1 order by c1 asc, h asc +END +INPUT +select s1*0 from t1 group by s1 having s1 = 0; +END +OUTPUT +select s1 * 0 from t1 group by s1 having s1 = 0 +END +INPUT +select from t1 where not((a < 5 and a < 10) and (not(a > 16) or a > 17)); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where MATCH a,b AGAINST ('"text search" "now support"' IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select insert('hello', 1, -18446744073709551616, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select substring_index('aaaaaaaaa1','aaa',-1); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aaa', -1) from dual +END +INPUT +select a1,a2,b from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b; +END +OUTPUT +select a1, a2, b from t1 where (a1 >= 'c' or a2 < 'b') and b > 'a' group by a1, a2, b +END +INPUT +select st_distance(linestring(point(26,87),point(13,95)), geometrycollection(point(4.297374e+307,8.433875e+307))) as dist; +END +OUTPUT +select st_distance(linestring(point(26, 87), point(13, 95)), geometrycollection(point(4.297374e+307, 8.433875e+307))) as dist from dual +END +INPUT +select count(not_existing_database.t1.a) from not_existing_database.t1; +END +OUTPUT +select count(not_existing_database.t1.a) from not_existing_database.t1 +END +INPUT +select lpad('hello', -18446744073709551616, '1'); +END +OUTPUT +select lpad('hello', -18446744073709551616, '1') from dual +END +INPUT +select c1 from t1 order by c1 limit 1; +END +OUTPUT +select c1 from t1 order by c1 asc limit 1 +END +INPUT +select unix_timestamp('2038-01-17 12:00:00'); +END +OUTPUT +select unix_timestamp('2038-01-17 12:00:00') from dual +END +INPUT +select extract(MONTH FROM "0000-00-00"),extract(MONTH FROM d),extract(MONTH FROM dt),extract(MONTH FROM t),extract(MONTH FROM c) from t1; +END +ERROR +syntax error at position 26 near 'FROM' +END +INPUT +select from t3 where a < 10; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 1, ST_Within(ST_GeomFromText('POLYGON((1 1,20 10,10 30, 1 1))'), ST_GeomFromText('POLYGON((0 0,30 5,10 40, 0 0))')); +END +OUTPUT +select 1, ST_Within(ST_GeomFromText('POLYGON((1 1,20 10,10 30, 1 1))'), ST_GeomFromText('POLYGON((0 0,30 5,10 40, 0 0))')) from dual +END +INPUT +select hex(substr(_utf16 0x00e400e50068,-2)); +END +ERROR +syntax error at position 40 near '0x00e400e50068' +END +INPUT +select st_touches(ST_GeomFromText('polygon((0 0, 2 2, 0 4, 0 0))'), ST_GeomFromText('point(1 2)')); +END +OUTPUT +select st_touches(ST_GeomFromText('polygon((0 0, 2 2, 0 4, 0 0))'), ST_GeomFromText('point(1 2)')) from dual +END +INPUT +select a1,a2,b, max(c) from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c) from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and a2 > 'a' group by a1, a2, b +END +INPUT +select i from t2; +END +OUTPUT +select i from t2 +END +INPUT +select yearweek('1981-12-31',1),yearweek('1982-01-01',1),yearweek('1982-12-31',1),yearweek('1983-01-01',1); +END +OUTPUT +select yearweek('1981-12-31', 1), yearweek('1982-01-01', 1), yearweek('1982-12-31', 1), yearweek('1983-01-01', 1) from dual +END +INPUT +select from t5 order by b,a limit 3,3; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select mod(12, 0.0) as 'NULL'; +END +OUTPUT +select mod(12, 0.0) as `NULL` from dual +END +INPUT +select 3 from t1; +END +OUTPUT +select 3 from t1 +END +INPUT +select count(*) from t3 where id3 > 5; +END +OUTPUT +select count(*) from t3 where id3 > 5 +END +INPUT +select date_sub("0169-01-01 00:00:01",INTERVAL 2 SECOND); +END +OUTPUT +select date_sub('0169-01-01 00:00:01', interval 2 SECOND) from dual +END +INPUT +select timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002"); +END +OUTPUT +select timediff('1997-12-31 23:59:59.000001', '1997-12-30 01:01:01.000002') from dual +END +INPUT +select from t1 where NULL or not(a < 15 and a > 5); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select ST_GeomFromText("POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))") into @a; +END +ERROR +syntax error at position 73 near 'a' +END +INPUT +select 'a' union select concat('a', -concat('3',4)); +END +OUTPUT +(select 'a' from dual) union (select concat('a', -concat('3', 4)) from dual) +END +INPUT +select t1.*,t2.* from t1 natural join t2; +END +OUTPUT +select t1.*, t2.* from t1 natural join t2 +END +INPUT +select from INFORMATION_SCHEMA.COLUMN_PRIVILEGES WHERE table_schema != 'sys'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select aes_decrypt(aes_encrypt('abc','1'),'1'); +END +OUTPUT +select aes_decrypt(aes_encrypt('abc', '1'), '1') from dual +END +INPUT +select ST_astext(st_union(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))); +END +OUTPUT +select ST_astext(st_union(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))) from dual +END +INPUT +select column_type from information_schema.columns where table_schema="information_schema" and table_name="COLUMNS" and (column_name="character_set_name" or column_name="collation_name"); +END +OUTPUT +select column_type from information_schema.`columns` where table_schema = 'information_schema' and table_name = 'COLUMNS' and (column_name = 'character_set_name' or column_name = 'collation_name') +END +INPUT +select concat(a, if(b>10, _utf8'x', _utf8'y')) from t1; +END +OUTPUT +select concat(a, if(b > 10, _utf8 'x', _utf8 'y')) from t1 +END +INPUT +select /lib32/ /libx32/ user, host, db, info from information_schema.processlist where state = 'User lock' and info = 'select get_lock('ee_16407_2', 60)'; +END +ERROR +syntax error at position 9 +END +INPUT +select insert('hello', 1, 4294967296, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select charset(a) from t3; +END +OUTPUT +select charset(a) from t3 +END +INPUT +select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a'); +END +OUTPUT +select count(distinct a1, a2, b) from t1 where a2 >= 'b' and b = 'a' +END +INPUT +select st_intersects(@a, @l); +END +OUTPUT +select st_intersects(@a, @l) from dual +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_czech_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_czech_ci +END +INPUT +select min(big),max(big),max(big)-1 from t1; +END +OUTPUT +select min(big), max(big), max(big) - 1 from t1 +END +INPUT +select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678"), unhex(NULL); +END +OUTPUT +select unhex(hex('foobar')), hex(unhex('1234567890ABCDEF')), unhex('345678'), unhex(null) from dual +END +INPUT +select from performance_schema.global_variables where variable_name='init_connect'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select t1.a from MYSQLTEST.T1; +END +OUTPUT +select t1.a from MYSQLTEST.T1 +END +INPUT +select convert("123" using binary); +END +OUTPUT +select convert('123' using binary) from dual +END +INPUT +select t2.fld3 FROM t2 where companynr = 58 and fld3 like "%imaginable%"; +END +OUTPUT +select t2.fld3 from t2 where companynr = 58 and fld3 like '%imaginable%' +END +INPUT +select -1 | 0, -1 ^ 0, -1 & 0; +END +OUTPUT +select -1 | 0, -1 ^ 0, -1 & 0 from dual +END +INPUT +select -1 >> 1, -1 << 1; +END +OUTPUT +select -1 >> 1, -1 << 1 from dual +END +INPUT +select a,b,c from (t1 natural join t2) natural join (t3 natural join t4) where b + 1 = y or b + 10 = y group by b,c,a having min(b) < max(y) order by a; +END +OUTPUT +select a, b, c from (t1 natural join t2) natural join (t3 natural join t4) where b + 1 = y or b + 10 = y group by b, c, a having min(b) < max(y) order by a asc +END +INPUT +select benchmark(100, (select 1, 1)); +END +OUTPUT +select benchmark(100, (select 1, 1 from dual)) from dual +END +INPUT +select find_in_set(binary 'a', 'A,B,C'); +END +OUTPUT +select find_in_set(binary 'a', 'A,B,C') from dual +END +INPUT +select INTERVAL 1 DAY + "1997-12-31"; +END +OUTPUT +select interval 1 DAY + '1997-12-31' from dual +END +INPUT +select from t1 where t1 like "a_%"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select cast(1-pow(2,63) as signed) as qq; +END +OUTPUT +select convert(1 - pow(2, 63), signed) as qq from dual +END +INPUT +select 1 + /*!00000 2 node_modules/ + 3 /*!99999 noise*/ + 4; +END +ERROR +syntax error at position 57 +END +INPUT +select 1, st_touches(t.geom, p.geom) from tbl_polygon t, tbl_polygon p where t.id = 'POLY1' and p.id = 'POLY2'; +END +OUTPUT +select 1, st_touches(t.geom, p.geom) from tbl_polygon as t, tbl_polygon as p where t.id = 'POLY1' and p.id = 'POLY2' +END +INPUT +select collation_name, character_set_name, id from information_schema.collations where id>256 order by id; +END +OUTPUT +select collation_name, character_set_name, id from information_schema.collations where id > 256 order by id asc +END +INPUT +select 1 union select 1; +END +OUTPUT +(select 1 from dual) union (select 1 from dual) +END +INPUT +select distinct n1,s from t1; +END +OUTPUT +select distinct n1, s from t1 +END +INPUT +select period from t1; +END +OUTPUT +select period from t1 +END +INPUT +select event_name from information_schema.events; +END +OUTPUT +select event_name from information_schema.events +END +INPUT +select round(std(e1/e2), 17) from bug22555; +END +OUTPUT +select round(std(e1 / e2), 17) from bug22555 +END +INPUT +select user_host, db, sql_text from mysql.slow_log where sql_text like 'select 'events_logs_test'%'; +END +ERROR +syntax error at position 97 near 'events_logs_test' +END +INPUT +select ifnull(A=1, 'N') as A, ifnull(B=1, 'N') as B, ifnull(not (A=1), 'N') as nA, ifnull(not (B=1), 'N') as nB, ifnull((A=1) and (B=1), 'N') as AB, ifnull(not ((A=1) and (B=1)), 'N') as `n(AB)`, ifnull((not (A=1) or not (B=1)), 'N') as nAonB, ifnull((A=1) or (B=1), 'N') as AoB, ifnull(not((A=1) or (B=1)), 'N') as `n(AoB)`, ifnull(not (A=1) and not (B=1), 'N') as nAnB from t1; +END +OUTPUT +select ifnull(A = 1, 'N') as A, ifnull(B = 1, 'N') as B, ifnull(not A = 1, 'N') as nA, ifnull(not B = 1, 'N') as nB, ifnull(A = 1 and B = 1, 'N') as AB, ifnull(not (A = 1 and B = 1), 'N') as `n(AB)`, ifnull(not A = 1 or not B = 1, 'N') as nAonB, ifnull(A = 1 or B = 1, 'N') as AoB, ifnull(not (A = 1 or B = 1), 'N') as `n(AoB)`, ifnull(not A = 1 and not B = 1, 'N') as nAnB from t1 +END +INPUT +select from (select polygon(t1.a) as p from t1 order by t1.a) d; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where a = 'b'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(@utf83); +END +OUTPUT +select hex(@utf83) from dual +END +INPUT +select length(repeat("1",1024*1024)) as a; +END +OUTPUT +select length(repeat('1', 1024 * 1024)) as a from dual +END +INPUT +select locate('HE','hello' collate utf8_bin,2); +END +OUTPUT +select locate('HE', 'hello' collate utf8_bin, 2) from dual +END +INPUT +select ctime from t1 where extract(MONTH FROM ctime) = 1 AND extract(YEAR FROM ctime) = 2001; +END +ERROR +syntax error at position 46 near 'FROM' +END +INPUT +select cast(_koi8r'��' AS nchar) as c1, cast(_koi8r'� ' AS nchar) as c2, cast(_koi8r'���' AS nchar(2)) as c3, cast(_koi8r'� ' AS nchar(2)) as c4, cast(_koi8r'�' AS nchar(2)) as c5; +END +ERROR +syntax error at position 27 near '��' +END +INPUT +select date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour); +END +OUTPUT +select date_add(convert('2004-12-30 12:00:00', date), interval 0 hour) from dual +END +INPUT +select c as c_all from t1 order by c; +END +OUTPUT +select c as c_all from t1 order by c asc +END +INPUT +select foofct("call 2"); +END +OUTPUT +select foofct('call 2') from dual +END +INPUT +select benchmark((select 10 from dual), pi()); +END +OUTPUT +select benchmark((select 10 from dual), pi()) from dual +END +INPUT +select from t6 natural join ((t1 natural join t2), (t3 natural join t4)); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select ST_astext(g) from t1 where ST_Contains(ST_GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'), g); +END +OUTPUT +select ST_astext(g) from t1 where ST_Contains(ST_GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'), g) +END +INPUT +select timestamp("2001-12-01", "25:01:01"); +END +OUTPUT +select timestamp('2001-12-01', '25:01:01') from dual +END +INPUT +select if (query_time >= '00:01:40', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log where sql_text = 'select get_lock('bug27638', 101)'; +END +ERROR +syntax error at position 132 near 'bug27638' +END +INPUT +select from_unixtime(-1); +END +OUTPUT +select from_unixtime(-1) from dual +END +INPUT +select hex(conv(convert('123' using utf16), -10, 16)); +END +OUTPUT +select hex(conv(convert('123' using utf16), -10, 16)) from dual +END +INPUT +select count(*) from t2 where id2 > 95; +END +OUTPUT +select count(*) from t2 where id2 > 95 +END +INPUT +select t1.* as 'with_alias', t1.* from t1; +END +ERROR +syntax error at position 15 near 'as' +END +INPUT +select count(*) from t1 where i=2 or i is null; +END +OUTPUT +select count(*) from t1 where i = 2 or i is null +END +INPUT +select truncate(-5000111000111000155,-1); +END +OUTPUT +select truncate(-5000111000111000155, -1) from dual +END +INPUT +select (@orig_max_data_length > @changed_max_data_length); +END +OUTPUT +select @orig_max_data_length > @changed_max_data_length from dual +END +INPUT +select ST_astext(ST_Intersection(ST_geometryfromtext('point(1 1)'), ST_geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))'))); +END +OUTPUT +select ST_astext(ST_Intersection(ST_geometryfromtext('point(1 1)'), ST_geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))'))) from dual +END +INPUT +select (select d from t2 where d > a) as 'x', t1.* from t1; +END +OUTPUT +select (select d from t2 where d > a) as x, t1.* from t1 +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_esperanto_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_esperanto_ci +END +INPUT +select mail_id, if(folder.f_description!='', folder.f_description, folder.f_name) as folder_name, date, address_id, phrase, address, subject from folder, (select mail.mail_id as mail_id, date_format(mail.h_date, '%b %e, %Y %h:%i') as date, mail.folder_id, sender.address_id as address_id, sender.phrase as phrase, sender.address as address, mail.h_subject as subject from mail left join mxa as mxa_sender on mail.mail_id=mxa_sender.mail_id and mxa_sender.type='from' left join address as sender on mxa_sender.address_id=sender.address_id mxa as mxa_recipient, address as recipient, where 1 and mail.mail_id=mxa_recipient.mail_id and mxa_recipient.address_id=recipient.address_id and mxa_recipient.type='to' and match(sender.phrase, sender.address, sender.comment) against ('jeremy' in boolean mode) and match(recipient.phrase, recipient.address, recipient.comment) against ('monty' in boolean mode) order by mail.h_date desc limit 0, 25 ) as query where query.folder_id=folder.folder_id; +END +ERROR +syntax error at position 542 near 'mxa' +END +INPUT +select (with recursive dt as (select t1.a as a union select a+1 from dt where a<10) select dt1.a from dt dt1 where dt1.a=t1.a ) as subq from t1; +END +ERROR +syntax error at position 13 near 'with' +END +INPUT +select from t5 natural join ((t1 natural join t2), (t3 natural join t4)); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*) FROM t4; +END +OUTPUT +select count(*) from t4 +END +INPUT +select from (t4 natural right join t3) natural right join (t2 natural right join t1); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a1,a2,b,min(c),max(c) from t1 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1, a2, b +END +INPUT +select charset(a), collation(a), coercibility(a) from t1; +END +OUTPUT +select charset(a), collation(a), coercibility(a) from t1 +END +INPUT +select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c'); +END +OUTPUT +select distinct a1, a2, b from t2 where a1 > 'a' and a2 > 'a' and b = 'c' +END +INPUT +select qn.a from (select 1 as a) as QN; +END +OUTPUT +select qn.a from (select 1 as a from dual) as QN +END +INPUT +select a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b; +END +OUTPUT +select a1, a2, b from t1 where a1 > 'a' and a2 > 'a' and b = 'c' group by a1, a2, b +END +INPUT +select hex(s1), hex(s2) from t1; +END +OUTPUT +select hex(s1), hex(s2) from t1 +END +INPUT +select grp,group_concat(c order by c desc separator ",") from t1 group by grp; +END +OUTPUT +select grp, group_concat(c order by c desc separator ',') from t1 group by grp +END +INPUT +select t1.a, f from t1, lateral (select max(t1.a) as f) as dt; +END +ERROR +syntax error at position 34 +END +INPUT +select 2 -9223372036854775808 as result; +END +OUTPUT +select 2 - 9223372036854775808 as result from dual +END +INPUT +select "a" like "%%b","a" like "%%ab","ab" like "a%", "ab" like "_", "ab" like "ab_", "abc" like "%_d", "abc" like "abc%d"; +END +OUTPUT +select 'a' like '%%b', 'a' like '%%ab', 'ab' like 'a%', 'ab' like '_', 'ab' like 'ab_', 'abc' like '%_d', 'abc' like 'abc%d' from dual +END +INPUT +select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL; +END +OUTPUT +select 1 xor 1, 1 xor 0, 0 xor 1, 0 xor 0, null xor 1, 1 xor null, 0 xor null from dual +END +INPUT +select dayofyear("0000-00-00"),dayofyear(d),dayofyear(dt),dayofyear(t),dayofyear(c) from t1; +END +OUTPUT +select dayofyear('0000-00-00'), dayofyear(d), dayofyear(dt), dayofyear(t), dayofyear(c) from t1 +END +INPUT +select null % 12 as 'NULL'; +END +OUTPUT +select null % 12 as `NULL` from dual +END +INPUT +select insert(null,2,1,'hi'),insert('txs',null,1,'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select date_add("1997-12-31",INTERVAL 1 DAY); +END +OUTPUT +select date_add('1997-12-31', interval 1 DAY) from dual +END +INPUT +select mbrwithin(ST_GeomFromText("linestring(1 0, 2 0)"), ST_GeomFromText("polygon((0 0, 3 0, 3 3, 0 3, 0 0))")); +END +OUTPUT +select mbrwithin(ST_GeomFromText('linestring(1 0, 2 0)'), ST_GeomFromText('polygon((0 0, 3 0, 3 3, 0 3, 0 0))')) from dual +END +INPUT +select ST_astext(ST_convexhull(ST_PolyFromWKB(ST_AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(1, 0), Point(0, 0))))))); +END +OUTPUT +select ST_astext(ST_convexhull(ST_PolyFromWKB(ST_AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(1, 0), Point(0, 0))))))) from dual +END +INPUT +select from t1 where i between 2 and 4 and v in ('def','3r4f','abc'); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a,c,sum(a) from t1 group by a; +END +OUTPUT +select a, c, sum(a) from t1 group by a +END +INPUT +select t1.*,t2.* from t1 left join t2 on (t1.a=t2.a) where t2.id=3; +END +OUTPUT +select t1.*, t2.* from t1 left join t2 on t1.a = t2.a where t2.id = 3 +END +INPUT +select from information_schema.key_column_usage where TABLE_SCHEMA= "test" order by constraint_name; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select ST_Length(ST_MLineFromWKB(0x0000000005000000020000000002000000035FB317E5EF3AB327E3A4B378469B67320000000000000000C0240000000000003FF05FD8ADAB9F560000000000000000000000000200000003000000000000000000000000000000000000000000000000BFF08B439581062540240000000000004341C37937E08000)) as length; +END +OUTPUT +select ST_Length(ST_MLineFromWKB(0x0000000005000000020000000002000000035FB317E5EF3AB327E3A4B378469B67320000000000000000C0240000000000003FF05FD8ADAB9F560000000000000000000000000200000003000000000000000000000000000000000000000000000000BFF08B439581062540240000000000004341C37937E08000)) as length from dual +END +INPUT +select host,db,user,select_priv,insert_priv from mysql.db where db="mysqltest1"; +END +OUTPUT +select host, db, `user`, select_priv, insert_priv from mysql.db where db = 'mysqltest1' +END +INPUT +select grp,group_concat(c separator ",") from t1 group by grp; +END +OUTPUT +select grp, group_concat(c separator ',') from t1 group by grp +END +INPUT +select 12%2 as '0'; +END +OUTPUT +select 12 % 2 as `0` from dual +END +INPUT +select from t1 where match (a) against ('aaaa'); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select date_sub("1998-01-01 00:00:00",INTERVAL "1:1" DAY_HOUR); +END +OUTPUT +select date_sub('1998-01-01 00:00:00', interval '1:1' DAY_HOUR) from dual +END +INPUT +select bin(convert(-9223372036854775808 using ucs2)); +END +OUTPUT +select bin(convert(-9223372036854775808 using ucs2)) from dual +END +INPUT +select date_add(date,INTERVAL "1:1:1" HOUR_SECOND) from t1; +END +OUTPUT +select date_add(`date`, interval '1:1:1' HOUR_SECOND) from t1 +END +INPUT +select from t1 where a <> _latin1 'B' collate latin1_bin; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select b from t1 where binary b like ''; +END +OUTPUT +select b from t1 where binary b like '' +END +INPUT +select from t1 where str='str'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select '?' like '|%', '?' like '|%' ESCAPE '|', '%' like '|%', '%' like '|%' ESCAPE '|', '%' like '%'; +END +OUTPUT +select '?' like '|%', '?' like '|%' escape '|', '%' like '|%', '%' like '|%' escape '|', '%' like '%' from dual +END +INPUT +select a from t1 where right(a+0,6) = ( right(20040106123400,6) ); +END +OUTPUT +select a from t1 where right(a + 0, 6) = right(20040106123400, 6) +END +INPUT +select t1.*, t2.* from t1 left join t2 on t1.n = t2.n and t1.m = t2.m where t1.n = 1; +END +OUTPUT +select t1.*, t2.* from t1 left join t2 on t1.n = t2.n and t1.m = t2.m where t1.n = 1 +END +INPUT +select from t1 where ((a between 5 and 15) and (not(a like 10))); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select t1.a, dt.a from t1, lateral (select t2.a as a from t2 having t1.a) dt; +END +ERROR +syntax error at position 37 +END +INPUT +select distinct t1.project_id as project_id, t1.project_name as project_name, t1.client_ptr as client_ptr, t1.comments as comments, sum( t3.amount_received ) + sum( t3.adjustment ) as total_budget from t2 as client_period , t2 as project_period, t3 left join t1 on (t3.project_ptr = t1.project_id and t3.date_received <= '2001-03-22 14:15:09') left join t4 on t4.client_id = t1.client_ptr where 1 and ( client_period.period_type = 'client_table' and client_period.period_key = t4.client_id and ( client_period.start_date <= '2001-03-22 14:15:09' or isnull( client_period.start_date )) and ( client_period.end_date > '2001-03-21 14:15:09' or isnull( client_period.end_date )) ) and ( project_period.period_type = 'project_table' and project_period.period_key = t1.project_id and ( project_period.start_date <= '2001-03-22 14:15:09' or isnull( project_period.start_date )) and ( project_period.end_date > '2001-03-21 14:15:09' or isnull( project_period.end_date )) ) group by client_id, project_id , client_period.period_id , project_period.period_id order by client_name asc, project_name asc; +END +OUTPUT +select distinct t1.project_id as project_id, t1.project_name as project_name, t1.client_ptr as client_ptr, t1.comments as comments, sum(t3.amount_received) + sum(t3.adjustment) as total_budget from t2 as client_period, t2 as project_period, t3 left join t1 on t3.project_ptr = t1.project_id and t3.date_received <= '2001-03-22 14:15:09' left join t4 on t4.client_id = t1.client_ptr where 1 and (client_period.period_type = 'client_table' and client_period.period_key = t4.client_id and (client_period.start_date <= '2001-03-22 14:15:09' or isnull(client_period.start_date)) and (client_period.end_date > '2001-03-21 14:15:09' or isnull(client_period.end_date))) and (project_period.period_type = 'project_table' and project_period.period_key = t1.project_id and (project_period.start_date <= '2001-03-22 14:15:09' or isnull(project_period.start_date)) and (project_period.end_date > '2001-03-21 14:15:09' or isnull(project_period.end_date))) group by client_id, project_id, client_period.period_id, project_period.period_id order by client_name asc, project_name asc +END +INPUT +select a1,a2,b,min(c) from t2 where b is NULL group by a1,a2; +END +OUTPUT +select a1, a2, b, min(c) from t2 where b is null group by a1, a2 +END +INPUT +select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='' AND TABLE_NAME='nonexisting'; +END +OUTPUT +select count(*) from INFORMATION_SCHEMA.`TABLES` where TABLE_SCHEMA = '' and TABLE_NAME = 'nonexisting' +END +INPUT +select t1.*, a from t1; +END +OUTPUT +select t1.*, a from t1 +END +INPUT +select right(_utf8 0xD0B0D0B2D0B2,1); +END +OUTPUT +select right(_utf8 0xD0B0D0B2D0B2, 1) from dual +END +INPUT +select 5 div 2; +END +OUTPUT +select 5 div 2 from dual +END +INPUT +select count(*) from t1 where id1 > 95; +END +OUTPUT +select count(*) from t1 where id1 > 95 +END +INPUT +select timestampdiff(MONTH, '1991-03-28', '2000-02-29') as a; +END +OUTPUT +select timestampdiff(MONTH, '1991-03-28', '2000-02-29') as a from dual +END +INPUT +select date_format(f1, "%m") as d1, date_format(f1, "%M") as d2 from t1 order by date_format(f1, "%M"); +END +OUTPUT +select date_format(f1, '%m') as d1, date_format(f1, '%M') as d2 from t1 order by date_format(f1, '%M') asc +END +INPUT +select from t1 where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1 limit 5; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a,b from t1 order by a,b; +END +OUTPUT +select a, b from t1 order by a asc, b asc +END +INPUT +select 1 | (1+1),5 & 3,bit_count(7); +END +OUTPUT +select 1 | 1 + 1, 5 & 3, bit_count(7) from dual +END +INPUT +select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest_%' order by host,db,user,table_name; +END +OUTPUT +select host, db, `user`, table_name from mysql.tables_priv where `user` like 'mysqltest_%' order by host asc, db asc, `user` asc, table_name asc +END +INPUT +select from t1 where a=18446744073709551615; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select cast(18446744073709551615 as signed); +END +OUTPUT +select convert(18446744073709551615, signed) from dual +END +INPUT +select monthname(str_to_date(null, '%m')), monthname(str_to_date(null, '%m')), monthname(str_to_date(1, '%m')), monthname(str_to_date(0, '%m')); +END +OUTPUT +select monthname(str_to_date(null, '%m')), monthname(str_to_date(null, '%m')), monthname(str_to_date(1, '%m')), monthname(str_to_date(0, '%m')) from dual +END +INPUT +select nullif(u, 1) from t1; +END +OUTPUT +select nullif(u, 1) from t1 +END +INPUT +select timestampdiff(month,'2004-03-29','2005-03-28'); +END +OUTPUT +select timestampdiff(month, '2004-03-29', '2005-03-28') from dual +END +INPUT +select hex(CONVERT(@utf81 USING sjis)); +END +OUTPUT +select hex(convert(@utf81 using sjis)) from dual +END +INPUT +select collation(hex(130)), coercibility(hex(130)); +END +OUTPUT +select collation(hex(130)), coercibility(hex(130)) from dual +END +INPUT +select concat(a, if(b>10, _utf8mb4 0xC3A6, _utf8mb4 0xC3AF)) from t1; +END +OUTPUT +select concat(a, if(b > 10, _utf8mb4 0xC3A6, _utf8mb4 0xC3AF)) from t1 +END +INPUT +select substring('hello', 18446744073709551615, 1); +END +OUTPUT +select substr('hello', 18446744073709551615, 1) from dual +END +INPUT +select repeat('hello', 18446744073709551617); +END +OUTPUT +select repeat('hello', 18446744073709551617) from dual +END +INPUT +select from t2 order by a; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a2, min(c), max(c) from t1 group by a1,a2,b; +END +OUTPUT +select a2, min(c), max(c) from t1 group by a1, a2, b +END +INPUT +select a, MAX(b), FIELD(MAX(b), '43', '4', '5') from t1 group by a; +END +OUTPUT +select a, MAX(b), FIELD(MAX(b), '43', '4', '5') from t1 group by a +END +INPUT +select min(t1.a3), max(t2.a2) from t1, t2 where t1.a2 = 0 and t2.a3 = 'CA'; +END +OUTPUT +select min(t1.a3), max(t2.a2) from t1, t2 where t1.a2 = 0 and t2.a3 = 'CA' +END +INPUT +select 1, min(1) from t1i where a=99; +END +OUTPUT +select 1, min(1) from t1i where a = 99 +END +INPUT +select FIELD('b','A','B'); +END +OUTPUT +select FIELD('b', 'A', 'B') from dual +END +INPUT +select length(repeat("1",1024*1024*1024)) as a; +END +OUTPUT +select length(repeat('1', 1024 * 1024 * 1024)) as a from dual +END +INPUT +select a from t1 where a > 4 order by a; +END +OUTPUT +select a from t1 where a > 4 order by a asc +END +INPUT +select 'a' union select concat('a', 4 - 5); +END +OUTPUT +(select 'a' from dual) union (select concat('a', 4 - 5) from dual) +END +INPUT +select var_samp(o) as 'null', var_pop(o) as 'null' from bug22555; +END +OUTPUT +select var_samp(o) as `null`, var_pop(o) as `null` from bug22555 +END +INPUT +select timestampdiff(MONTH, '2001-02-01', '2001-05-01') as a; +END +OUTPUT +select timestampdiff(MONTH, '2001-02-01', '2001-05-01') as a from dual +END +INPUT +select inet_aton("255.255.255.255.255"),inet_aton("255.255.1.255"),inet_aton("0.1.255"); +END +OUTPUT +select inet_aton('255.255.255.255.255'), inet_aton('255.255.1.255'), inet_aton('0.1.255') from dual +END +INPUT +select SQL_BIG_RESULT t1.b from t1, t2 group by t1.b order by 1; +END +ERROR +syntax error at position 26 +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_spanish_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_spanish_ci +END +INPUT +select from t1,t1 as t2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 'zвася' rlike '[[:<:]]вася[[:>:]]'; +END +OUTPUT +select 'zвася' regexp '[[:<:]]вася[[:>:]]' from dual +END +INPUT +select ST_NUMPOINTS(ST_EXTERIORRING(@buff)) from t1; +END +OUTPUT +select ST_NUMPOINTS(ST_EXTERIORRING(@buff)) from t1 +END +INPUT +select fld1,fld3 FROM t2 where fld1 like "25050_"; +END +OUTPUT +select fld1, fld3 from t2 where fld1 like '25050_' +END +INPUT +select insert('hello', -4294967297, -4294967297, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select column_name as 'Field',column_type as 'Type',is_nullable as 'Null',column_key as 'Key',column_default as 'Default',extra as 'Extra' from information_schema.columns where table_schema='mysqltest_db1' and table_name='t_no_priv'; +END +OUTPUT +select column_name as Field, column_type as Type, is_nullable as `Null`, column_key as `Key`, column_default as `Default`, extra as Extra from information_schema.`columns` where table_schema = 'mysqltest_db1' and table_name = 't_no_priv' +END +INPUT +select id+0 as a,max(id),concat(facility) as b from t1 group by a order by b desc,a; +END +OUTPUT +select id + 0 as a, max(id), concat(facility) as b from t1 group by a order by b desc, a asc +END +INPUT +select hex(utf8mb4) from t1; +END +OUTPUT +select hex(utf8mb4) from t1 +END +INPUT +select -9223372036854775808 2 as result; +END +ERROR +syntax error at position 30 near '2' +END +INPUT +select _koi8r 0xFF regexp _koi8r '[[:lower:]]' COLLATE koi8r_bin; +END +ERROR +syntax error at position 19 near '0xFF' +END +INPUT +select aes_decrypt(aes_encrypt("","a"),"a"); +END +OUTPUT +select aes_decrypt(aes_encrypt('', 'a'), 'a') from dual +END +INPUT +select date_sub("1998-01-01 00:00:00",INTERVAL 1 HOUR); +END +OUTPUT +select date_sub('1998-01-01 00:00:00', interval 1 HOUR) from dual +END +INPUT +select 0, st_overlaps(t.geom, p.geom) from tbl_polygon t, tbl_polygon p where t.id = 'POLY1' and p.id = 'POLY2'; +END +OUTPUT +select 0, st_overlaps(t.geom, p.geom) from tbl_polygon as t, tbl_polygon as p where t.id = 'POLY1' and p.id = 'POLY2' +END +INPUT +select uncompress(compress(@test_compress_string)); +END +OUTPUT +select uncompress(compress(@test_compress_string)) from dual +END +INPUT +select locate('LO','hello',2); +END +OUTPUT +select locate('LO', 'hello', 2) from dual +END +INPUT +select a from t1 where a like "abcdefgh�"; +END +OUTPUT +select a from t1 where a like 'abcdefgh�' +END +INPUT +select from t1 where a=b and b=0x01; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select substring_index('aaaaaaaaa1','aa',-3); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aa', -3) from dual +END +INPUT +select if(u=1,binary st,st) s from t1 order by s; +END +OUTPUT +select if(u = 1, binary st, st) as s from t1 order by s asc +END +INPUT +select from t1 where match a against ("(+aaa* +bbb1*)" in boolean mode); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where MATCH(a,b) AGAINST("+search -(support vector)" IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where match b against ('+aaaaaa bbbbbb' in boolean mode); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select substring_index("1abcd; +END +ERROR +syntax error at position 31 near '1abcd;' +END +INPUT +select insert('hello', -4294967296, -4294967296, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select replace(concat(lcase(concat('THIS',' ','IS',' ','A',' ')),ucase('false'),' ','test'),'FALSE','REAL'); +END +OUTPUT +select replace(concat(lcase(concat('THIS', ' ', 'IS', ' ', 'A', ' ')), ucase('false'), ' ', 'test'), 'FALSE', 'REAL') from dual +END +INPUT +select space(4294967296); +END +OUTPUT +select space(4294967296) from dual +END +INPUT +select monthname(date) from t1 inner join t2 on t1.id = t2.id order by t1.id; +END +OUTPUT +select monthname(`date`) from t1 join t2 on t1.id = t2.id order by t1.id asc +END +INPUT +select from t1 where CAST(field as DATE) < '2006-11-06 04:08:36.0'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select interval(55,10,20,30,40,50,60,70,80,90,100),interval(3,1,1+1,1+1+1+1),field("IBM","NCA","ICL","SUN","IBM","DIGITAL"),field("A","B","C"),elt(2,"ONE","TWO","THREE"),interval(0,1,2,3,4),elt(1,1,2,3)|0,elt(1,1.1,1.2,1.3)+0; +END +ERROR +syntax error at position 52 +END +INPUT +select FIELD('b',_latin2'A','B'); +END +OUTPUT +select FIELD('b', _latin2 as A, 'B') from dual +END +INPUT +select compress(""); +END +OUTPUT +select compress('') from dual +END +INPUT +select min(a3) from t1 where a2 = 2 and a3 > 'SEA'; +END +OUTPUT +select min(a3) from t1 where a2 = 2 and a3 > 'SEA' +END +INPUT +select i1,i2 from t1; +END +OUTPUT +select i1, i2 from t1 +END +INPUT +select CAST(TIMESTAMP "2004-01-22 21:45:33" AS BINARY(4)); +END +ERROR +syntax error at position 44 near '2004-01-22 21:45:33' +END +INPUT +select st_contains(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_contains(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name like 't%' and index_name = 'l' order by table_name; +END +OUTPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name like 't%' and index_name = 'l' order by table_name asc +END +INPUT +select (round(-9223372036854775808, -4)); +END +OUTPUT +select round(-9223372036854775808, -4) from dual +END +INPUT +select timestamp("2001-12-01 01:01:01.000100"); +END +OUTPUT +select timestamp('2001-12-01 01:01:01.000100') from dual +END +INPUT +select c1,c2 from t1 group by c1,c2 order by c2; +END +OUTPUT +select c1, c2 from t1 group by c1, c2 order by c2 asc +END +INPUT +select distinct a,sec_to_time(sum(time_to_sec(t))) from t1 group by a,b; +END +OUTPUT +select distinct a, sec_to_time(sum(time_to_sec(t))) from t1 group by a, b +END +INPUT +select table_type from information_schema.tables where table_schema="mysql" and table_name="user"; +END +OUTPUT +select table_type from information_schema.`tables` where table_schema = 'mysql' and table_name = 'user' +END +INPUT +select min(a), max(a) from t1; +END +OUTPUT +select min(a), max(a) from t1 +END +INPUT +select c1 as 'no index' from t1 where c1 like cast(concat(0xA4A2, '%') as char character set ujis); +END +OUTPUT +select c1 as `no index` from t1 where c1 like convert(concat(0xA4A2, '%'), char character set ujis) +END +INPUT +select d,a,b from t1 order by a; +END +OUTPUT +select d, a, b from t1 order by a asc +END +INPUT +select t1.id from t1 union select t2.id from t2; +END +OUTPUT +(select t1.id from t1) union (select t2.id from t2) +END +INPUT +select unix_timestamp('1968-01-20 01:00:00'); +END +OUTPUT +select unix_timestamp('1968-01-20 01:00:00') from dual +END +INPUT +select visitor_id,max(ts) as mts from t1 group by visitor_id having DATE_ADD(mts,INTERVAL 3 MONTH) < NOW(); +END +OUTPUT +select visitor_id, max(ts) as mts from t1 group by visitor_id having DATE_ADD(mts, interval 3 MONTH) < NOW() +END +INPUT +select @category3_id:= 10003; +END +ERROR +syntax error at position 22 near ':' +END +INPUT +select c as c_a from t1 where c='a'; +END +OUTPUT +select c as c_a from t1 where c = 'a' +END +INPUT +select count(distinct s) from t1; +END +OUTPUT +select count(distinct s) from t1 +END +INPUT +select t1.col1 from t1 where t1.col2 in (select t2.col2 from t2 group by t2.col1, t2.col2 having t2.col1 <= 10); +END +OUTPUT +select t1.col1 from t1 where t1.col2 in (select t2.col2 from t2 group by t2.col1, t2.col2 having t2.col1 <= 10) +END +INPUT +select from t1 where a like "%�%"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select coercibility(weight_string('test' collate latin1_swedish_ci)); +END +OUTPUT +select coercibility(weight_string('test' collate latin1_swedish_ci)) from dual +END +INPUT +select col1 as count_col1 from t1 as tmp1 group by count_col1 having col1 = 10; +END +OUTPUT +select col1 as count_col1 from t1 as tmp1 group by count_col1 having col1 = 10 +END +INPUT +select mod(NULL, 2.0) as 'NULL'; +END +OUTPUT +select mod(null, 2.0) as `NULL` from dual +END +INPUT +select t1.id, t1.data, t2.data from t1, t2 where t1.id = t2.id; +END +OUTPUT +select t1.id, t1.`data`, t2.`data` from t1, t2 where t1.id = t2.id +END +INPUT +select _koi8r'a' = _latin1'A'; +END +ERROR +syntax error at position 19 +END +INPUT +select from t1 where not(a != 1); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select fld3 FROM t2 order by fld3 desc limit 5,5; +END +OUTPUT +select fld3 from t2 order by fld3 desc limit 5, 5 +END +INPUT +select hex(char(0xFF using utf8mb4)); +END +ERROR +syntax error at position 27 near 'using' +END +INPUT +select from `information_schema`.`TABLE_CONSTRAINTS` where `TABLE_SCHEMA` = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select current_user(); +END +OUTPUT +select current_user() from dual +END +INPUT +select format(t2.f2-t2.f1+1,0) from t1,t2 where t1.f2 = t2.f3 order by t1.f1; +END +OUTPUT +select format(t2.f2 - t2.f1 + 1, 0) from t1, t2 where t1.f2 = t2.f3 order by t1.f1 asc +END +INPUT +select *, MATCH(a,b) AGAINST("collections support" IN BOOLEAN MODE) as x from t1; +END +OUTPUT +select *, match(a, b) against ('collections support' in boolean mode) as x from t1 +END +INPUT +select event_schema, event_name, definer, event_type, status from information_schema.events; +END +OUTPUT +select event_schema, event_name, `definer`, event_type, `status` from information_schema.events +END +INPUT +select Fld1, max(Fld2) from t1 group by Fld1 having max(Fld2) is not null; +END +OUTPUT +select Fld1, max(Fld2) from t1 group by Fld1 having max(Fld2) is not null +END +INPUT +select aes_decrypt("a",NULL); +END +OUTPUT +select aes_decrypt('a', null) from dual +END +INPUT +select from t2 left join t1 on t1.fooID = t2.fooID and t1.fooID = 30; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select FIELD('b','A' COLLATE latin1_bin,'B'); +END +OUTPUT +select FIELD('b', 'A' collate latin1_bin, 'B') from dual +END +INPUT +select a1,a2,b from t2 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b; +END +OUTPUT +select a1, a2, b from t2 where (a1 >= 'c' or a2 < 'b') and b > 'a' group by a1, a2, b +END +INPUT +select date_add("0199-12-31 23:59:59",INTERVAL 2 SECOND); +END +OUTPUT +select date_add('0199-12-31 23:59:59', interval 2 SECOND) from dual +END +INPUT +select a as foo, sum(b) as bar from t1 group by a having foo<10; +END +OUTPUT +select a as foo, sum(b) as bar from t1 group by a having foo < 10 +END +INPUT +select date_sub("0200-01-01 00:00:01",INTERVAL 2 SECOND); +END +OUTPUT +select date_sub('0200-01-01 00:00:01', interval 2 SECOND) from dual +END +INPUT +select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; +END +OUTPUT +select a, b, c from t3 force index (a) where a = 1 order by a desc, b desc, c desc +END +INPUT +select from t1 where a > 736494; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select _latin1'B' in (_latin2'a',_latin1'b'); +END +ERROR +syntax error at position 33 near 'a' +END +INPUT +select friedrich from (select 1 as otto) as t1; +END +OUTPUT +select friedrich from (select 1 as otto from dual) as t1 +END +INPUT +select from information_schema.tables where table_catalog = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select aes_decrypt(aes_encrypt('abc','1'),1); +END +OUTPUT +select aes_decrypt(aes_encrypt('abc', '1'), 1) from dual +END +INPUT +select 1 from t1 group by b order by a; +END +OUTPUT +select 1 from t1 group by b order by a asc +END +INPUT +select SUBSTR('abcdefg',-1,5) FROM DUAL; +END +OUTPUT +select substr('abcdefg', -1, 5) from dual +END +INPUT +select trigger_schema, trigger_name from triggers where trigger_name='tr1'; +END +OUTPUT +select trigger_schema, trigger_name from `triggers` where trigger_name = 'tr1' +END +INPUT +select datediff("1997-11-30 23:59:59.000001",null); +END +OUTPUT +select datediff('1997-11-30 23:59:59.000001', null) from dual +END +INPUT +select f1 from t1 where cast("2006-1-1" as date) between f1 and f3; +END +OUTPUT +select f1 from t1 where convert('2006-1-1', date) between f1 and f3 +END +INPUT +select maketime(-25,11,12); +END +OUTPUT +select maketime(-25, 11, 12) from dual +END +INPUT +select a,count(*) from t1 group by a; +END +OUTPUT +select a, count(*) from t1 group by a +END +INPUT +select c1 as 'using index' from t1 where c1 like cast(concat(0xA4A2, '%') as char character set ujis); +END +OUTPUT +select c1 as `using index` from t1 where c1 like convert(concat(0xA4A2, '%'), char character set ujis) +END +INPUT +select "at" as col1, "AT" as col2, "c" as col3; +END +OUTPUT +select 'at' as col1, 'AT' as col2, 'c' as col3 from dual +END +INPUT +select rpad('hello', 18446744073709551617, '1'); +END +OUTPUT +select rpad('hello', 18446744073709551617, '1') from dual +END +INPUT +select a,min(b) c,count(distinct rand()) from t1 group by a having c 'b1') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 where c < 'a0' or c > 'b1' group by a1, a2, b +END +INPUT +select from v3 where renamed=1 group by renamed; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a2 from ((t1 join t2 using (a1)) join t3 on b=c1) join t4 using (c2); +END +OUTPUT +select a2 from ((t1 join t2 using (a1)) join t3 on b = c1) join t4 using (c2) +END +INPUT +select date_add(date,INTERVAL 1 MINUTE) from t1; +END +OUTPUT +select date_add(`date`, interval 1 MINUTE) from t1 +END +INPUT +select a as foo, sum(b) as bar from t1 group by a having bar>10 order by foo+10; +END +OUTPUT +select a as foo, sum(b) as bar from t1 group by a having bar > 10 order by foo + 10 asc +END +INPUT +select t1.a, group_concat(c order by (select c from t2 where t2.a=t1.a limit 1)) as grp from t1 group by 1; +END +OUTPUT +select t1.a, group_concat(c order by (select c from t2 where t2.a = t1.a limit 1) asc) as grp from t1 group by 1 +END +INPUT +select a1,a2, max(c) from t1 where (b = 'b') group by a1,a2; +END +OUTPUT +select a1, a2, max(c) from t1 where b = 'b' group by a1, a2 +END +INPUT +select a as uci2 from t1 where a like 'あいうえおかきくけこさしすせそ'; +END +OUTPUT +select a as uci2 from t1 where a like 'あいうえおかきくけこさしすせそ' +END +INPUT +select length('; +END +ERROR +syntax error at position 17 near ';' +END +INPUT +select CONVERT(_koi8r'����' USING utf8mb4) LIKE CONVERT(_koi8r'����' USING utf8mb4); +END +ERROR +syntax error at position 36 near '����' +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL 1 MONTH); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval 1 MONTH) from dual +END +INPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name like 't%' and index_name = 'w' order by table_name; +END +OUTPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name like 't%' and index_name = 'w' order by table_name asc +END +INPUT +select /*1*/ user, host, db, command, state, info from information_schema.processlist where (user='event_scheduler') order by info; +END +OUTPUT +select /*1*/ `user`, host, db, command, state, info from information_schema.`processlist` where `user` = 'event_scheduler' order by info asc +END +INPUT +select rpad('hello', -4294967296, '1'); +END +OUTPUT +select rpad('hello', -4294967296, '1') from dual +END +INPUT +select substring(f1,1,1) from t1 group by 1; +END +OUTPUT +select substr(f1, 1, 1) from t1 group by 1 +END +INPUT +select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b; +END +OUTPUT +select distinct a1, a2, b from t2 where a1 > 'a' and a2 > 'a' and b = 'c' group by a1, a2, b +END +INPUT +select a.VARIABLE_VALUE - b.VARIABLE_VALUE from t0 b, performance_schema.global_status a where a.VARIABLE_NAME = b.VARIABLE_NAME; +END +OUTPUT +select a.VARIABLE_VALUE - b.VARIABLE_VALUE from t0 as b, performance_schema.global_status as a where a.VARIABLE_NAME = b.VARIABLE_NAME +END +INPUT +select substring('hello', -4294967296, 1); +END +OUTPUT +select substr('hello', -4294967296, 1) from dual +END +INPUT +select grp,group_concat(d order by a) from t1 group by grp; +END +OUTPUT +select grp, group_concat(d order by a asc) from t1 group by grp +END +INPUT +select from t1 where MATCH(a,b) AGAINST("support -collections" IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select benchmark(-1, 1); +END +OUTPUT +select benchmark(-1, 1) from dual +END +INPUT +select from t1 where a=version(); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select max(a) from t1i; +END +OUTPUT +select max(a) from t1i +END +INPUT +select fld1,fld3 FROM t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +END +OUTPUT +select fld1, fld3 from t2 where fld3 = 'Colombo' or fld3 = 'nondecreasing' order by fld3 asc +END +INPUT +select null mod 12 as 'NULL'; +END +OUTPUT +select null % 12 as `NULL` from dual +END +INPUT +select get_lock("test_lock2_1", 20); +END +OUTPUT +select get_lock('test_lock2_1', 20) from dual +END +INPUT +select st_astext(st_union(ST_GeometryFromText('geometrycollection(polygon((0 0, 1 0, 1 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 2 0, 2 1, 1 1, 1 0)))'))); +END +OUTPUT +select st_astext(st_union(ST_GeometryFromText('geometrycollection(polygon((0 0, 1 0, 1 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 2 0, 2 1, 1 1, 1 0)))'))) from dual +END +INPUT +select COLUMN_NAME,COLUMN_TYPE, CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH, NUMERIC_PRECISION, NUMERIC_SCALE from information_schema.columns where table_name= 't1'; +END +OUTPUT +select COLUMN_NAME, COLUMN_TYPE, CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH, NUMERIC_PRECISION, NUMERIC_SCALE from information_schema.`columns` where table_name = 't1' +END +INPUT +select from `information_schema`.`key_column_usage` where `TABLE_SCHEMA` = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select ST_AsText(f2),ST_AsText(f3) from t1; +END +OUTPUT +select ST_AsText(f2), ST_AsText(f3) from t1 +END +INPUT +select collation(group_concat(a,b)) from t1; +END +OUTPUT +select collation(group_concat(a, b)) from t1 +END +INPUT +select t2.fld3 FROM t2 where fld3 LIKE 'honeysuckle_'; +END +OUTPUT +select t2.fld3 from t2 where fld3 like 'honeysuckle_' +END +INPUT +select from t1 where upper(a)='AAA'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select cast("A" as binary) = "a", cast(BINARY "a" as CHAR) = "A"; +END +OUTPUT +select convert('A', binary) = 'a', convert(binary 'a', CHAR) = 'A' from dual +END +INPUT +select from `information_schema`.`TRIGGERS` where `EVENT_OBJECT_SCHEMA` = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select cast(min(ff) as decimal(5,2)) from t2; +END +OUTPUT +select convert(min(ff), decimal(5, 2)) from t2 +END +INPUT +select from information_schema.views where TABLE_SCHEMA != 'sys' and TABLE_NAME rlike "v[0-4]{1}$" order by table_name; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select group_concat(distinct a) from t1; +END +OUTPUT +select group_concat(distinct a) from t1 +END +INPUT +select row('A' COLLATE latin1_bin,'b','c') = row('a','b','c'); +END +OUTPUT +select row('A' collate latin1_bin, 'b', 'c') = row('a', 'b', 'c') from dual +END +INPUT +select 1 << 32,1 << 63, 1 << 64, 4 >> 2, 4 >> 63, 1<< 63 >> 60; +END +OUTPUT +select 1 << 32, 1 << 63, 1 << 64, 4 >> 2, 4 >> 63, 1 << 63 >> 60 from dual +END +INPUT +select mbrwithin(ST_GeomFromText("linestring(1 1, 2 1)"), ST_GeomFromText("polygon((0 0, 3 0, 3 3, 0 3, 0 0))")); +END +OUTPUT +select mbrwithin(ST_GeomFromText('linestring(1 1, 2 1)'), ST_GeomFromText('polygon((0 0, 3 0, 3 3, 0 3, 0 0))')) from dual +END +INPUT +select ST_GeomFromText('linestring(7 6, 15 4)') into @l; +END +ERROR +syntax error at position 56 near 'l' +END +INPUT +select concat("max=",connection) 'p1'; +END +OUTPUT +select concat('max=', `connection`) as p1 from dual +END +INPUT +select locate('he','hello'); +END +OUTPUT +select locate('he', 'hello') from dual +END +INPUT +select st_equals(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_equals(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select table_schema, table_name, column_name from information_schema.columns where table_schema not in ('performance_schema', 'sys', 'mysql') and data_type = 'longtext' order by table_name, column_name; +END +OUTPUT +select table_schema, table_name, column_name from information_schema.`columns` where table_schema not in ('performance_schema', 'sys', 'mysql') and data_type = 'longtext' order by table_name asc, column_name asc +END +INPUT +select from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%' ORDER BY text1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where a not between 1 and 2 and b not between 3 and 4; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select max(7) from t2m join t1m; +END +OUTPUT +select max(7) from t2m join t1m +END +INPUT +select count(not_existing_database.t1) from t1; +END +OUTPUT +select count(not_existing_database.t1) from t1 +END +INPUT +select a+0 from t1 order by a; +END +OUTPUT +select a + 0 from t1 order by a asc +END +INPUT +select connection_id() > 0; +END +OUTPUT +select connection_id() > 0 from dual +END +INPUT +select group_concat(a1 order by (t1.a)) from t1; +END +OUTPUT +select group_concat(a1 order by t1.a asc) from t1 +END +INPUT +select char(195 using utf8mb4); +END +ERROR +syntax error at position 22 near 'using' +END +INPUT +select concat(a, if(b>10, N'x', N'y')) from t1; +END +OUTPUT +select concat(a, if(b > 10, N as x, N as y)) from t1 +END +INPUT +select sql_buffer_result max(f1) is null from t1; +END +ERROR +syntax error at position 30 +END +INPUT +select substring('hello', -1, -1); +END +OUTPUT +select substr('hello', -1, -1) from dual +END +INPUT +select a, a is not false, a is not true, a is not unknown from t1; +END +ERROR +syntax error at position 58 near 'unknown' +END +INPUT +select cast(NULL as signed), cast(1/0 as signed); +END +OUTPUT +select convert(null, signed), convert(1 / 0, signed) from dual +END +INPUT +select concat(_latin1'a',_latin2'a',_latin5'a',_latin7'a'); +END +OUTPUT +select concat(_latin1 'a', _latin2 as a, _latin5 as a, _latin7 as a) from dual +END +INPUT +select a as d from t limit 1; +END +OUTPUT +select a as d from t limit 1 +END +INPUT +select substring('hello', 1, 18446744073709551615); +END +OUTPUT +select substr('hello', 1, 18446744073709551615) from dual +END +INPUT +select a from t1 group by a; +END +OUTPUT +select a from t1 group by a +END +INPUT +select a, group_concat(distinct b) from t1 group by a with rollup; +END +ERROR +syntax error at position 59 near 'with' +END +INPUT +select quote(trim(concat(' ', 'a'))); +END +OUTPUT +select quote(trim(concat(' ', 'a'))) from dual +END +INPUT +select rand(999999),rand(); +END +OUTPUT +select rand(999999), rand() from dual +END +INPUT +select 1.1 + '1.2'; +END +OUTPUT +select 1.1 + '1.2' from dual +END +INPUT +select from_days(to_days("960101")),to_days(960201)-to_days("19960101"),to_days(date_add(curdate(), interval 1 day))-to_days(curdate()),weekday("1997-11-29"); +END +OUTPUT +select from_days(to_days('960101')), to_days(960201) - to_days('19960101'), to_days(date_add(curdate(), interval 1 day)) - to_days(curdate()), weekday('1997-11-29') from dual +END +INPUT +select c c1 from t1 where c='1'; +END +OUTPUT +select c as c1 from t1 where c = '1' +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL 1 HOUR); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval 1 HOUR) from dual +END +INPUT +select 0x903f645a8c507dd79178 like '%-128%'; +END +OUTPUT +select 0x903f645a8c507dd79178 like '%-128%' from dual +END +INPUT +select date_sub("1998-01-01 00:00:00",INTERVAL "1 1:1" DAY_MINUTE); +END +OUTPUT +select date_sub('1998-01-01 00:00:00', interval '1 1:1' DAY_MINUTE) from dual +END +INPUT +select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b ORDER BY NULL; +END +OUTPUT +select t1.a, t2.b from t1, t2 where t1.a = t2.a group by t1.a, t2.b order by null +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_estonian_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_estonian_ci +END +INPUT +select hex(soundex(_utf8mb4 0xD091D092D093)); +END +OUTPUT +select hex(soundex(_utf8mb4 0xD091D092D093)) from dual +END +INPUT +select st_astext(st_symdifference(ST_GeometryFromText('geometrycollection(polygon((0 0, 1 0, 1 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 2 0, 2 1, 1 1, 1 0)))'))); +END +OUTPUT +select st_astext(st_symdifference(ST_GeometryFromText('geometrycollection(polygon((0 0, 1 0, 1 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 2 0, 2 1, 1 1, 1 0)))'))) from dual +END +INPUT +select mysqltest1.f1(); +END +OUTPUT +select mysqltest1.f1() from dual +END +INPUT +select from (select from t1 where t1.a=(select a from t2 where t2.a=t1.a)) a; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select st_disjoint(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_disjoint(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select substring('hello', 1, -18446744073709551617); +END +OUTPUT +select substr('hello', 1, -18446744073709551617) from dual +END +INPUT +select concat('*',v,'*',c,'*',t,'*') from t1; +END +OUTPUT +select concat('*', v, '*', c, '*', t, '*') from t1 +END +INPUT +select t2.isbn,city,concat(@bar:=t1.libname),count(distinct t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city having count(distinct t1.libname) > 1; +END +ERROR +syntax error at position 33 near ':' +END +INPUT +select ST_DISTANCE(ST_GeomFromText('polygon((0 0, 3 6, 6 3, 0 0),(2 2, 3 4, 4 3, 2 2))'), ST_GeomFromText('point(3 3)')); +END +OUTPUT +select ST_DISTANCE(ST_GeomFromText('polygon((0 0, 3 6, 6 3, 0 0),(2 2, 3 4, 4 3, 2 2))'), ST_GeomFromText('point(3 3)')) from dual +END +INPUT +select hex(min(binary a)),count(*) from t1 group by a; +END +OUTPUT +select hex(min(binary a)), count(*) from t1 group by a +END +INPUT +select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd',2); +END +OUTPUT +select SUBSTRING_INDEX(_latin1 'abcdabcdabcd', _latin1 'd', 2) from dual +END +INPUT +select 1, max(1) from t1i where 1=99; +END +OUTPUT +select 1, max(1) from t1i where 1 = 99 +END +INPUT +select database(); +END +OUTPUT +select database() from dual +END +INPUT +select REQ_ID, Group_Concat(URL) as URL, Min(t1.URL_ID) urll, Max(t1.URL_ID) urlg from t1, t2 where t2.URL_ID = t1.URL_ID group by REQ_ID; +END +OUTPUT +select REQ_ID, group_concat(URL) as URL, Min(t1.URL_ID) as urll, Max(t1.URL_ID) as urlg from t1, t2 where t2.URL_ID = t1.URL_ID group by REQ_ID +END +INPUT +select SUBSTR('abcdefg',0,0) FROM DUAL; +END +OUTPUT +select substr('abcdefg', 0, 0) from dual +END +INPUT +select user() like _utf8"%@%"; +END +OUTPUT +select user() like _utf8 '%@%' from dual +END +INPUT +select st_distance(linestring(point(26,87),point(13,95)), geometrycollection(point(4.297374e+307,8.433875e+307), point(1e308, 1e308))) as dist; +END +OUTPUT +select st_distance(linestring(point(26, 87), point(13, 95)), geometrycollection(point(4.297374e+307, 8.433875e+307), point(1e308, 1e308))) as dist from dual +END +INPUT +select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by a; +END +OUTPUT +select group_concat(t1.b, t2.c) from t1 left join t2 using (a) group by a +END +INPUT +select cast('9223372036854775807' as signed); +END +OUTPUT +select convert('9223372036854775807', signed) from dual +END +INPUT +select get_lock("test_lock2", 20); +END +OUTPUT +select get_lock('test_lock2', 20) from dual +END +INPUT +select schema_name from information_schema.schemata order by schema_name; +END +OUTPUT +select schema_name from information_schema.schemata order by schema_name asc +END +INPUT +select std(s1/s2) from bug22555 where i=3; +END +OUTPUT +select std(s1 / s2) from bug22555 where i = 3 +END +INPUT +select from t1 where btn like "q%"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select timestampdiff(month,'2004-09-11','2006-09-11'); +END +OUTPUT +select timestampdiff(month, '2004-09-11', '2006-09-11') from dual +END +INPUT +select insert('hello', 1, -4294967297, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select @category1_id:= 10001; +END +ERROR +syntax error at position 22 near ':' +END +INPUT +select hex(char(0x0102 using utf32)); +END +ERROR +syntax error at position 29 near 'using' +END +INPUT +select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3; +END +OUTPUT +select 5 % 3, 5 % -3, -5 % 3, -5 % -3 from dual +END +INPUT +select branch, count(*)/max(id) from t1 group by branch having (branch<>'mumbai' OR count(*)<2) order by id desc,branch desc limit 100; +END +OUTPUT +select branch, count(*) / max(id) from t1 group by branch having branch != 'mumbai' or count(*) < 2 order by id desc, branch desc limit 100 +END +INPUT +select ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)'))); +END +OUTPUT +select ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)'))) from dual +END +INPUT +select cast('18446744073709551616' as signed); +END +OUTPUT +select convert('18446744073709551616', signed) from dual +END +INPUT +select get_format(DATE, 'TEST') as a; +END +OUTPUT +select get_format(`DATE`, 'TEST') as a from dual +END +INPUT +select insert('hello', 1, 4294967295, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select t1.* from t t0 cross join (t t1 join t t2 on 100=t0.a); +END +OUTPUT +select t1.* from t as t0 join (t as t1 join t as t2 on 100 = t0.a) +END +INPUT +select _koi8r 0xF7 regexp _koi8r '[[:alpha:]]'; +END +ERROR +syntax error at position 19 near '0xF7' +END +INPUT +select userid,count(*) from t1 group by userid having (count(*)+1) IN (4,3) order by userid desc; +END +OUTPUT +select userid, count(*) from t1 group by userid having count(*) + 1 in (4, 3) order by userid desc +END +INPUT +select cast("2001-1-1" as date) = "2001-01-01"; +END +OUTPUT +select convert('2001-1-1', date) = '2001-01-01' from dual +END +INPUT +select sum(qty) as sqty from t1 group by id having count(distinct id) > 0; +END +OUTPUT +select sum(qty) as sqty from t1 group by id having count(distinct id) > 0 +END +INPUT +select lpad('hello', 4294967297, '1'); +END +OUTPUT +select lpad('hello', 4294967297, '1') from dual +END +INPUT +select date_add(date,INTERVAL "1:1" MINUTE_SECOND) from t1; +END +OUTPUT +select date_add(`date`, interval '1:1' MINUTE_SECOND) from t1 +END +INPUT +select extract(MINUTE_SECOND FROM "10:11:12"); +END +ERROR +syntax error at position 34 near 'FROM' +END +INPUT +select concat(a,if(b>10,_ucs2 0x00C0,_ucs2 0x0062)) from t1; +END +ERROR +syntax error at position 37 near '0x00C0' +END +INPUT +select 1, max(a) from t1m where 1=99; +END +OUTPUT +select 1, max(a) from t1m where 1 = 99 +END +INPUT +select a as like_aaaa from t1 where a like 'aaaa%'; +END +OUTPUT +select a as like_aaaa from t1 where a like 'aaaa%' +END +INPUT +select insert(_utf32 0x000000610000006200000063,1,2,_utf32 0x000000640000006500000066); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select from t1 where tt like '%Aa%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select distinct c1, c2 from t1 order by c2; +END +OUTPUT +select distinct c1, c2 from t1 order by c2 asc +END +INPUT +select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; +END +OUTPUT +select 'a' = 'a', 'a' = 'a ', 'a ' = 'a' from dual +END +INPUT +select REQ_ID, Group_Concat(URL) as URL from t1, t2 where t2.URL_ID = t1.URL_ID group by REQ_ID; +END +OUTPUT +select REQ_ID, group_concat(URL) as URL from t1, t2 where t2.URL_ID = t1.URL_ID group by REQ_ID +END +INPUT +select count(*) from t1 where v='a'; +END +OUTPUT +select count(*) from t1 where v = 'a' +END +INPUT +select concat('a', quote(NULL)); +END +OUTPUT +select concat('a', quote(null)) from dual +END +INPUT +select a1,a2,b, max(c) from t2 where (c > 'b1') or (c <= 'g1') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c) from t2 where c > 'b1' or c <= 'g1' group by a1, a2, b +END +INPUT +select from mysqldump_myDB.u1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select t1.id,t2.id from t2 left join t1 on t1.id>=74 and t1.id<=0 where t2.id=75 and t1.id is null; +END +OUTPUT +select t1.id, t2.id from t2 left join t1 on t1.id >= 74 and t1.id <= 0 where t2.id = 75 and t1.id is null +END +INPUT +select substring_index('the king of the the hill','the',1); +END +OUTPUT +select substring_index('the king of the the hill', 'the', 1) from dual +END +INPUT +select a1,a2,b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b; +END +OUTPUT +select a1, a2, b from t2 where a2 >= 'b' and b = 'a' group by a1, a2, b +END +INPUT +select var_samp(o) as '0.5', var_pop(o) as '0.25' from bug22555; +END +OUTPUT +select var_samp(o) as `0.5`, var_pop(o) as `0.25` from bug22555 +END +INPUT +select One, Two, sum(Four) from t1 group by One,Two; +END +OUTPUT +select One, Two, sum(Four) from t1 group by One, Two +END +INPUT +select from t1 where MATCH a,b AGAINST ('"text i"' IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select column_name,data_type,CHARACTER_OCTET_LENGTH, CHARACTER_MAXIMUM_LENGTH from information_schema.columns where table_name='t1' order by column_name; +END +OUTPUT +select column_name, data_type, CHARACTER_OCTET_LENGTH, CHARACTER_MAXIMUM_LENGTH from information_schema.`columns` where table_name = 't1' order by column_name asc +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_hungarian_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_hungarian_ci +END +INPUT +select date_sub("1998-01-01 00:00:00.000001",INTERVAL "000002" MICROSECOND); +END +OUTPUT +select date_sub('1998-01-01 00:00:00.000001', interval '000002' MICROSECOND) from dual +END +INPUT +select concat(a1,a2),b,min(c),max(c) from t1 where a1 < 'd' group by a1,a2,b; +END +OUTPUT +select concat(a1, a2), b, min(c), max(c) from t1 where a1 < 'd' group by a1, a2, b +END +INPUT +select date("1997-12-31 23:59:59.000001"); +END +OUTPUT +select date('1997-12-31 23:59:59.000001') from dual +END +INPUT +select collation(trim(_latin2' a ')), coercibility(trim(_latin2' a ')); +END +OUTPUT +select collation(trim(_latin2 as ` a `)), coercibility(trim(_latin2 as ` a `)) from dual +END +INPUT +select count(distinct case when id<=63 then id end) from tb; +END +OUTPUT +select count(distinct case when id <= 63 then id end) from tb +END +INPUT +select count(*) from t2 where id2; +END +OUTPUT +select count(*) from t2 where id2 +END +INPUT +select from t1 where match(s) against('para' in boolean mode); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select -(-9223372036854775808), -(-(-9223372036854775808)); +END +OUTPUT +select 9223372036854775808, -9223372036854775808 from dual +END +INPUT +select from t1_mrg; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where a >= '1'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select concat(b,'.') from t1; +END +OUTPUT +select concat(b, '.') from t1 +END +INPUT +select mod(12, NULL) as 'NULL'; +END +OUTPUT +select mod(12, null) as `NULL` from dual +END +INPUT +select from (select from t1,t2) foo; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where MATCH a,b AGAINST ('"support now"' IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(inet_aton('127.1.1')); +END +OUTPUT +select hex(inet_aton('127.1.1')) from dual +END +INPUT +select pi(),format(sin(pi()/2),6),format(cos(pi()/2),6),format(abs(tan(pi())),6),format(cot(1),6),format(asin(1),6),format(acos(0),6),format(atan(1),6); +END +OUTPUT +select pi(), format(sin(pi() / 2), 6), format(cos(pi() / 2), 6), format(abs(tan(pi())), 6), format(cot(1), 6), format(asin(1), 6), format(acos(0), 6), format(atan(1), 6) from dual +END +INPUT +select least(c1,'�'), greatest(c1,'�') from t1; +END +OUTPUT +select least(c1, '�'), greatest(c1, '�') from t1 +END +INPUT +select ST_Astext(ST_Envelope(ST_MPointFromWKB(ST_AsWKB(MultiPoint(Point('0', '0'),Point('-0', '0'), Point('0', '-0')))))) as result; +END +OUTPUT +select ST_Astext(ST_Envelope(ST_MPointFromWKB(ST_AsWKB(MultiPoint(Point('0', '0'), Point('-0', '0'), Point('0', '-0')))))) as result from dual +END +INPUT +select constraint_name from information_schema.table_constraints where table_schema='test' order by constraint_name; +END +OUTPUT +select constraint_name from information_schema.table_constraints where table_schema = 'test' order by constraint_name asc +END +INPUT +select from information_schema.partitions where table_schema="test"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select max(a2) from t1 where a2 >= 1; +END +OUTPUT +select max(a2) from t1 where a2 >= 1 +END +INPUT +select from t6 order by b,a limit 6,3; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where a like "te_t"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select match(t1.texte,t1.sujet,t1.motsclefs) against('droit' IN BOOLEAN MODE) from t1 left join t2 on t2.id=t1.id; +END +OUTPUT +select match(t1.texte, t1.sujet, t1.motsclefs) against ('droit' in boolean mode) from t1 left join t2 on t2.id = t1.id +END +INPUT +select max(t1.a2),max(t2.a1) from t1 left outer join t2 on t1.a1=10; +END +OUTPUT +select max(t1.a2), max(t2.a1) from t1 left join t2 on t1.a1 = 10 +END +INPUT +select length(repeat("",1)) as a; +END +OUTPUT +select length(repeat('', 1)) as a from dual +END +INPUT +select length(repeat("",1024*1024*1024)) as a; +END +OUTPUT +select length(repeat('', 1024 * 1024 * 1024)) as a from dual +END +INPUT +select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysql' AND TABLE_NAME=''; +END +OUTPUT +select count(*) from INFORMATION_SCHEMA.`TABLES` where TABLE_SCHEMA = 'mysql' and TABLE_NAME = '' +END +INPUT +select min(a3) from t1 where a2 = 2; +END +OUTPUT +select min(a3) from t1 where a2 = 2 +END +INPUT +select collation(format(130,10)), coercibility(format(130,10)); +END +OUTPUT +select collation(format(130, 10)), coercibility(format(130, 10)) from dual +END +INPUT +select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1; +END +OUTPUT +select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ null, null ^ 1 from dual +END +INPUT +select _utf32'a' collate utf32_general_ci = 0xfffd; +END +ERROR +syntax error at position 25 near 'collate' +END +INPUT +select round(1.5, -2147483649), round(1.5, 2147483648); +END +OUTPUT +select round(1.5, -2147483649), round(1.5, 2147483648) from dual +END +INPUT +select a1,a2,b,min(c),max(c) from t2 where a1 < 'd' group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t2 where a1 < 'd' group by a1, a2, b +END +INPUT +select 1 where 'b_a' like '__a' escape '_'; +END +OUTPUT +select 1 from dual where 'b_a' like '__a' escape '_' +END +INPUT +select period_add("9602",-12),period_diff(199505,"9404"); +END +OUTPUT +select period_add('9602', -12), period_diff(199505, '9404') from dual +END +INPUT +select hex(@utf82:= CONVERT(@ujis2 USING utf8)); +END +ERROR +syntax error at position 19 near ':' +END +INPUT +select from t5 order by a,b; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 1, max(a) from t1i where a=99; +END +OUTPUT +select 1, max(a) from t1i where a = 99 +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL 100000 HOUR); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval 100000 HOUR) from dual +END +INPUT +select std(s1/s2) from bug22555 where i=2; +END +OUTPUT +select std(s1 / s2) from bug22555 where i = 2 +END +INPUT +select count(*) from t1 where c='a'; +END +OUTPUT +select count(*) from t1 where c = 'a' +END +INPUT +select sqrt(cast(-2 as unsigned)), sqrt(18446744073709551614), sqrt(-2); +END +OUTPUT +select sqrt(convert(-2, unsigned)), sqrt(18446744073709551614), sqrt(-2) from dual +END +INPUT +select count(*) from t1 INNER JOIN (SELECT A.E1, A.E2, A.E3 FROM t1 AS A WHERE A.E3 = (SELECT MAX(B.E3) FROM t1 AS B WHERE A.E2 = B.E2)) AS themax ON t1.E1 = themax.E2 AND t1.E1 = t1.E2; +END +OUTPUT +select count(*) from t1 join (select A.E1, A.E2, A.E3 from t1 as A where A.E3 = (select MAX(B.E3) from t1 as B where A.E2 = B.E2)) as themax on t1.E1 = themax.E2 and t1.E1 = t1.E2 +END +INPUT +select insert('hello', 1, -18446744073709551617, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select from t1 union all select from t2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 'a' regexp 'A' collate latin1_general_ci; +END +OUTPUT +select 'a' regexp 'A' collate latin1_general_ci from dual +END +INPUT +select date_sub("1998-01-01 00:00:00.000001",INTERVAL "1.000002" SECOND_MICROSECOND); +END +OUTPUT +select date_sub('1998-01-01 00:00:00.000001', interval '1.000002' SECOND_MICROSECOND) from dual +END +INPUT +select if(0, 18446744073709551610, 18446744073709551610); +END +OUTPUT +select if(0, 18446744073709551610, 18446744073709551610) from dual +END +INPUT +select st_astext(st_difference(ST_GeometryFromText('geometrycollection(polygon((0 0, 2 0, 2 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 3 0, 3 1, 1 1, 1 0)))'))); +END +OUTPUT +select st_astext(st_difference(ST_GeometryFromText('geometrycollection(polygon((0 0, 2 0, 2 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 3 0, 3 1, 1 1, 1 0)))'))) from dual +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL "1:1" DAY_HOUR); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval '1:1' DAY_HOUR) from dual +END +INPUT +select ST_astext(ST_Union(ST_geometryfromtext('point(1 1)'), ST_geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))'))); +END +OUTPUT +select ST_astext(ST_Union(ST_geometryfromtext('point(1 1)'), ST_geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))'))) from dual +END +INPUT +select hex(convert(_big5 0xC84041 using ucs2)); +END +ERROR +syntax error at position 34 near '0xC84041' +END +INPUT +select quote(concat('abc'', 'cba')); +END +ERROR +syntax error at position 37 near '));' +END +INPUT +select max(t1.a1), max(t2.a1) from t1, t2 where t2.a2=9; +END +OUTPUT +select max(t1.a1), max(t2.a1) from t1, t2 where t2.a2 = 9 +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_latvian_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_latvian_ci +END +INPUT +select 1 from t1 where a like @pattern; +END +OUTPUT +select 1 from t1 where a like @pattern +END +INPUT +select uncompress(compress("")); +END +OUTPUT +select uncompress(compress('')) from dual +END +INPUT +select find_in_set('a',binary 'A,B,C'); +END +OUTPUT +select find_in_set('a', binary 'A,B,C') from dual +END +INPUT +select week(19981231,2), week(19981231,3), week(20000101,2), week(20000101,3); +END +OUTPUT +select week(19981231, 2), week(19981231, 3), week(20000101, 2), week(20000101, 3) from dual +END +INPUT +select t2.* from ((select from t1) as A inner join t2 on A.ID = t2.FID); +END +ERROR +syntax error at position 31 near 'from' +END +INPUT +select from information_schema.COLUMNS where table_name="t1" and column_name= "a" order by table_name; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select rpad('hello', 4294967295, '1'); +END +OUTPUT +select rpad('hello', 4294967295, '1') from dual +END +INPUT +select substring('hello', 1, -1); +END +OUTPUT +select substr('hello', 1, -1) from dual +END +INPUT +select CASE when 1=0 then "true" else "false" END; +END +OUTPUT +select case when 1 = 0 then 'true' else 'false' end from dual +END +INPUT +select from t1 where match b against ('full*' in boolean mode); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2); +END +OUTPUT +select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2) from dual +END +INPUT +select 18446744073709551615, 18446744073709551615 DIV 1, 18446744073709551615 DIV 2; +END +OUTPUT +select 18446744073709551615, 18446744073709551615 div 1, 18446744073709551615 div 2 from dual +END +INPUT +select from t2 where match name against ('*a*b*c*d*e*f*' in boolean mode); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(c) from t1; +END +OUTPUT +select hex(c) from t1 +END +INPUT +select ' вася ' rlike '[[:<:]]вася[[:>:]]'; +END +OUTPUT +select ' вася ' regexp '[[:<:]]вася[[:>:]]' from dual +END +INPUT +select max(a3) from t1 where a2 = 2 and 'SEA' > a3; +END +OUTPUT +select max(a3) from t1 where a2 = 2 and 'SEA' > a3 +END +INPUT +select inet_ntoa(inet_aton("255.255.255.255.255.255.255.255")); +END +OUTPUT +select inet_ntoa(inet_aton('255.255.255.255.255.255.255.255')) from dual +END +INPUT +select count(*) from t1 join ( select t1.f1 from t1 join t1 as t2 join t1 as t3) tt on t1.f1 = tt.f1; +END +OUTPUT +select count(*) from t1 join (select t1.f1 from t1 join t1 as t2 join t1 as t3) as tt on t1.f1 = tt.f1 +END +INPUT +select collation(ltrim(_latin2' a ')), coercibility(ltrim(_latin2' a ')); +END +OUTPUT +select collation(ltrim(_latin2 as ` a `)), coercibility(ltrim(_latin2 as ` a `)) from dual +END +INPUT +select hex(weight_string('ab' as char(1))); +END +ERROR +syntax error at position 39 +END +INPUT +select a1,a2,b,max(c),min(c) from t2 group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c), min(c) from t2 group by a1, a2, b +END +INPUT +select concat(':',ltrim(' left '),':',rtrim(' right '),':'); +END +OUTPUT +select concat(':', ltrim(' left '), ':', rtrim(' right '), ':') from dual +END +INPUT +select c from t1 where c=0xD0B1212223D0B1D0B1D0B1D0B1D0B1; +END +OUTPUT +select c from t1 where c = 0xD0B1212223D0B1D0B1D0B1D0B1D0B1 +END +INPUT +select (CASE "two" when "one" then 1.00 WHEN "two" then 2.00 END) +0.0; +END +OUTPUT +select case 'two' when 'one' then 1.00 when 'two' then 2.00 end + 0.0 from dual +END +INPUT +select count(*) from t1 where match a against ('aaayyy'); +END +ERROR +syntax error at position 38 near 'a' +END +INPUT +select microsecond("1997-12-31 23:59:59.000001"); +END +OUTPUT +select microsecond('1997-12-31 23:59:59.000001') from dual +END +INPUT +select f1 from t1 group by f1 having max(f1)=f1; +END +OUTPUT +select f1 from t1 group by f1 having max(f1) = f1 +END +INPUT +select concat('|', text1, '|') from t1 where text1 like 'teststring_%'; +END +OUTPUT +select concat('|', text1, '|') from t1 where text1 like 'teststring_%' +END +INPUT +select count(*) from t1 where facility IS NULL; +END +OUTPUT +select count(*) from t1 where facility is null +END +INPUT +select count(b) from t1 where b >= 10; +END +OUTPUT +select count(b) from t1 where b >= 10 +END +INPUT +select substring('hello', -18446744073709551616, -18446744073709551616); +END +OUTPUT +select substr('hello', -18446744073709551616, -18446744073709551616) from dual +END +INPUT +select charset(a) from t2; +END +OUTPUT +select charset(a) from t2 +END +INPUT +select weight_string(NULL); +END +OUTPUT +select weight_string(null) from dual +END +INPUT +select from information_schema.TABLE_CONSTRAINTS where TABLE_SCHEMA= "test" order by TABLE_SCHEMA, TABLE_NAME, CONSTRAINT_NAME; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select distinct least(1,count(distinct a)) from t1 group by a; +END +OUTPUT +select distinct least(1, count(distinct a)) from t1 group by a +END +INPUT +select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121'); +END +OUTPUT +select distinct a1, a2, b, c from t1 where a2 >= 'b' and b = 'a' and c = 'i121' +END +INPUT +select 'a ' = 'a ', 'a ' < 'a ', 'a ' > 'a '; +END +OUTPUT +select 'a\t' = 'a ', 'a\t' < 'a ', 'a\t' > 'a ' from dual +END +INPUT +select str_to_date("2003-....01ABCD-02 10:11:12.0012", "%Y-%.%m%@-%d %H:%i:%S.%f") as a; +END +OUTPUT +select str_to_date('2003-....01ABCD-02 10:11:12.0012', '%Y-%.%m%@-%d %H:%i:%S.%f') as a from dual +END +INPUT +select event_name, event_definition, status, interval_field, interval_value from information_schema.events; +END +OUTPUT +select event_name, event_definition, `status`, interval_field, interval_value from information_schema.events +END +INPUT +select addtime("1997-12-31 23:59:59.999999", "1998-01-01 01:01:01.999999"); +END +OUTPUT +select addtime('1997-12-31 23:59:59.999999', '1998-01-01 01:01:01.999999') from dual +END +INPUT +select 'a' regexp 'A' collate latin1_bin; +END +OUTPUT +select 'a' regexp 'A' collate latin1_bin from dual +END +INPUT +select from information_schema.views where table_schema != 'sys' order by table_name; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t2 left outer join t1 using (n); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1, t2 where t1.value64= 9223372036854775807 and t2.value64=t1.value64; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select makedate(1997,1); +END +OUTPUT +select makedate(1997, 1) from dual +END +INPUT +select a, a is false, a is true, a is unknown from t1; +END +ERROR +syntax error at position 46 near 'unknown' +END +INPUT +select std(e) from bug22555 group by i; +END +OUTPUT +select std(e) from bug22555 group by i +END +INPUT +select distinct a1,a2,b from t2; +END +OUTPUT +select distinct a1, a2, b from t2 +END +INPUT +select mbrcovers(ST_GeomFromText("polygon((2 2, 10 2, 10 10, 2 10, 2 2))"), ST_GeomFromText("point(2 4)")); +END +OUTPUT +select mbrcovers(ST_GeomFromText('polygon((2 2, 10 2, 10 10, 2 10, 2 2))'), ST_GeomFromText('point(2 4)')) from dual +END +INPUT +select uncompress(b) from t1; +END +OUTPUT +select uncompress(b) from t1 +END +INPUT +select count(*) from t1 group by col1 having col1 = 10; +END +OUTPUT +select count(*) from t1 group by col1 having col1 = 10 +END +INPUT +select count(distinct x,y) from t1; +END +OUTPUT +select count(distinct x, y) from t1 +END +INPUT +select coercibility(col1), collation(col1) from v2; +END +OUTPUT +select coercibility(col1), collation(col1) from v2 +END +INPUT +select mbrwithin(ST_GeomFromText("point(2 4)"), ST_GeomFromText("linestring(2 0, 2 6)")); +END +OUTPUT +select mbrwithin(ST_GeomFromText('point(2 4)'), ST_GeomFromText('linestring(2 0, 2 6)')) from dual +END +INPUT +select st_astext(st_makeenvelope(st_geomfromtext('point(0 0)'), st_geomfromtext('point(-22 -11)'))); +END +OUTPUT +select st_astext(st_makeenvelope(st_geomfromtext('point(0 0)'), st_geomfromtext('point(-22 -11)'))) from dual +END +INPUT +select _latin1'B' collate latin1_general_ci between _latin1'a' collate latin1_bin and _latin1'b'; +END +OUTPUT +select _latin1 'B' collate latin1_general_ci between _latin1 'a' collate latin1_bin and _latin1 'b' from dual +END +INPUT +select sum(a), count(*) from t1 group by a; +END +OUTPUT +select sum(a), count(*) from t1 group by a +END +INPUT +select from t1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select makedate(03,1); +END +OUTPUT +select makedate(03, 1) from dual +END +INPUT +select user(), current_user(), database(); +END +OUTPUT +select user(), current_user(), database() from dual +END +INPUT +select hex(char(256)); +END +OUTPUT +select hex(char(256)) from dual +END +INPUT +select SUBSTR('abcdefg',1,-1) FROM DUAL; +END +OUTPUT +select substr('abcdefg', 1, -1) from dual +END +INPUT +select max(a3) from t1 where a2 = 2 and a3 < 'SEA'; +END +OUTPUT +select max(a3) from t1 where a2 = 2 and a3 < 'SEA' +END +INPUT +select week(20000101,0) as '0', week(20000101,1) as '1', week(20000101,2) as '2', week(20000101,3) as '3', week(20000101,4) as '4', week(20000101,5) as '5', week(20000101,6) as '6', week(20000101,7) as '7'; +END +OUTPUT +select week(20000101, 0) as `0`, week(20000101, 1) as `1`, week(20000101, 2) as `2`, week(20000101, 3) as `3`, week(20000101, 4) as `4`, week(20000101, 5) as `5`, week(20000101, 6) as `6`, week(20000101, 7) as `7` from dual +END +INPUT +select a as x from t1 having x=3; +END +OUTPUT +select a as x from t1 having x = 3 +END +INPUT +select from t1 where x != 0; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select locate('lo','hello',-4294967297); +END +OUTPUT +select locate('lo', 'hello', -4294967297) from dual +END +INPUT +select from t1 where firstname='John' and firstname like binary 'john'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select (with cte as (select t1.a) select from cte) from t1; +END +ERROR +syntax error at position 13 near 'with' +END +INPUT +select from v1d; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*) from t1, t2 where t1.p = t2.i; +END +OUTPUT +select count(*) from t1, t2 where t1.p = t2.i +END +INPUT +select isnull(date(NULL)), isnull(cast(NULL as DATE)); +END +OUTPUT +select isnull(date(null)), isnull(convert(null, DATE)) from dual +END +INPUT +select from t1 ignore index (primary) where tt like 'Aa%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(weight_string(_utf8mb4 0xF0908080 /bin /boot /cdrom /dev /etc /home /lib /lib32 /lib64 /libx32 /lost+found /media /mnt /opt /proc /root /run /sbin /snap /srv /swapfile /sys /tmp /usr /var U+10000 node_modules/ collate utf8mb4_unicode_ci)); +END +ERROR +syntax error at position 202 +END +INPUT +select from t1 natural left join t2 natural left join t3; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select collation(group_concat(a separator ',')) from t1; +END +OUTPUT +select collation(group_concat(a separator ',')) from t1 +END +INPUT +select "hepp"; +END +OUTPUT +select 'hepp' from dual +END +INPUT +select from t1 where word like 'ae'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select strcmp(date_format(utc_timestamp(),"%T"), utc_time())=0; +END +OUTPUT +select strcmp(date_format(utc_timestamp(), '%T'), utc_time()) = 0 from dual +END +INPUT +select st_astext(st_symdifference(ST_GeometryFromText('geometrycollection(polygon((0 0, 2 0, 2 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 3 0, 3 1, 1 1, 1 0)))'))); +END +OUTPUT +select st_astext(st_symdifference(ST_GeometryFromText('geometrycollection(polygon((0 0, 2 0, 2 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 3 0, 3 1, 1 1, 1 0)))'))) from dual +END +INPUT +select distinct t1.a from t1,t3 where t1.a=t3.a; +END +OUTPUT +select distinct t1.a from t1, t3 where t1.a = t3.a +END +INPUT +select date_add('1000-01-01 00:00:00', interval '1.02' day_microsecond); +END +OUTPUT +select date_add('1000-01-01 00:00:00', interval '1.02' day_microsecond) from dual +END +INPUT +select from (select b from t1) as t1, (select b from t2) as t2 order by 1, 2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select "Test delimiter : from command line" as "_"; +END +OUTPUT +select 'Test delimiter : from command line' as _ from dual +END +INPUT +select length(uncompress(a)) from t1; +END +OUTPUT +select length(uncompress(a)) from t1 +END +INPUT +select cast('1a' as signed); +END +OUTPUT +select convert('1a', signed) from dual +END +INPUT +select from t1 where a in ('4828532208463511553'); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select column_name from information_schema.columns where table_schema='test' order by column_name; +END +OUTPUT +select column_name from information_schema.`columns` where table_schema = 'test' order by column_name asc +END +INPUT +select t1.name, t2.name, t2.id,t3.id from t2 right join t1 on (t1.id = t2.owner) left join t1 as t3 on t3.id=t2.owner; +END +OUTPUT +select t1.`name`, t2.`name`, t2.id, t3.id from t2 right join t1 on t1.id = t2.owner left join t1 as t3 on t3.id = t2.owner +END +INPUT +select mod(cast(-2 as unsigned), 3), mod(18446744073709551614, 3), mod(-2, 3); +END +OUTPUT +select mod(convert(-2, unsigned), 3), mod(18446744073709551614, 3), mod(-2, 3) from dual +END +INPUT +select a, a regexp '[a]' from t1 order by binary a; +END +OUTPUT +select a, a regexp '[a]' from t1 order by binary a asc +END +INPUT +select -1 -9223372036854775808 as result; +END +OUTPUT +select -1 - 9223372036854775808 as result from dual +END +INPUT +select ticket2.id FROM t2 as ttxt,t2 INNER JOIN t1 as ticket2 ON ticket2.id = t2.ticket WHERE ticket2.id = ticket2.ticket and match(ttxt.inhalt) against ('foobar'); +END +OUTPUT +select ticket2.id from t2 as ttxt, t2 join t1 as ticket2 on ticket2.id = t2.ticket where ticket2.id = ticket2.ticket and match(ttxt.inhalt) against ('foobar') +END +INPUT +select utext from t1 where utext like '%%'; +END +OUTPUT +select utext from t1 where utext like '%%' +END +INPUT +select a1,a2,b, concat(min(c), max(c)) from t1 where a1 < 'd' group by a1,a2,b; +END +OUTPUT +select a1, a2, b, concat(min(c), max(c)) from t1 where a1 < 'd' group by a1, a2, b +END +INPUT +select i, length(a), length(b), char_length(a), char_length(b) from t1; +END +OUTPUT +select i, length(a), length(b), char_length(a), char_length(b) from t1 +END +INPUT +select count(*) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3; +END +OUTPUT +select count(*) as c from t1 where a > 0 order by c asc limit 3 +END +INPUT +select a1,a2,b,min(c),max(c) from t1 where ((c > 'b111') and (c <= 'g112')) or ((c > 'd000') and (c <= 'i110')) group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 where c > 'b111' and c <= 'g112' or c > 'd000' and c <= 'i110' group by a1, a2, b +END +INPUT +select *, uncompress(a), uncompress(a) is null from t1; +END +OUTPUT +select *, uncompress(a), uncompress(a) is null from t1 +END +INPUT +select from bug15205; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select case 1/0 when "a" then "true" END; +END +OUTPUT +select case 1 / 0 when 'a' then 'true' end from dual +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_lithuanian_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_lithuanian_ci +END +INPUT +select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1; +END +OUTPUT +select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1 +END +INPUT +select from t1 where a like "%U%"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*) from t where id between 8894754949779693574 and 17790886498483827171; +END +OUTPUT +select count(*) from t where id between 8894754949779693574 and 17790886498483827171 +END +INPUT +select substring('hello', 2, -1); +END +OUTPUT +select substr('hello', 2, -1) from dual +END +INPUT +select adddate("1997-12-31 23:59:59.000001", 10); +END +OUTPUT +select adddate('1997-12-31 23:59:59.000001', 10) from dual +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL "1 1:1" DAY_MINUTE); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval '1 1:1' DAY_MINUTE) from dual +END +INPUT +select quote(''"test'); +END +ERROR +syntax error at position 24 near 'test');' +END +INPUT +select from t1 where a like '%PES%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select ifnull(c1,'�'), ifnull(null,c1) from t1; +END +OUTPUT +select ifnull(c1, '�'), ifnull(null, c1) from t1 +END +INPUT +select 0<=>0,0.0<=>0.0,0E0=0E0,"A"<=>"A",NULL<=>NULL; +END +OUTPUT +select 0 <=> 0, 0.0 <=> 0.0, 0E0 = 0E0, 'A' <=> 'A', null <=> null from dual +END +INPUT +select st_intersects(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_intersects(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select t1.* as 'with_alias', (select a from t2 where d > a) as 'x' from t1; +END +ERROR +syntax error at position 15 near 'as' +END +INPUT +select CASE concat("a","b") when concat("ab","") then "a" when "b" then "b" end; +END +OUTPUT +select case concat('a', 'b') when concat('ab', '') then 'a' when 'b' then 'b' end from dual +END +INPUT +select 1+1, "a",count(*) from t1 where foo in (2); +END +OUTPUT +select 1 + 1, 'a', count(*) from t1 where foo in (2) +END +INPUT +select make_set(3, name, upper(name)) from bug20536; +END +OUTPUT +select make_set(3, `name`, upper(`name`)) from bug20536 +END +INPUT +select count(*),b from t1; +END +OUTPUT +select count(*), b from t1 +END +INPUT +select distinct s from t1; +END +OUTPUT +select distinct s from t1 +END +INPUT +select a1,a2,b,min(c) from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c) from t2 where a1 > 'a' and a2 > 'a' and b = 'c' group by a1, a2, b +END +INPUT +select var_samp(e), var_pop(e) from bug22555; +END +OUTPUT +select var_samp(e), var_pop(e) from bug22555 +END +INPUT +select collation(left(_latin2'a',1)), coercibility(left(_latin2'a',1)); +END +OUTPUT +select collation(left(_latin2 as a, 1)), coercibility(left(_latin2 as a, 1)) from dual +END +INPUT +select @tlwa < @tlwb; +END +OUTPUT +select @tlwa < @tlwb from dual +END +INPUT +select hex(weight_string(cast(0xE0A1 as char) as char(1))); +END +ERROR +syntax error at position 55 +END +INPUT +select group_concat(bar order by concat(bar,bar) desc) from t1; +END +OUTPUT +select group_concat(bar order by concat(bar, bar) desc) from t1 +END +INPUT +select CAST('10x' as unsigned integer); +END +OUTPUT +select convert('10x', unsigned) from dual +END +INPUT +select subtime("1997-12-31 23:59:59.999999", "1998-01-01 01:01:01.999999"); +END +OUTPUT +select subtime('1997-12-31 23:59:59.999999', '1998-01-01 01:01:01.999999') from dual +END +INPUT +select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END; +END +OUTPUT +select case 1 when 1 then 'one' when 2 then 'two' else 'more' end from dual +END +INPUT +select from (t1 join t2 using (b)) join (t3 join t4 using (c)) using (c); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select min(7) from t1i; +END +OUTPUT +select min(7) from t1i +END +INPUT +select locate(_utf8 0xD0B1, _utf8 0xD0B0D0B1D0B2); +END +OUTPUT +select locate(_utf8 0xD0B1, _utf8 0xD0B0D0B1D0B2) from dual +END +INPUT +select from t1 where b like 'foob%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select convert(_latin1'G�nter Andr�' using utf8mb4) like CONVERT(_latin1'G�NTER%' USING utf8mb4); +END +OUTPUT +select convert(_latin1 'G�nter Andr�' using utf8mb4) like convert(_latin1 'G�NTER%' using utf8mb4) from dual +END +INPUT +select 1, min(a) from t1m where 1=99; +END +OUTPUT +select 1, min(a) from t1m where 1 = 99 +END +INPUT +select a1,a2,b,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1; +END +OUTPUT +select a1, a2, b, max(c), min(c) from t1 where a2 = 'a' and b = 'b' group by a1 +END +INPUT +select @stamp1:=f2 from t1; +END +ERROR +syntax error at position 16 near ':' +END +INPUT +select t1.*,t2.* from mysqltest_2.t1,mysqltest_2.t2; +END +OUTPUT +select t1.*, t2.* from mysqltest_2.t1, mysqltest_2.t2 +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_spanish2_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_spanish2_ci +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL "-10000:1" HOUR_MINUTE); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval '-10000:1' HOUR_MINUTE) from dual +END +INPUT +select mod(12.0, 0) as 'NULL'; +END +OUTPUT +select mod(12.0, 0) as `NULL` from dual +END +INPUT +select from t1 where str <> default(str); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysql' AND TABLE_NAME='nonexisting'; +END +OUTPUT +select count(*) from INFORMATION_SCHEMA.`TABLES` where TABLE_SCHEMA = 'mysql' and TABLE_NAME = 'nonexisting' +END +INPUT +select (12%0) <=> null as '1'; +END +OUTPUT +select 12 % 0 <=> null as `1` from dual +END +INPUT +select @@local.profiling; +END +OUTPUT +select @@local.profiling from dual +END +INPUT +select 5.0 div 2; +END +OUTPUT +select 5.0 div 2 from dual +END +INPUT +select group_concat( distinct col1 ) as alias from t1 group by col2 having alias like '%'; +END +OUTPUT +select group_concat(distinct col1) as alias from t1 group by col2 having alias like '%' +END +INPUT +select strcmp('ss','�a'),strcmp('�','ssa'),strcmp('s�a','sssb'),strcmp('s','�'); +END +OUTPUT +select strcmp('ss', '�a'), strcmp('�', 'ssa'), strcmp('s�a', 'sssb'), strcmp('s', '�') from dual +END +INPUT +select coercibility(max(a)) from t1; +END +OUTPUT +select coercibility(max(a)) from t1 +END +INPUT +select sysdate() into @b; +END +ERROR +syntax error at position 25 near 'b' +END +INPUT +select inet_ntoa(null),inet_aton(null); +END +OUTPUT +select inet_ntoa(null), inet_aton(null) from dual +END +INPUT +select hex(@utf82); +END +OUTPUT +select hex(@utf82) from dual +END +INPUT +select subtime("1997-12-31 23:59:59.000001", "1 1:1:1.000002"); +END +OUTPUT +select subtime('1997-12-31 23:59:59.000001', '1 1:1:1.000002') from dual +END +INPUT +select count(*) as count_col1 from t1 as tmp1 group by col1 having col1 = 10; +END +OUTPUT +select count(*) as count_col1 from t1 as tmp1 group by col1 having col1 = 10 +END +INPUT +select ST_AsText(a) from (select f2 as a from t1 union select f3 from t1) t; +END +OUTPUT +select ST_AsText(a) from ((select f2 as a from t1) union (select f3 from t1)) as t +END +INPUT +select host,db,user,table_name from mysql.tables_priv where user = 'mysqltest_1' order by host,db,user,table_name; +END +OUTPUT +select host, db, `user`, table_name from mysql.tables_priv where `user` = 'mysqltest_1' order by host asc, db asc, `user` asc, table_name asc +END +INPUT +select from v1a join (t3 natural join t4) on a = y; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a1,a2,b,max(c),min(c) from t1 group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c), min(c) from t1 group by a1, a2, b +END +INPUT +select from information_schema.column_privileges where grantee like '%user%' order by grantee; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select distinct s,t from t1; +END +OUTPUT +select distinct s, t from t1 +END +INPUT +select from (select from t1 union all select from t1 limit 2) a; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select CAST(0x8fffffffffffffff as signed); +END +OUTPUT +select convert(0x8fffffffffffffff, signed) from dual +END +INPUT +select a1,a2,b,min(c) from t1 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122') or (c < 'h112') or (c = 'c111')) group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c) from t1 where (a1 > 'a' or a1 < '9') and (a2 >= 'b' and a2 < 'z') and b = 'a' and (c = 'j121' or c > 'k121' and c < 'm122' or c > 'o122' or c < 'h112' or c = 'c111') group by a1, a2, b +END +INPUT +select count(distinct n1) from t1; +END +OUTPUT +select count(distinct n1) from t1 +END +INPUT +select strcmp('u','�a'),strcmp('u','�'); +END +OUTPUT +select strcmp('u', '�a'), strcmp('u', '�') from dual +END +INPUT +select locate(_utf8mb4 0xD091, _utf8mb4 0xD0B0D0B1D0B2 collate utf8mb4_bin); +END +OUTPUT +select locate(_utf8mb4 0xD091, _utf8mb4 0xD0B0D0B1D0B2 collate utf8mb4_bin) from dual +END +INPUT +select lpad('hello', -4294967297, '1'); +END +OUTPUT +select lpad('hello', -4294967297, '1') from dual +END +INPUT +select st_astext(st_union(cast(point(1,1)as char(15)),point(1,1))) as res; +END +OUTPUT +select st_astext(st_union(convert(point(1, 1), char(15)), point(1, 1))) as res from dual +END +INPUT +select cast('' as signed); +END +OUTPUT +select convert('', signed) from dual +END +INPUT +select hex(substr(_ucs2 0x00e400e50068,-1)); +END +ERROR +syntax error at position 39 near '0x00e400e50068' +END +INPUT +select convert(_latin1'G�nter Andr�' using utf8) like CONVERT(_latin1'G�NTER%' USING utf8); +END +OUTPUT +select convert(_latin1 'G�nter Andr�' using utf8) like convert(_latin1 'G�NTER%' using utf8) from dual +END +INPUT +select ST_AsText(ST_GeometryFromWKB(ST_AsWKB(GeometryCollection(POINT(0, 0), MULTIPOINT(point(0, 0), point(1, 1)), LINESTRING(point(0, 0),point(10, 10)), MULTILINESTRING(LINESTRING(point(1, 2), point(1, 3))), POLYGON(LineString(Point(10, 20), Point(1, 1), Point(2, 2), Point(1, 1), Point(10, 20))), MULTIPOLYGON(Polygon(LineString(Point(0, 0), Point(1, 0), Point(1, 1), Point(0, 0)))))))) as Result; +END +OUTPUT +select ST_AsText(ST_GeometryFromWKB(ST_AsWKB(GeometryCollection(POINT(0, 0), MULTIPOINT(point(0, 0), point(1, 1)), LINESTRING(point(0, 0), point(10, 10)), MULTILINESTRING(LINESTRING(point(1, 2), point(1, 3))), POLYGON(LineString(Point(10, 20), Point(1, 1), Point(2, 2), Point(1, 1), Point(10, 20))), MULTIPOLYGON(Polygon(LineString(Point(0, 0), Point(1, 0), Point(1, 1), Point(0, 0)))))))) as Result from dual +END +INPUT +select s1*0 as s1 from t1 group by s1 having s1 <> 0; +END +OUTPUT +select s1 * 0 as s1 from t1 group by s1 having s1 != 0 +END +INPUT +select from (t3 natural join t4) natural right join (t1 natural join t2) where b + 1 = y or b + 10 = y group by b,c,a,y having min(b) < max(y) order by a, y; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select st_distance_sphere(st_geomfromtext('point(-120 45)'), st_geomfromtext('point(30.24 68.37)')); +END +OUTPUT +select st_distance_sphere(st_geomfromtext('point(-120 45)'), st_geomfromtext('point(30.24 68.37)')) from dual +END +INPUT +select group_concat(distinct s1 order by s2) from t1; +END +OUTPUT +select group_concat(distinct s1 order by s2 asc) from t1 +END +INPUT +select a from t2 group by a order by (select a from t1 order by t2.b limit 1); +END +OUTPUT +select a from t2 group by a order by (select a from t1 order by t2.b asc limit 1) asc +END +INPUT +select t1.*,t2.* from t1 left join t2 using (a); +END +OUTPUT +select t1.*, t2.* from t1 left join t2 using (a) +END +INPUT +select from t1, t2 where t1.value64=17156792991891826145 and t2.value64=17156792991891826145; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select t from t1 where t='tttt'; +END +OUTPUT +select t from t1 where t = 'tttt' +END +INPUT +select from t3 where x = 1 and y < 5 order by y; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select rpad(741653838,17,'0'),lpad(741653838,17,'0'); +END +OUTPUT +select rpad(741653838, 17, '0'), lpad(741653838, 17, '0') from dual +END +INPUT +select count(test.t1.b) from t1; +END +OUTPUT +select count(test.t1.b) from t1 +END +INPUT +select st_difference((convert(st_polygonfromwkb(linestring(point(1,1))) using gb18030)), st_geomcollfromwkb(point(1,1))); +END +OUTPUT +select st_difference(convert(st_polygonfromwkb(linestring(point(1, 1))) using gb18030), st_geomcollfromwkb(point(1, 1))) from dual +END +INPUT +select convert(_koi8r'�' using utf8mb4) < convert(_koi8r'�' using utf8mb4); +END +ERROR +syntax error at position 27 near '�' +END +INPUT +select from t4; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select ST_DISTANCE(ST_GeomFromText('polygon((0 0, 3 6, 6 3, 0 0))'), ST_GeomFromText('polygon((2 2, 3 4, 4 3, 2 2))')); +END +OUTPUT +select ST_DISTANCE(ST_GeomFromText('polygon((0 0, 3 6, 6 3, 0 0))'), ST_GeomFromText('polygon((2 2, 3 4, 4 3, 2 2))')) from dual +END +INPUT +select (with recursive dt as (select t1.a as a union select a+1 from dt where a<10) select concat(count(*), ' - ', avg(dt.a)) from dt ) as subq from t1; +END +ERROR +syntax error at position 13 near 'with' +END +INPUT +select from t1 natural left join (t4 natural join t5) where t5.z is not NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select distinct a1,a2,b from t2 where (a2 >= 'b') and (b = 'a'); +END +OUTPUT +select distinct a1, a2, b from t2 where a2 >= 'b' and b = 'a' +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_unicode_520_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_unicode_520_ci +END +INPUT +select c as c_a from t1 where c='ñ'; +END +OUTPUT +select c as c_a from t1 where c = 'ñ' +END +INPUT +select from t1 where text1='teststring' or text1 >= 'teststring '; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select mbrwithin(ST_GeomFromText("point(2 4)"), ST_GeomFromText("linestring(2 0, 2 4)")); +END +OUTPUT +select mbrwithin(ST_GeomFromText('point(2 4)'), ST_GeomFromText('linestring(2 0, 2 4)')) from dual +END +INPUT +select ST_astext(st_symdifference(ST_GeomFromText('multipoint(2 2, 3 3)'), ST_GeomFromText('multipoint(0 0, 4 4)'))); +END +OUTPUT +select ST_astext(st_symdifference(ST_GeomFromText('multipoint(2 2, 3 3)'), ST_GeomFromText('multipoint(0 0, 4 4)'))) from dual +END +INPUT +select count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1; +END +OUTPUT +select count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 +END +INPUT +select format(a, 2) from t1; +END +OUTPUT +select format(a, 2) from t1 +END +INPUT +select strcmp(current_timestamp(),concat(current_date()," ",current_time())); +END +OUTPUT +select strcmp(current_timestamp(), concat(current_date(), ' ', current_time())) from dual +END +INPUT +select hex(ujis), hex(ucs2), hex(ujis2), name from t1 where ujis=ujis2 order by ujis; +END +OUTPUT +select hex(ujis), hex(ucs2), hex(ujis2), `name` from t1 where ujis = ujis2 order by ujis asc +END +INPUT +select hex(substr(_ucs2 0x00e400e50068,3)); +END +ERROR +syntax error at position 39 near '0x00e400e50068' +END +INPUT +select char(0xd18f using utf8); +END +ERROR +syntax error at position 25 near 'using' +END +INPUT +select count(*) + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ from t1 group by MAX_REQ; +END +OUTPUT +select count(*) + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ from t1 group by MAX_REQ +END +INPUT +select (_utf8mb4 X'616263FF'); +END +OUTPUT +select _utf8mb4 X'616263FF' from dual +END +INPUT +select unix_timestamp('1970-01-01 03:00:01'); +END +OUTPUT +select unix_timestamp('1970-01-01 03:00:01') from dual +END +INPUT +select from v; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(soundex(_utf16 0x00BF00C0)); +END +ERROR +syntax error at position 37 near '0x00BF00C0' +END +INPUT +select timestampdiff(month,'2003-02-28','2004-02-29'); +END +OUTPUT +select timestampdiff(month, '2003-02-28', '2004-02-29') from dual +END +INPUT +select hex(weight_string('a' as char(-1))); +END +ERROR +syntax error at position 38 +END +INPUT +select count(*) from t3 /bin /boot /cdrom /dev /etc /home /lib /lib32 /lib64 /libx32 /lost+found /media /mnt /opt /proc /root /run /sbin /snap /srv /swapfile /sys /tmp /usr /var must be 2 */; +END +ERROR +syntax error at position 26 +END +INPUT +select count(*) from t1 where facility IS NOT NULL; +END +OUTPUT +select count(*) from t1 where facility is not null +END +INPUT +select from (t1, t2) join (t3, t4) on (a < y and t2.b < t3.c); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select name from t1 where name between '�' and '�'; +END +OUTPUT +select `name` from t1 where `name` between '�' and '�' +END +INPUT +select from t1 where i = 1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select POSITION(_latin1'B' IN _latin1'abcd'); +END +ERROR +syntax error at position 38 near '_latin1' +END +INPUT +select from t1 where MATCH b AGAINST ("sear*" IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select b from v1 vq1, lateral (select count(*) from v1 vq2 having vq1.b = 3) dt; +END +ERROR +syntax error at position 32 +END +INPUT +select from t1 where not a between 2 and 3; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(char(0x010203 using ucs2)); +END +ERROR +syntax error at position 31 near 'using' +END +INPUT +select ST_astext(st_difference(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_difference(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))); +END +OUTPUT +select ST_astext(st_difference(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_difference(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))) from dual +END +INPUT +select from information_schema.user_privileges where grantee like "'mysqltest_8'%"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a.ROUTINE_NAME from information_schema.ROUTINES a, information_schema.SCHEMATA b where a.ROUTINE_SCHEMA = b.SCHEMA_NAME AND b.SCHEMA_NAME='test' ORDER BY a.ROUTINE_NAME; +END +OUTPUT +select a.ROUTINE_NAME from information_schema.ROUTINES as a, information_schema.SCHEMATA as b where a.ROUTINE_SCHEMA = b.SCHEMA_NAME and b.SCHEMA_NAME = 'test' order by a.ROUTINE_NAME asc +END +INPUT +select date_format(concat('19980131',131415),'%H|%I|%k|%l|%i|%p|%r|%S|%T| %M|%W|%D|%Y|%y|%a|%b|%j|%m|%d|%h|%s|%w'); +END +OUTPUT +select date_format(concat('19980131', 131415), '%H|%I|%k|%l|%i|%p|%r|%S|%T| %M|%W|%D|%Y|%y|%a|%b|%j|%m|%d|%h|%s|%w') from dual +END +INPUT +select round(1.5, 2147483640), truncate(1.5, 2147483640); +END +OUTPUT +select round(1.5, 2147483640), truncate(1.5, 2147483640) from dual +END +INPUT +select count(*) from t2 where id2 > 90; +END +OUTPUT +select count(*) from t2 where id2 > 90 +END +INPUT +select from non_qualif; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A' COLLATE koi8r_bin; +END +ERROR +syntax error at position 25 near 'COLLATE' +END +INPUT +select from renamed_general_log; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 1, 1.0, -1, "hello", NULL; +END +OUTPUT +select 1, 1.0, -1, 'hello', null from dual +END +INPUT +select min(a3) from t1 where 2 = a2; +END +OUTPUT +select min(a3) from t1 where 2 = a2 +END +INPUT +select from t1 where not(a is not null); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select format(pi(), (select 3 from dual)); +END +OUTPUT +select format(pi(), (select 3 from dual)) from dual +END +INPUT +select i, count(*), variance(o1/o2) from bug22555 group by i order by i; +END +OUTPUT +select i, count(*), variance(o1 / o2) from bug22555 group by i order by i asc +END +INPUT +select count(*) as count_col1 from t1 group by col1 having col1 = 10; +END +OUTPUT +select count(*) as count_col1 from t1 group by col1 having col1 = 10 +END +INPUT +select from `information_schema`.`STATISTICS` where `TABLE_SCHEMA` = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select table_name, auto_increment from information_schema.tables where table_schema = 'test' and table_name in ('t1', 't2'); +END +OUTPUT +select table_name, `auto_increment` from information_schema.`tables` where table_schema = 'test' and table_name in ('t1', 't2') +END +INPUT +select from t1 where uncompress(a) is null; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select row('A','b','c') = row('a','b','c'); +END +OUTPUT +select row('A', 'b', 'c') = row('a', 'b', 'c') from dual +END +INPUT +select count(bags.a) from t1 as Bags; +END +OUTPUT +select count(bags.a) from t1 as Bags +END +INPUT +select repeat('hello', -4294967296); +END +OUTPUT +select repeat('hello', -4294967296) from dual +END +INPUT +select '^^: The above should be ~= 8 + cost(select from t1). Value less than 8 is an error' Z; +END +OUTPUT +select '^^: The above should be ~= 8 + cost(select from t1). Value less than 8 is an error' as Z from dual +END +INPUT +select truncate(cast(-2 as unsigned), 1), truncate(18446744073709551614, 1), truncate(-2, 1); +END +OUTPUT +select truncate(convert(-2, unsigned), 1), truncate(18446744073709551614, 1), truncate(-2, 1) from dual +END +INPUT +select insert('hello', -4294967296, 1, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select from t1 natural join t2 natural join t3 natural join t4; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a1,a2,b, max(c) from t2 where a1 < 'd' group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c) from t2 where a1 < 'd' group by a1, a2, b +END +INPUT +select from t2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select truncate(4, cast(-2 as unsigned)), truncate(4, 18446744073709551614), truncate(4, -2); +END +OUTPUT +select truncate(4, convert(-2, unsigned)), truncate(4, 18446744073709551614), truncate(4, -2) from dual +END +INPUT +select timestampdiff(year,'2004-02-29','2005-02-28'); +END +OUTPUT +select timestampdiff(year, '2004-02-29', '2005-02-28') from dual +END +INPUT +select from t1 where tt like 'Aa%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A'; +END +ERROR +syntax error at position 25 near 'COLLATE' +END +INPUT +select hex(l), hex(r) from t1; +END +OUTPUT +select hex(l), hex(r) from t1 +END +INPUT +select length(repeat("a",1000000)),length(concat(repeat("a",32000),repeat("a",32000),repeat("a",32000))),length(replace("aaaaa","a",concat(repeat("a",32000)))),length(insert(repeat("a",48000),1,1000,repeat("a",48000))); +END +ERROR +syntax error at position 174 near 'insert' +END +INPUT +select a1,a2,b,min(c),max(c) from t2 where (a2 >= 'b') and (b = 'a') and (c > 'b111') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t2 where a2 >= 'b' and b = 'a' and c > 'b111' group by a1, a2, b +END +INPUT +select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B order by binary t1.a,t2.a; +END +OUTPUT +select t1.*, t2.* from t1, t1 as t2 where t1.A = t2.B order by binary t1.a asc, t2.a asc +END +INPUT +select from information_schema.parameters where specific_schema='test'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where firstname='john' and firstname like binary 'john'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 2 between null and 1,2 between 3 AND NULL,NULL between 1 and 2,2 between NULL and 3, 2 between 1 AND null; +END +OUTPUT +select 2 between null and 1, 2 between 3 and null, null between 1 and 2, 2 between null and 3, 2 between 1 and null from dual +END +INPUT +select text1, length(text1) from t1 order by binary text1; +END +OUTPUT +select text1, length(text1) from t1 order by binary text1 asc +END +INPUT +select from t2 having MATCH inhalt AGAINST ('foobar'); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 0, ST_Within(ST_GeomFromText('LINESTRING(15 15, 50 50, 60 60)'), ST_GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')); +END +OUTPUT +select 0, ST_Within(ST_GeomFromText('LINESTRING(15 15, 50 50, 60 60)'), ST_GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')) from dual +END +INPUT +select a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using (a) left join t1 as t4 using (a) left join t1 as t5 using (a) left join t1 as t6 using (a) left join t1 as t7 using (a) left join t1 as t8 using (a) left join t1 as t9 using (a) left join t1 as t10 using (a) left join t1 as t11 using (a) left join t1 as t12 using (a) left join t1 as t13 using (a) left join t1 as t14 using (a) left join t1 as t15 using (a) left join t1 as t16 using (a) left join t1 as t17 using (a) left join t1 as t18 using (a) left join t1 as t19 using (a) left join t1 as t20 using (a) left join t1 as t21 using (a) left join t1 as t22 using (a) left join t1 as t23 using (a) left join t1 as t24 using (a) left join t1 as t25 using (a) left join t1 as t26 using (a) left join t1 as t27 using (a) left join t1 as t28 using (a) left join t1 as t29 using (a) left join t1 as t30 using (a) left join t1 as t31 using (a) left join t1 as t32 using (a) left join t1 as t33 using (a) left join t1 as t34 using (a) left join t1 as t35 using (a) left join t1 as t36 using (a) left join t1 as t37 using (a) left join t1 as t38 using (a) left join t1 as t39 using (a) left join t1 as t40 using (a) left join t1 as t41 using (a) left join t1 as t42 using (a) left join t1 as t43 using (a) left join t1 as t44 using (a) left join t1 as t45 using (a) left join t1 as t46 using (a) left join t1 as t47 using (a) left join t1 as t48 using (a) left join t1 as t49 using (a) left join t1 as t50 using (a) left join t1 as t51 using (a) left join t1 as t52 using (a) left join t1 as t53 using (a) left join t1 as t54 using (a) left join t1 as t55 using (a) left join t1 as t56 using (a) left join t1 as t57 using (a) left join t1 as t58 using (a) left join t1 as t59 using (a) left join t1 as t60 using (a) left join t1 as t61 using (a) left join t1 as t62 using (a) left join t1 as t63 using (a) left join t1 as t64 using (a) left join t1 as t65 using (a); +END +OUTPUT +select a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using (a) left join t1 as t4 using (a) left join t1 as t5 using (a) left join t1 as t6 using (a) left join t1 as t7 using (a) left join t1 as t8 using (a) left join t1 as t9 using (a) left join t1 as t10 using (a) left join t1 as t11 using (a) left join t1 as t12 using (a) left join t1 as t13 using (a) left join t1 as t14 using (a) left join t1 as t15 using (a) left join t1 as t16 using (a) left join t1 as t17 using (a) left join t1 as t18 using (a) left join t1 as t19 using (a) left join t1 as t20 using (a) left join t1 as t21 using (a) left join t1 as t22 using (a) left join t1 as t23 using (a) left join t1 as t24 using (a) left join t1 as t25 using (a) left join t1 as t26 using (a) left join t1 as t27 using (a) left join t1 as t28 using (a) left join t1 as t29 using (a) left join t1 as t30 using (a) left join t1 as t31 using (a) left join t1 as t32 using (a) left join t1 as t33 using (a) left join t1 as t34 using (a) left join t1 as t35 using (a) left join t1 as t36 using (a) left join t1 as t37 using (a) left join t1 as t38 using (a) left join t1 as t39 using (a) left join t1 as t40 using (a) left join t1 as t41 using (a) left join t1 as t42 using (a) left join t1 as t43 using (a) left join t1 as t44 using (a) left join t1 as t45 using (a) left join t1 as t46 using (a) left join t1 as t47 using (a) left join t1 as t48 using (a) left join t1 as t49 using (a) left join t1 as t50 using (a) left join t1 as t51 using (a) left join t1 as t52 using (a) left join t1 as t53 using (a) left join t1 as t54 using (a) left join t1 as t55 using (a) left join t1 as t56 using (a) left join t1 as t57 using (a) left join t1 as t58 using (a) left join t1 as t59 using (a) left join t1 as t60 using (a) left join t1 as t61 using (a) left join t1 as t62 using (a) left join t1 as t63 using (a) left join t1 as t64 using (a) left join t1 as t65 using (a) +END +INPUT +select upper(a),upper(b) from t1; +END +OUTPUT +select upper(a), upper(b) from t1 +END +INPUT +select DATE_ADD('20071108181000', INTERVAL 1 DAY); +END +OUTPUT +select DATE_ADD('20071108181000', interval 1 DAY) from dual +END +INPUT +select sha('abc'); +END +OUTPUT +select sha('abc') from dual +END +INPUT +select st_overlaps(ST_GeometryFromText('geometrycollection(polygon((0 0, 2 0, 2 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 3 0, 3 1, 1 1, 1 0)))')); +END +OUTPUT +select st_overlaps(ST_GeometryFromText('geometrycollection(polygon((0 0, 2 0, 2 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 3 0, 3 1, 1 1, 1 0)))')) from dual +END +INPUT +select 1, min(1) from t1i where 1=99; +END +OUTPUT +select 1, min(1) from t1i where 1 = 99 +END +INPUT +select left(1234, 3) + 0; +END +OUTPUT +select left(1234, 3) + 0 from dual +END +INPUT +select 'b' between 'a' and 'c', 'B' between 'a' and 'c'; +END +OUTPUT +select 'b' between 'a' and 'c', 'B' between 'a' and 'c' from dual +END +INPUT +select concat(a,if(b<10,_ucs2 0x0061,_ucs2 0x0062)) from t1; +END +ERROR +syntax error at position 37 near '0x0061' +END +INPUT +select from t1 order by name; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_croatian_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_croatian_ci +END +INPUT +select grp,group_concat(c order by c separator ",") from t1 group by grp; +END +OUTPUT +select grp, group_concat(c order by c asc separator ',') from t1 group by grp +END +INPUT +select std(o) from bug22555 group by i; +END +OUTPUT +select std(o) from bug22555 group by i +END +INPUT +select right('hello', 18446744073709551615); +END +OUTPUT +select right('hello', 18446744073709551615) from dual +END +INPUT +select create_options from information_schema.tables where table_schema="test"; +END +OUTPUT +select create_options from information_schema.`tables` where table_schema = 'test' +END +INPUT +select concat(a,'.') from t1 where a='a '; +END +OUTPUT +select concat(a, '.') from t1 where a = 'a ' +END +INPUT +select concat('|', text1, '|') from t1 order by text1; +END +OUTPUT +select concat('|', text1, '|') from t1 order by text1 asc +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_lithuanian_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_lithuanian_ci +END +INPUT +select t2 from t2; +END +OUTPUT +select t2 from t2 +END +INPUT +select md5('hello'); +END +OUTPUT +select md5('hello') from dual +END +INPUT +select "Test delimiter :; +END +ERROR +syntax error at position 26 near 'Test delimiter :;' +END +INPUT +select space(-4294967297); +END +OUTPUT +select space(-4294967297) from dual +END +INPUT +select from t1 where MATCH(a,b) AGAINST ("indexes" IN NATURAL LANGUAGE MODE WITH QUERY EXPANSION); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(substr(_ucs2 0x00e400e50068,-2)); +END +ERROR +syntax error at position 39 near '0x00e400e50068' +END +INPUT +select count(*) from t1 where v='a '; +END +OUTPUT +select count(*) from t1 where v = 'a ' +END +INPUT +select 1, ST_Intersects(ST_GeomFromText('LINESTRING(15 15, 50 50)'), ST_GeomFromText('LINESTRING(50 15, 15 50)')); +END +OUTPUT +select 1, ST_Intersects(ST_GeomFromText('LINESTRING(15 15, 50 50)'), ST_GeomFromText('LINESTRING(50 15, 15 50)')) from dual +END +INPUT +select UNIQUE_CONSTRAINT_NAME from information_schema.referential_constraints where constraint_schema = schema(); +END +OUTPUT +select UNIQUE_CONSTRAINT_NAME from information_schema.referential_constraints where constraint_schema = schema() +END +INPUT +select 1e8 sum(distinct df) from t1; +END +ERROR +syntax error at position 16 +END +INPUT +select from t1 where soundex(a) = soundex('Test'); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*) from t1 where c like 'a%'; +END +OUTPUT +select count(*) from t1 where c like 'a%' +END +INPUT +select c cb20 from t1 where c=repeat('b',20); +END +OUTPUT +select c as cb20 from t1 where c = repeat('b', 20) +END +INPUT +select min(name),min(concat("*",name,"*")),max(name),max(concat("*",name,"*")) from t1; +END +OUTPUT +select min(`name`), min(concat('*', `name`, '*')), max(`name`), max(concat('*', `name`, '*')) from t1 +END +INPUT +select from t1 where CAST(field as DATETIME) < '2006-11-06 04:08:36.0'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(char(2557)); +END +OUTPUT +select hex(char(2557)) from dual +END +INPUT +select from t5 order by c1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select sha1(name) from bug20536; +END +OUTPUT +select sha1(`name`) from bug20536 +END +INPUT +select concat_ws(_latin1'a',_latin2'a'); +END +OUTPUT +select concat_ws(_latin1 'a', _latin2 as a) from dual +END +INPUT +select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b; +END +ERROR +syntax error at position 80 near 'b;' +END +INPUT +select t1.*, t2.*, t1.value<=>t2.value from t1, t2 where t1.id=t2.id and t1.id=1; +END +OUTPUT +select t1.*, t2.*, t1.value <=> t2.value from t1, t2 where t1.id = t2.id and t1.id = 1 +END +INPUT +select left('hello',null),left(null,1),left(null,null); +END +OUTPUT +select left('hello', null), left(null, 1), left(null, null) from dual +END +INPUT +select "abc" like "a%", "abc" not like "%d%", "a%" like "a%","abc%" like "a%%","abcd" like "a%b_%d", "a" like "%%a","abcde" like "a%_e","abc" like "abc%"; +END +OUTPUT +select 'abc' like 'a%', 'abc' not like '%d%', 'a%' like 'a%', 'abc%' like 'a%%', 'abcd' like 'a%b_%d', 'a' like '%%a', 'abcde' like 'a%_e', 'abc' like 'abc%' from dual +END +INPUT +select ST_Touches(ST_GeomFromText('LINESTRING(15 5,15 25)'),ST_GeomFromText('LINESTRING(15 5,15 25)')) as result; +END +OUTPUT +select ST_Touches(ST_GeomFromText('LINESTRING(15 5,15 25)'), ST_GeomFromText('LINESTRING(15 5,15 25)')) as result from dual +END +INPUT +select distinct a from t1 order by rand(10); +END +OUTPUT +select distinct a from t1 order by rand(10) +END +INPUT +select from words2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from (t3 join (t4 natural join t5) on (b < z)) natural join (t1 natural join t2); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select right(_utf8mb4 0xD0B0D0B2D0B2,1); +END +OUTPUT +select right(_utf8mb4 0xD0B0D0B2D0B2, 1) from dual +END +INPUT +select hex(weight_string('aa' as binary(3))); +END +ERROR +syntax error at position 40 near 'binary' +END +INPUT +select from information_schema.table_privileges; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select min(a), min(case when 1=1 then a else NULL end), min(case when 1!=1 then NULL else a end) from t1 where b=3 group by b; +END +OUTPUT +select min(a), min(case when 1 = 1 then a else null end), min(case when 1 != 1 then null else a end) from t1 where b = 3 group by b +END +INPUT +select st_touches(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_touches(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select column_name as 'Field',column_type as 'Type',is_nullable as 'Null',column_key as 'Key',column_default as 'Default',extra as 'Extra' from information_schema.columns where table_schema='mysqltest_db1' and table_name='t_column_priv_only'; +END +OUTPUT +select column_name as Field, column_type as Type, is_nullable as `Null`, column_key as `Key`, column_default as `Default`, extra as Extra from information_schema.`columns` where table_schema = 'mysqltest_db1' and table_name = 't_column_priv_only' +END +INPUT +select dayname("1962-03-03"),dayname("1962-03-03")+0; +END +OUTPUT +select dayname('1962-03-03'), dayname('1962-03-03') + 0 from dual +END +INPUT +select from t1 left join t2 on (venue_id = entity_id and match(name) against('aberdeen' in boolean mode)) where dt = '2003-05-23 19:30:00'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select locate('HE','hello',2); +END +OUTPUT +select locate('HE', 'hello', 2) from dual +END +INPUT +select truncate(1.5, -9223372036854775808), truncate(1.5, 9223372036854775808); +END +OUTPUT +select truncate(1.5, -9223372036854775808), truncate(1.5, 9223372036854775808) from dual +END +INPUT +select {fn length("hello")}, { date "1997-10-20" }; +END +ERROR +syntax error at position 9 near '{' +END +INPUT +select cast(repeat('1',20) as unsigned); +END +OUTPUT +select convert(repeat('1', 20), unsigned) from dual +END +INPUT +select hex(conv(convert('123' using utf16), 10, 16)); +END +OUTPUT +select hex(conv(convert('123' using utf16), 10, 16)) from dual +END +INPUT +select unix_timestamp(@a); +END +OUTPUT +select unix_timestamp(@a) from dual +END +INPUT +select from information_schema.column_privileges; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where x=1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t3 where a = 10; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select ifnull(a,'') from t1; +END +OUTPUT +select ifnull(a, '') from t1 +END +INPUT +select fld1,fld3 FROM t2 where companynr = 37 and fld3 like 'f%'; +END +OUTPUT +select fld1, fld3 from t2 where companynr = 37 and fld3 like 'f%' +END +INPUT +select lpad('hello', -4294967295, '1'); +END +OUTPUT +select lpad('hello', -4294967295, '1') from dual +END +INPUT +select ST_astext(ST_geomfromwkb(ST_AsWKB(st_intersection(linestring(point(-59,82),point(32,29)), point(2,-5))))) as result; +END +OUTPUT +select ST_astext(ST_geomfromwkb(ST_AsWKB(st_intersection(linestring(point(-59, 82), point(32, 29)), point(2, -5))))) as result from dual +END +INPUT +select event_name from performance_schema.events_stages_history_long where thread_id = @con1_thread_id and event_name like '%Opening %tables' or event_name like '%Locking system tables' or event_name like '%System lock'; +END +OUTPUT +select event_name from performance_schema.events_stages_history_long where thread_id = @con1_thread_id and event_name like '%Opening %tables' or event_name like '%Locking system tables' or event_name like '%System lock' +END +INPUT +select from t1 where a = 736494; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select @@collation_connection; +END +OUTPUT +select @@collation_connection from dual +END +INPUT +select substring_index('the king of the the hill',' ',-4); +END +OUTPUT +select substring_index('the king of the the hill', ' ', -4) from dual +END +INPUT +select _ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%') collate ujis_bin; +END +ERROR +syntax error at position 24 near '0xa1a2a1a3' +END +INPUT +select concat(a, if(b>10, 'x' 'x', 'y' 'y')) from t1; +END +OUTPUT +select concat(a, if(b > 10, 'x' as x, 'y' as y)) from t1 +END +INPUT +select from `information_schema`.`COLUMNS` where `TABLE_NAME` = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select f1 from t1 where cast("2006-1-1" as date) between f1 and cast('zzz' as date); +END +OUTPUT +select f1 from t1 where convert('2006-1-1', date) between f1 and convert('zzz', date) +END +INPUT +select from t1 where a=1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1, (select from t3) as t where t.a =5 order by 1, 2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*) from t1 where match a against ('aaax*' in boolean mode); +END +ERROR +syntax error at position 38 near 'a' +END +INPUT +select extract(DAY_SECOND FROM "225 10:11:12"); +END +ERROR +syntax error at position 31 near 'FROM' +END +INPUT +select from t1 where c2 = 3; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select distinct a from t1 order by a desc; +END +OUTPUT +select distinct a from t1 order by a desc +END +INPUT +select ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('POINT(20 20)'))); +END +OUTPUT +select ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('POINT(20 20)'))) from dual +END +INPUT +select group_concat(bar order by concat(bar,bar)) from t1; +END +OUTPUT +select group_concat(bar order by concat(bar, bar) asc) from t1 +END +INPUT +select concat_ws(NULL,'a'),concat_ws(',',NULL,''); +END +OUTPUT +select concat_ws(null, 'a'), concat_ws(',', null, '') from dual +END +INPUT +select extract(SECOND_MICROSECOND FROM "1999-01-02 10:11:12.000123"); +END +ERROR +syntax error at position 39 near 'FROM' +END +INPUT +select instr('hello','HE'), instr('hello',binary 'HE'), instr(binary 'hello','HE'); +END +OUTPUT +select instr('hello', 'HE'), instr('hello', binary 'HE'), instr(binary 'hello', 'HE') from dual +END +INPUT +select c1 mod 50 as result from t1; +END +OUTPUT +select c1 % 50 as result from t1 +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_spanish2_ci +END +INPUT +select benchmark(NULL, NULL); +END +OUTPUT +select benchmark(null, null) from dual +END +INPUT +select concat("-",a,"-",b,"-") from t1 where b="hello"; +END +OUTPUT +select concat('-', a, '-', b, '-') from t1 where b = 'hello' +END +INPUT +select from t1 union select from t2 order by 1 limit 1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 join t2 using (a1) join t3 on b=c1 join t4 using (c2); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(left(c,1)) from t1 group by c; +END +OUTPUT +select hex(left(c, 1)) from t1 group by c +END +INPUT +select substring_index(null,'the',3); +END +OUTPUT +select substring_index(null, 'the', 3) from dual +END +INPUT +select from t1 where s1 = 'cH' and s1 <> 'ch'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select find_in_set("abc","abc"),find_in_set("ab","abc"),find_in_set("abcd","abc"); +END +OUTPUT +select find_in_set('abc', 'abc'), find_in_set('ab', 'abc'), find_in_set('abcd', 'abc') from dual +END +INPUT +select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b; +END +OUTPUT +select distinct a1, a2, b from t1 where a1 > 'a' and a2 > 'a' and b = 'c' group by a1, a2, b +END +INPUT +select t1.*, t1.* as 'with_alias' from t1; +END +ERROR +syntax error at position 21 near 'as' +END +INPUT +select POSITION(_latin1'B' COLLATE latin1_general_ci IN _latin1'abcd' COLLATE latin1_bin); +END +ERROR +syntax error at position 64 near '_latin1' +END +INPUT +select charset(user()); +END +OUTPUT +select charset(user()) from dual +END +INPUT +select mbrtouches(ST_GeomFromText("point(2 4)"), ST_GeomFromText("linestring(2 0, 2 6)")); +END +OUTPUT +select mbrtouches(ST_GeomFromText('point(2 4)'), ST_GeomFromText('linestring(2 0, 2 6)')) from dual +END +INPUT +select substring_index('aaaaaaaaa1','aa',-1); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aa', -1) from dual +END +INPUT +select table_name, data_type, column_type from information_schema.columns where column_name = 'numeric_precision' and table_schema = 'information_schema'; +END +OUTPUT +select table_name, data_type, column_type from information_schema.`columns` where column_name = 'numeric_precision' and table_schema = 'information_schema' +END +INPUT +select from `information_schema`.`TABLE_CONSTRAINTS` where `TABLE_NAME` = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select md5(name) from bug20536; +END +OUTPUT +select md5(`name`) from bug20536 +END +INPUT +select strcmp(date_format(utc_timestamp(),"%Y-%m-%d"), utc_date())=0; +END +OUTPUT +select strcmp(date_format(utc_timestamp(), '%Y-%m-%d'), utc_date()) = 0 from dual +END +INPUT +select count(*) from t_event3; +END +OUTPUT +select count(*) from t_event3 +END +INPUT +select locate(0xa2a1,0xa1a2a1a3); +END +OUTPUT +select locate(0xa2a1, 0xa1a2a1a3) from dual +END +INPUT +select s1 as before_delete_unicode_ci from t1 where s1 like 'ペテ%'; +END +OUTPUT +select s1 as before_delete_unicode_ci from t1 where s1 like 'ペテ%' +END +INPUT +select 1=_latin2'1'; +END +OUTPUT +select 1 = _latin2 as `1` from dual +END +INPUT +select from information_schema.collations order by id limit 1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select min(f2),max(f2) from t1; +END +OUTPUT +select min(f2), max(f2) from t1 +END +INPUT +select database() = "test"; +END +OUTPUT +select database() = 'test' from dual +END +INPUT +select substring_index('aaaaaaaaa1','aaa',1); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aaa', 1) from dual +END +INPUT +select concat(a,'.') from t1; +END +OUTPUT +select concat(a, '.') from t1 +END +INPUT +select value,description,COUNT(bug_id) from t2 left join t1 on t2.program=t1.product and t2.value=t1.component where program="AAAAA" group by value; +END +OUTPUT +select value, description, COUNT(bug_id) from t2 left join t1 on t2.program = t1.product and t2.value = t1.component where program = 'AAAAA' group by value +END +INPUT +select sql_big_result c,count(t) from t1 group by c order by c limit 10; +END +OUTPUT +select `sql_big_result` as c, count(t) from t1 group by c order by c asc limit 10 +END +INPUT +select from t3 where b in (select a from t1); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select right('hello', -4294967295); +END +OUTPUT +select right('hello', -4294967295) from dual +END +INPUT +select uuid() into @my_uuid; +END +ERROR +syntax error at position 28 near 'my_uuid' +END +INPUT +select NULLIF(NULL,NULL), NULLIF(NULL,1), NULLIF(NULL,1.0), NULLIF(NULL,"test"); +END +OUTPUT +select NULLIF(null, null), NULLIF(null, 1), NULLIF(null, 1.0), NULLIF(null, 'test') from dual +END +INPUT +select a1,a2,b,min(c),max(c) from t2 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t2 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1, a2, b +END +INPUT +select 1/*!999992*/; +END +OUTPUT +select 1 from dual +END +INPUT +select load_file("/proc/uptime"); +END +OUTPUT +select load_file('/proc/uptime') from dual +END +INPUT +select "a"<"b","a"<="b","b">="a","b">"a","a"="A","a"<>"b"; +END +OUTPUT +select 'a' < 'b', 'a' <= 'b', 'b' >= 'a', 'b' > 'a', 'a' = 'A', 'a' != 'b' from dual +END +INPUT +select strcmp('�','o�'),strcmp('�','u�'),strcmp('�','oeb'); +END +OUTPUT +select strcmp('�', 'o�'), strcmp('�', 'u�'), strcmp('�', 'oeb') from dual +END +INPUT +select from information_schema.schema_privileges where grantee like "'mysqltest_8'%"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select t1.name, t2.name, t2.id from t2 right join t1 on (t1.id = t2.owner) where t2.id is null; +END +OUTPUT +select t1.`name`, t2.`name`, t2.id from t2 right join t1 on t1.id = t2.owner where t2.id is null +END +INPUT +select 8 from t1; +END +OUTPUT +select 8 from t1 +END +INPUT +select a, MAX(b), CONCAT_WS(MAX(b), '43', '4', '5') from t1 group by a; +END +OUTPUT +select a, MAX(b), CONCAT_WS(MAX(b), '43', '4', '5') from t1 group by a +END +INPUT +select 1, st_intersects(t.geom, p.geom) from tbl_polygon t, tbl_polygon p where t.id = 'POLY1' and p.id = 'POLY2'; +END +OUTPUT +select 1, st_intersects(t.geom, p.geom) from tbl_polygon as t, tbl_polygon as p where t.id = 'POLY1' and p.id = 'POLY2' +END +INPUT +select if(u=1,st,binary st) s from t1 where st like "%a%" order by s; +END +OUTPUT +select if(u = 1, st, binary st) as s from t1 where st like '%a%' order by s asc +END +INPUT +select name, avg(value1), std(value1), variance(value1) from t1, t2 where t1.id = t2.id group by t1.id; +END +OUTPUT +select `name`, avg(value1), std(value1), variance(value1) from t1, t2 where t1.id = t2.id group by t1.id +END +INPUT +select from tm_base_temp; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 natural left join t2 where (t2.i is not null) is not null; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from mysql.db where user=@user123; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 :; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select AES_ENCRYPT(@ENCSTR, @KEYS, @IV)=AES_ENCRYPT(@ENCSTR, @KEYS, @IV1); +END +OUTPUT +select AES_ENCRYPT(@ENCSTR, @`KEYS`, @IV) = AES_ENCRYPT(@ENCSTR, @`KEYS`, @IV1) from dual +END +INPUT +select length(repeat("a",100000000)),length(repeat("a",1000*64)); +END +OUTPUT +select length(repeat('a', 100000000)), length(repeat('a', 1000 * 64)) from dual +END +INPUT +select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sum(qty)>2 and cqty>1; +END +OUTPUT +select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sum(qty) > 2 and cqty > 1 +END +INPUT +select hex(s1) from t1; +END +OUTPUT +select hex(s1) from t1 +END +INPUT +select lpad('a',4,'1'),lpad('a',4,'12'),lpad('abcd',3,'12'), lpad(11, 10 , 22); +END +OUTPUT +select lpad('a', 4, '1'), lpad('a', 4, '12'), lpad('abcd', 3, '12'), lpad(11, 10, 22) from dual +END +INPUT +select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f") as f1, str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S") as f2, str_to_date("2003-01-02", "%Y-%m-%d") as f3, str_to_date("02 10:11:12", "%d %H:%i:%S.%f") as f4, str_to_date("02 10:11:12", "%d %H:%i:%S") as f5, str_to_date("02 10", "%d %f") as f6; +END +OUTPUT +select str_to_date('2003-01-02 10:11:12.0012', '%Y-%m-%d %H:%i:%S.%f') as f1, str_to_date('2003-01-02 10:11:12.0012', '%Y-%m-%d %H:%i:%S') as f2, str_to_date('2003-01-02', '%Y-%m-%d') as f3, str_to_date('02 10:11:12', '%d %H:%i:%S.%f') as f4, str_to_date('02 10:11:12', '%d %H:%i:%S') as f5, str_to_date('02 10', '%d %f') as f6 from dual +END +INPUT +select extract(DAY_MINUTE FROM "02 10:11:12"); +END +ERROR +syntax error at position 31 near 'FROM' +END +INPUT +select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL); +END +OUTPUT +select ln(exp(10)), exp(ln(sqrt(10)) * 2), ln(-1), ln(0), ln(null) from dual +END +INPUT +select 1, @empty_geom = st_geomfromtext('geometrycollection()') as equal; +END +OUTPUT +select 1, @empty_geom = st_geomfromtext('geometrycollection()') as equal from dual +END +INPUT +select hex(convert(char(2557 using latin1) using utf8)); +END +ERROR +syntax error at position 35 near 'using' +END +INPUT +select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by t1.a; +END +OUTPUT +select group_concat(t1.b, t2.c) from t1 join t2 using (a) group by t1.a +END +INPUT +select hex(weight_string('�' as char(1))); +END +ERROR +syntax error at position 40 +END +INPUT +select 1, max(a) from t1i where 1=99; +END +OUTPUT +select 1, max(a) from t1i where 1 = 99 +END +INPUT +select t2.count, t1.name from t2 natural join t1; +END +OUTPUT +select t2.count, t1.`name` from t2 natural join t1 +END +INPUT +select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-2; +END +OUTPUT +select 1 + 1, 1 - 1, 1 + 1 * 2, 8 / 5, 8 % 5, mod(8, 5), mod(8, 5) | 0, -(1 + 1) * -2 from dual +END +INPUT +select lpad('hello', 18446744073709551616, '1'); +END +OUTPUT +select lpad('hello', 18446744073709551616, '1') from dual +END +INPUT +select date_add(time,INTERVAL 1 SECOND) from t1; +END +OUTPUT +select date_add(`time`, interval 1 SECOND) from t1 +END +INPUT +select from v3; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 natural join t2 where t1.b > t2.b; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select sum(num) from t1; +END +OUTPUT +select sum(num) from t1 +END +INPUT +select a1,a2,b,min(c) from t2 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122') or (c < 'h112') or (c = 'c111')) group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c) from t2 where (a1 > 'a' or a1 < '9') and (a2 >= 'b' and a2 < 'z') and b = 'a' and (c = 'j121' or c > 'k121' and c < 'm122' or c > 'o122' or c < 'h112' or c = 'c111') group by a1, a2, b +END +INPUT +select from t1 where a > 5 xor a < 10; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select column_name, privileges from columns where table_name='user' and column_name like '%o%' order by column_name; +END +OUTPUT +select column_name, `privileges` from `columns` where table_name = 'user' and column_name like '%o%' order by column_name asc +END +INPUT +select case when 1<0 then "TRUE" else "FALSE" END; +END +OUTPUT +select case when 1 < 0 then 'TRUE' else 'FALSE' end from dual +END +INPUT +select t1.i,t2.i,t3.i from t2 left join t3 on (t2.i=t3.i),t1 order by t1.i,t2.i,t3.i; +END +OUTPUT +select t1.i, t2.i, t3.i from t2 left join t3 on t2.i = t3.i, t1 order by t1.i asc, t2.i asc, t3.i asc +END +INPUT +select a, hex(a) from t1; +END +OUTPUT +select a, hex(a) from t1 +END +INPUT +select inet_aton("255.255.255.2551"); +END +OUTPUT +select inet_aton('255.255.255.2551') from dual +END +INPUT +select t1.id1 from t1 inner join (t3 left join v1 on t3.id3 = v1.id3); +END +OUTPUT +select t1.id1 from t1 join (t3 left join v1 on t3.id3 = v1.id3) +END +INPUT +select from t1 where find_in_set('-1', a); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select _koi8r'a' LIKE _koi8r'A'; +END +ERROR +syntax error at position 22 near 'LIKE' +END +INPUT +select from (select from t1 union select from t1) a; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(distinct n1,s) from t1; +END +OUTPUT +select count(distinct n1, s) from t1 +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_spanish2_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_spanish2_ci +END +INPUT +select i from v1 where i = 1 into k; +END +ERROR +syntax error at position 36 near 'k' +END +INPUT +select a, t1.*, b from t1; +END +OUTPUT +select a, t1.*, b from t1 +END +INPUT +select load_file(0x0A9FB76C661B409C4BEC88098C5DD71B1072F9691F2E827D7EC8F092B299868A3CE196C04F0FB18CAB4E1557EB72331D812379DE7A75CA21C32E7C722C59E5CC33EF262EF04187B0F0EE756FA984DF2EAD37B1E4ADB064C3C5038F2E3B2D661B1C1150AAEB5425512E14D7506166D92D4533872E662F4B2D1428AAB5CCA72E75AA2EF325E196A5A02E2E8278873C64375845994B0F39BE2FF7B478332A7B0AA5E48877C47B6F513E997848AF8CCB8A899F3393AB35333CF0871E36698193862D486B4B9078B70C0A0A507B8A250F3F876F5A067632D5E65193E4445A1EC3A2C9B4C6F07AC334F0F62BC33357CB502E9B1C19D2398B6972AEC2EF21630F8C9134C4F7DD662D8AD7BDC9E19C46720F334B66C22D4BF32ED275144E20E7669FFCF6FC143667C9F02A577F32960FA9F2371BE1FA90E49CBC69C01531F140556854D588DD0E55E1307D78CA38E975CD999F9AEA604266329EE62BFB5ADDA67F549E211ECFBA906C60063696352ABB82AA782D25B17E872EA587871F450446DB1BAE0123D20404A8F2D2698B371002E986C8FCB969A99FF0E150A2709E2ED7633D02ADA87D5B3C9487D27B2BD9D21E2EC3215DCC3CDCD884371281B95A2E9987AAF82EB499C058D9C3E7DC1B66635F60DB121C72F929622DD47B6B2E69F59FF2AE6B63CC2EC60FFBA20EA50569DBAB5DAEFAEB4F03966C9637AB55662EDD28439155A82D053A5299448EDB2E7BEB0F62889E2F84E6C7F34B3212C9AAC32D521D5AB8480993F1906D5450FAB342A0FA6ED223E178BAC036B81E15783604C32A961EA1EF20BE2EBB93D34ED37BC03142B7583303E4557E48551E4BD7CBDDEA146D5485A5D212C35189F0BD6497E66912D2780A59A53B532E12C0A5ED1EC0445D96E8F2DD825221CFE4A65A87AA21DC8750481B9849DD81694C3357A0ED9B78D608D8EDDE28FAFBEC17844DE5709F41E121838DB55639D77E32A259A416D7013B2EB1259FDE1B498CBB9CAEE1D601DF3C915EA91C69B44E6B72062F5F4B3C73F06F2D5AD185E1692E2E0A01E7DD5133693681C52EE13B2BE42D03BDCF48E4E133CF06662339B778E1C3034F9939A433E157449172F7969ACCE1F5D2F65A4E09E4A5D5611EBEDDDBDB0C0C0A); +END +OUTPUT +select load_file(0x0A9FB76C661B409C4BEC88098C5DD71B1072F9691F2E827D7EC8F092B299868A3CE196C04F0FB18CAB4E1557EB72331D812379DE7A75CA21C32E7C722C59E5CC33EF262EF04187B0F0EE756FA984DF2EAD37B1E4ADB064C3C5038F2E3B2D661B1C1150AAEB5425512E14D7506166D92D4533872E662F4B2D1428AAB5CCA72E75AA2EF325E196A5A02E2E8278873C64375845994B0F39BE2FF7B478332A7B0AA5E48877C47B6F513E997848AF8CCB8A899F3393AB35333CF0871E36698193862D486B4B9078B70C0A0A507B8A250F3F876F5A067632D5E65193E4445A1EC3A2C9B4C6F07AC334F0F62BC33357CB502E9B1C19D2398B6972AEC2EF21630F8C9134C4F7DD662D8AD7BDC9E19C46720F334B66C22D4BF32ED275144E20E7669FFCF6FC143667C9F02A577F32960FA9F2371BE1FA90E49CBC69C01531F140556854D588DD0E55E1307D78CA38E975CD999F9AEA604266329EE62BFB5ADDA67F549E211ECFBA906C60063696352ABB82AA782D25B17E872EA587871F450446DB1BAE0123D20404A8F2D2698B371002E986C8FCB969A99FF0E150A2709E2ED7633D02ADA87D5B3C9487D27B2BD9D21E2EC3215DCC3CDCD884371281B95A2E9987AAF82EB499C058D9C3E7DC1B66635F60DB121C72F929622DD47B6B2E69F59FF2AE6B63CC2EC60FFBA20EA50569DBAB5DAEFAEB4F03966C9637AB55662EDD28439155A82D053A5299448EDB2E7BEB0F62889E2F84E6C7F34B3212C9AAC32D521D5AB8480993F1906D5450FAB342A0FA6ED223E178BAC036B81E15783604C32A961EA1EF20BE2EBB93D34ED37BC03142B7583303E4557E48551E4BD7CBDDEA146D5485A5D212C35189F0BD6497E66912D2780A59A53B532E12C0A5ED1EC0445D96E8F2DD825221CFE4A65A87AA21DC8750481B9849DD81694C3357A0ED9B78D608D8EDDE28FAFBEC17844DE5709F41E121838DB55639D77E32A259A416D7013B2EB1259FDE1B498CBB9CAEE1D601DF3C915EA91C69B44E6B72062F5F4B3C73F06F2D5AD185E1692E2E0A01E7DD5133693681C52EE13B2BE42D03BDCF48E4E133CF06662339B778E1C3034F9939A433E157449172F7969ACCE1F5D2F65A4E09E4A5D5611EBEDDDBDB0C0C0A) from dual +END +INPUT +select schema_name from information_schema.schemata ORDER BY schema_name; +END +OUTPUT +select schema_name from information_schema.schemata order by schema_name asc +END +INPUT +select id, avg(value1), std(value1), variance(value1) from t1 group by id; +END +OUTPUT +select id, avg(value1), std(value1), variance(value1) from t1 group by id +END +INPUT +select from t1 where 'd' < s1 and s1 = 'CH'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a,b,cast(a as char character set cp1251),cast(b as binary) from t1; +END +OUTPUT +select a, b, convert(a, char character set cp1251), convert(b, binary) from t1 +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_unicode_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_unicode_ci +END +INPUT +select text1, length(text1) from t1 order by text1; +END +OUTPUT +select text1, length(text1) from t1 order by text1 asc +END +INPUT +select from t1 limit 9999999999; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t3 natural right join t2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select word, word=cast(0xdf AS CHAR) as t from t1 having t > 0; +END +OUTPUT +select word, word = convert(0xdf, CHAR) as t from t1 having t > 0 +END +INPUT +select max(t2.a1) from t1 left outer join t2 on t1.a2=t2.a1 and 1=0 where t2.a1='AAA'; +END +OUTPUT +select max(t2.a1) from t1 left join t2 on t1.a2 = t2.a1 and 1 = 0 where t2.a1 = 'AAA' +END +INPUT +select format(atan2(-2, 2), 6); +END +OUTPUT +select format(atan2(-2, 2), 6) from dual +END +INPUT +select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') or (c <= 'g1') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 where c > 'b1' or c <= 'g1' group by a1, a2, b +END +INPUT +select a, (select t2.* from t2) from t1; +END +OUTPUT +select a, (select t2.* from t2) from t1 +END +INPUT +select 1.0<=>0E1,10<=>NULL,NULL<=>0.0, NULL<=>0E0; +END +OUTPUT +select 1.0 <=> 0E1, 10 <=> null, null <=> 0.0, null <=> 0E0 from dual +END +INPUT +select hex(substr(_utf32 0x000000e4000000e500000068,-1)); +END +ERROR +syntax error at position 52 near '0x000000e4000000e500000068' +END +INPUT +select cast(9223372036854775808 as unsigned)+1; +END +OUTPUT +select convert(9223372036854775808, unsigned) + 1 from dual +END +INPUT +select if(u=1,st,st) s from t1 order by s; +END +OUTPUT +select if(u = 1, st, st) as s from t1 order by s asc +END +INPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name = 'tm' and index_name = 'w' order by table_name; +END +OUTPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name = 'tm' and index_name = 'w' order by table_name asc +END +INPUT +select from t3 order by b,a limit 3; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select distinct vs from t1; +END +OUTPUT +select distinct vs from t1 +END +INPUT +select mbrwithin(ST_GeomFromText("linestring(0 1, 3 1)"), ST_GeomFromText("polygon((0 0, 3 0, 3 3, 0 3, 0 0))")); +END +OUTPUT +select mbrwithin(ST_GeomFromText('linestring(0 1, 3 1)'), ST_GeomFromText('polygon((0 0, 3 0, 3 3, 0 3, 0 0))')) from dual +END +INPUT +select a, count(a) from t1 group by a with rollup; +END +ERROR +syntax error at position 43 near 'with' +END +INPUT +select from t1,t2 left join t3 on (t2.i=t3.i) order by t1.i,t2.i,t3.i; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select release_lock('test_bug16407'); +END +OUTPUT +select release_lock('test_bug16407') from dual +END +INPUT +select release_lock('ee_16407_5'); +END +OUTPUT +select release_lock('ee_16407_5') from dual +END +INPUT +select @b - @a; +END +OUTPUT +select @b - @a from dual +END +INPUT +select a1,a2,b,min(c) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c) from t1 where a1 > 'a' and a2 > 'a' and b = 'c' group by a1, a2, b +END +INPUT +select from t1 order by func1(a); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select repeat('hello', 4294967297); +END +OUTPUT +select repeat('hello', 4294967297) from dual +END +INPUT +select from information_schema.triggers where trigger_schema in ('mysql', 'information_schema', 'test', 'mysqltest') order by trigger_name; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select substring_index('aaaaaaaaa1','a',-1); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'a', -1) from dual +END +INPUT +select substring_index("www.tcx.se","",3); +END +OUTPUT +select substring_index('www.tcx.se', '', 3) from dual +END +INPUT +select yearweek(20001231,0), yearweek(20001231,1), yearweek(20001231,2), yearweek(20001231,3), yearweek(20001231,4), yearweek(20001231,5), yearweek(20001231,6), yearweek(20001231,7); +END +OUTPUT +select yearweek(20001231, 0), yearweek(20001231, 1), yearweek(20001231, 2), yearweek(20001231, 3), yearweek(20001231, 4), yearweek(20001231, 5), yearweek(20001231, 6), yearweek(20001231, 7) from dual +END +INPUT +select extract(MINUTE FROM "10:11:12"); +END +ERROR +syntax error at position 27 near 'FROM' +END +INPUT +select (_utf8 X'616263FF'); +END +OUTPUT +select _utf8 X'616263FF' from dual +END +INPUT +select f1, group_concat(f1+1) from t1 group by f1 with rollup; +END +ERROR +syntax error at position 55 near 'with' +END +INPUT +select substring('hello', -18446744073709551617, -18446744073709551617); +END +OUTPUT +select substr('hello', -18446744073709551617, -18446744073709551617) from dual +END +INPUT +select st_overlaps(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_overlaps(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select from (t4 natural join t5) natural join t1 where t4.y > 7; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(@a); +END +OUTPUT +select hex(@a) from dual +END +INPUT +select space(-1); +END +OUTPUT +select space(-1) from dual +END +INPUT +select from v1b join v2a on v1b.b = v2a.c; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select space(4294967295); +END +OUTPUT +select space(4294967295) from dual +END +INPUT +select str_to_date('04 /30/2004', '%m /%d/%Y'); +END +OUTPUT +select str_to_date('04 /30/2004', '%m /%d/%Y') from dual +END +INPUT +select strcmp('�','af'),strcmp('a','�'),strcmp('��','aeq'),strcmp('��','aeaeq'); +END +OUTPUT +select strcmp('�', 'af'), strcmp('a', '�'), strcmp('��', 'aeq'), strcmp('��', 'aeaeq') from dual +END +INPUT +select from t1 where a=user(); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select get_format(DATETIME, 'eur') as a; +END +OUTPUT +select get_format(`DATETIME`, 'eur') as a from dual +END +INPUT +select min(t1.a1), min(t2.a4) from t1,t2 where t1.a1 < 'KKK' and t2.a4 < 'KKK'; +END +OUTPUT +select min(t1.a1), min(t2.a4) from t1, t2 where t1.a1 < 'KKK' and t2.a4 < 'KKK' +END +INPUT +select max(7) from DUAL; +END +OUTPUT +select max(7) from dual +END +INPUT +select max(a3) from t1 where a2 = 2 and 'SEA' < a3; +END +OUTPUT +select max(a3) from t1 where a2 = 2 and 'SEA' < a3 +END +INPUT +select log10(100),log10(18),log10(-4),log10(0),log10(NULL); +END +OUTPUT +select log10(100), log10(18), log10(-4), log10(0), log10(null) from dual +END +INPUT +select from t1 order by 1,2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select lpad(f1, 12, "-o-/") from t2; +END +OUTPUT +select lpad(f1, 12, '-o-/') from t2 +END +INPUT +select from t1 where t1.a in (select a from t2) order by 1, 2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select locate('lo','hello',-4294967295); +END +OUTPUT +select locate('lo', 'hello', -4294967295) from dual +END +INPUT +select from t1 order by id; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select round(sum(a)), count(*) from t1 group by a; +END +OUTPUT +select round(sum(a)), count(*) from t1 group by a +END +INPUT +select export_set(5, name, upper(name), ",", 5) from bug20536; +END +OUTPUT +select export_set(5, `name`, upper(`name`), ',', 5) from bug20536 +END +INPUT +select cast("1:2:3" as TIME) = "1:02:03"; +END +OUTPUT +select convert('1:2:3', TIME) = '1:02:03' from dual +END +INPUT +select left('hello', -18446744073709551616); +END +OUTPUT +select left('hello', -18446744073709551616) from dual +END +INPUT +select ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))'))); +END +OUTPUT +select ST_astext(ST_Intersection(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))'))) from dual +END +INPUT +select strcmp(concat(utc_date(),' ',utc_time()),utc_timestamp())=0; +END +OUTPUT +select strcmp(concat(utc_date(), ' ', utc_time()), utc_timestamp()) = 0 from dual +END +INPUT +select from t1 where match b against ('+aaaaaa @bbbbbb' in boolean mode); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(col1) from t1; +END +OUTPUT +select hex(col1) from t1 +END +INPUT +select hex(char(1 using utf8mb4)); +END +ERROR +syntax error at position 24 near 'using' +END +INPUT +select left('hello',null), right('hello',null); +END +OUTPUT +select left('hello', null), right('hello', null) from dual +END +INPUT +select concat(':',trim(LEADING '.*' FROM '.*my'),':',trim(TRAILING '.*' FROM 'sql.*.*'),':'); +END +ERROR +syntax error at position 41 near 'FROM' +END +INPUT +select max(t1.a2) from t1 left outer join t2 on t1.a1=10; +END +OUTPUT +select max(t1.a2) from t1 left join t2 on t1.a1 = 10 +END +INPUT +select a1,a2,b,min(c),max(c) from t1 where (c < 'k321') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 where c < 'k321' group by a1, a2, b +END +INPUT +select get_lock('bug27638', 2); +END +OUTPUT +select get_lock('bug27638', 2) from dual +END +INPUT +select substring('hello', -4294967296, -4294967296); +END +OUTPUT +select substr('hello', -4294967296, -4294967296) from dual +END +INPUT +select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4 group by t1.c1; +END +OUTPUT +select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4 group by t1.c1 +END +INPUT +select left('hello', 18446744073709551615); +END +OUTPUT +select left('hello', 18446744073709551615) from dual +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_lithuanian_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_lithuanian_ci +END +INPUT +select from t1 where id <=> value or value<=>id; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a1,a2,b, max(c) from t1 where (c > 'f123') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c) from t1 where c > 'f123' group by a1, a2, b +END +INPUT +select a1,a2,b, max(c) from t2 where (b = 'b') group by a1,a2; +END +OUTPUT +select a1, a2, b, max(c) from t2 where b = 'b' group by a1, a2 +END +INPUT +select a, hex(a) from t1 order by a; +END +OUTPUT +select a, hex(a) from t1 order by a asc +END +INPUT +select t1.a as str, length(t1.a) as str_length, t2.a as pos, t2.a + 10 as length, insert(t1.a, t2.a, t2.a + 10, '1234567') as 'insert' from t1, t2; +END +ERROR +syntax error at position 89 near 'insert' +END +INPUT +select from mysql.slow_log; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select substring('hello', -2, 1); +END +OUTPUT +select substr('hello', -2, 1) from dual +END +INPUT +select right('hello', 4294967296); +END +OUTPUT +select right('hello', 4294967296) from dual +END +INPUT +select 'Contains2'; +END +OUTPUT +select 'Contains2' from dual +END +INPUT +select min(a2), a1, max(a2), min(a2), a1 from t1 group by a1; +END +OUTPUT +select min(a2), a1, max(a2), min(a2), a1 from t1 group by a1 +END +INPUT +select distinct b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b; +END +OUTPUT +select distinct b from t1 where a2 >= 'b' and b = 'a' group by a1, a2, b +END +INPUT +select distinct a1 from t4 where pk_col not in (1,2,3,4); +END +OUTPUT +select distinct a1 from t4 where pk_col not in (1, 2, 3, 4) +END +INPUT +select a as 'x', t1.* as 'with_alias' from t1; +END +ERROR +syntax error at position 25 near 'as' +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_romanian_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_romanian_ci +END +INPUT +select format(atan(pi(), 0), 6); +END +OUTPUT +select format(atan(pi(), 0), 6) from dual +END +INPUT +select 9223372036854775807,-009223372036854775808; +END +OUTPUT +select 9223372036854775807, -009223372036854775808 from dual +END +INPUT +select TABLE_NAME from information_schema.tables where table_schema='test' order by TABLE_NAME; +END +OUTPUT +select TABLE_NAME from information_schema.`tables` where table_schema = 'test' order by TABLE_NAME asc +END +INPUT +select from ((t3 natural join (t1 natural join t2)) natural join t4) natural join t5; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select t1.* from t t0 cross join t t1 join t t2 on 100=(select count(*) from t t3 left join t t4 on t4.a>t3.a-t0.a); +END +OUTPUT +select t1.* from t as t0 join t as t1 join t as t2 on 100 = (select count(*) from t as t3 left join t as t4 on t4.a > t3.a - t0.a) +END +INPUT +select d from (select a as d, 2*a as two from t) dt; +END +OUTPUT +select d from (select a as d, 2 * a as two from t) as dt +END +INPUT +select from t1 union distinct select from t2 union all select from t3; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select "CASE" as "LOWER"; +END +OUTPUT +select 'CASE' as LOWER from dual +END +INPUT +select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2; +END +OUTPUT +select t1.*, t2.* from mysqltest_1.t1, mysqltest_1.t2 +END +INPUT +select unhex('5078-04-25'); +END +OUTPUT +select unhex('5078-04-25') from dual +END +INPUT +select ST_astext(g) from t1 where ST_Contains(ST_GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1), (5.01 3.01, 6 5, 9 5, 8 3, 5.01 3.01))'), g); +END +OUTPUT +select ST_astext(g) from t1 where ST_Contains(ST_GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1), (5.01 3.01, 6 5, 9 5, 8 3, 5.01 3.01))'), g) +END +INPUT +select week(19981231,0) as '0', week(19981231,1) as '1', week(19981231,2) as '2', week(19981231,3) as '3', week(19981231,4) as '4', week(19981231,5) as '5', week(19981231,6) as '6', week(19981231,7) as '7'; +END +OUTPUT +select week(19981231, 0) as `0`, week(19981231, 1) as `1`, week(19981231, 2) as `2`, week(19981231, 3) as `3`, week(19981231, 4) as `4`, week(19981231, 5) as `5`, week(19981231, 6) as `6`, week(19981231, 7) as `7` from dual +END +INPUT +select period_diff(-9223372036854775808,201902); +END +OUTPUT +select period_diff(-9223372036854775808, 201902) from dual +END +INPUT +select week(20001231),week(20001231,2),week(20001231,0); +END +OUTPUT +select week(20001231), week(20001231, 2), week(20001231, 0) from dual +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL "1:1:1" HOUR_SECOND); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval '1:1:1' HOUR_SECOND) from dual +END +INPUT +select from v2a; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select repeat('hello', -18446744073709551617); +END +OUTPUT +select repeat('hello', -18446744073709551617) from dual +END +INPUT +select concat(_latin1'a',_latin2'a',_latin5'a'); +END +OUTPUT +select concat(_latin1 'a', _latin2 as a, _latin5 as a) from dual +END +INPUT +select 1.0<=>0.0,0.0<=>NULL,NULL<=>0.0; +END +OUTPUT +select 1.0 <=> 0.0, 0.0 <=> null, null <=> 0.0 from dual +END +INPUT +select from t1 where a like '2004-03-11 12:00:21'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select _koi8r'a' COLLATE koi8r_general_ci = _koi8r'A'; +END +ERROR +syntax error at position 25 near 'COLLATE' +END +INPUT +select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_bin; +END +ERROR +syntax error at position 22 near 'LIKE' +END +INPUT +select from t1 where str is not null order by id; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select b + interval a day from t1; +END +OUTPUT +select b + interval a day from t1 +END +INPUT +select 1, ST_Intersects(ST_GeomFromText('POLYGON((0 0,20 0,20 20,0 20,0 0))'), ST_GeomFromText('POLYGON((10 10,30 10,30 30,10 30,10 10))')); +END +OUTPUT +select 1, ST_Intersects(ST_GeomFromText('POLYGON((0 0,20 0,20 20,0 20,0 0))'), ST_GeomFromText('POLYGON((10 10,30 10,30 30,10 30,10 10))')) from dual +END +INPUT +select st_astext(st_union(ST_GeometryFromText('geometrycollection(polygon((0 0, 2 0, 2 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 3 0, 3 1, 1 1, 1 0)))'))); +END +OUTPUT +select st_astext(st_union(ST_GeometryFromText('geometrycollection(polygon((0 0, 2 0, 2 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 3 0, 3 1, 1 1, 1 0)))'))) from dual +END +INPUT +select _latin1'a' regexp _latin1'A' collate latin1_general_ci; +END +OUTPUT +select _latin1 'a' regexp _latin1 'A' collate latin1_general_ci from dual +END +INPUT +select timestamp("2001-12-01", "01:01:01.999999"); +END +OUTPUT +select timestamp('2001-12-01', '01:01:01.999999') from dual +END +INPUT +select hex(convert(0xFF using utf8mb4)); +END +OUTPUT +select hex(convert(0xFF using utf8mb4)) from dual +END +INPUT +select count(distinct if(f1,3,f2)) from t1; +END +OUTPUT +select count(distinct if(f1, 3, f2)) from t1 +END +INPUT +select repeat(_utf8mb4'+',3) as h union select NULL; +END +OUTPUT +(select repeat(_utf8mb4 '+', 3) as h from dual) union (select null from dual) +END +INPUT +select insert('hello', -4294967295, -4294967295, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select strcmp('af','�'),strcmp('�','a'),strcmp('aeq','��'),strcmp('aeaeq','��'); +END +OUTPUT +select strcmp('af', '�'), strcmp('�', 'a'), strcmp('aeq', '��'), strcmp('aeaeq', '��') from dual +END +INPUT +select hex(_utf32 0x44); +END +ERROR +syntax error at position 23 near '0x44' +END +INPUT +select timestampdiff(SQL_TSI_WEEK, '2001-02-01', '2001-05-01') as a; +END +OUTPUT +select timestampdiff(SQL_TSI_WEEK, '2001-02-01', '2001-05-01') as a from dual +END +INPUT +select a, MAX(b), INTERVAL (MAX(b), 1,3,10,30,39,40,50,60,100,1000) from t1 group by a; +END +ERROR +syntax error at position 73 near 'from' +END +INPUT +select d as e, two as f from v; +END +OUTPUT +select d as e, two as f from v +END +INPUT +select t2.fld3 FROM t2 where fld3 LIKE 'don_t_find_me_please%'; +END +OUTPUT +select t2.fld3 from t2 where fld3 like 'don_t_find_me_please%' +END +INPUT +select 1, max(1) from t1m where 1=99; +END +OUTPUT +select 1, max(1) from t1m where 1 = 99 +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_slovak_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_slovak_ci +END +INPUT +select export_set(9,"Y","N","-",5),export_set(9,"Y","N"),export_set(9,"Y","N",""); +END +OUTPUT +select export_set(9, 'Y', 'N', '-', 5), export_set(9, 'Y', 'N'), export_set(9, 'Y', 'N', '') from dual +END +INPUT +select from t1 where a like '%PESKA%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where MATCH(a,b) AGAINST("+search" IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select repeat('hello', 18446744073709551616); +END +OUTPUT +select repeat('hello', 18446744073709551616) from dual +END +INPUT +select a1, min(a2) from t1 group by a1; +END +OUTPUT +select a1, min(a2) from t1 group by a1 +END +INPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name = 'tm' and index_name = 'q' order by table_name; +END +OUTPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name = 'tm' and index_name = 'q' order by table_name asc +END +INPUT +select ST_DISTANCE(ST_GeomFromText('linestring(0 0, 3 6, 6 3, 0 0)'), ST_GeomFromText('polygon((2 2, 3 4, 4 3, 2 2))')); +END +OUTPUT +select ST_DISTANCE(ST_GeomFromText('linestring(0 0, 3 6, 6 3, 0 0)'), ST_GeomFromText('polygon((2 2, 3 4, 4 3, 2 2))')) from dual +END +INPUT +select distinct t1_outer.a from t1 t1_outer order by (select max(t1_outer.b+t1_inner.b) from t1 t1_inner); +END +OUTPUT +select distinct t1_outer.a from t1 as t1_outer order by (select max(t1_outer.b + t1_inner.b) from t1 as t1_inner) asc +END +INPUT +select from slow_log; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name like 't%' and index_name = 'p' order by table_name; +END +OUTPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name like 't%' and index_name = 'p' order by table_name asc +END +INPUT +select last_day('2000-02-05') as a, from_days(to_days("960101")) as b; +END +OUTPUT +select last_day('2000-02-05') as a, from_days(to_days('960101')) as b from dual +END +INPUT +select t1.*, t2.* from t1 natural join t2; +END +OUTPUT +select t1.*, t2.* from t1 natural join t2 +END +INPUT +select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='' AND TABLE_NAME=''; +END +OUTPUT +select count(*) from INFORMATION_SCHEMA.`TABLES` where TABLE_SCHEMA = '' and TABLE_NAME = '' +END +INPUT +select insert('hello', 4294967297, 1, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select insert('hello', 18446744073709551617, 18446744073709551617, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select from t1 where a is null; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select collation(soundex(_latin2'ab')), coercibility(soundex(_latin2'ab')); +END +OUTPUT +select collation(soundex(_latin2 as ab)), coercibility(soundex(_latin2 as ab)) from dual +END +INPUT +select distinct t1.a from t1, t2 where t1.b = t2.b order by 1; +END +OUTPUT +select distinct t1.a from t1, t2 where t1.b = t2.b order by 1 asc +END +INPUT +select ' вася' rlike '[[:<:]]вася[[:>:]]'; +END +OUTPUT +select ' вася' regexp '[[:<:]]вася[[:>:]]' from dual +END +INPUT +select POSITION(_latin1'B' IN _latin2'abcd'); +END +ERROR +syntax error at position 38 near '_latin2' +END +INPUT +select t1.id, t1.data, t2.data from t1, t2 where t1.id = t2.id order by t1.id; +END +OUTPUT +select t1.id, t1.`data`, t2.`data` from t1, t2 where t1.id = t2.id order by t1.id asc +END +INPUT +select a1,a2,b,min(c),max(c) from t1 where (c < 'a0') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 where c < 'a0' group by a1, a2, b +END +INPUT +select from t1 where not(a < 15 and a > 5); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where a=_koi8r'����'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select text1, length(text1) from t1 where text1='teststring' or text1 like 'teststring_%'; +END +OUTPUT +select text1, length(text1) from t1 where text1 = 'teststring' or text1 like 'teststring_%' +END +INPUT +select a1,a2,b, max(c) from t1 where (c > 'b1') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c) from t1 where c > 'b1' group by a1, a2, b +END +INPUT +select hex(weight_string('�')); +END +OUTPUT +select hex(weight_string('�')) from dual +END +INPUT +select CAST(0xfffffffffffffffe as signed); +END +OUTPUT +select convert(0xfffffffffffffffe, signed) from dual +END +INPUT +select release_lock('ee_16407_2'); +END +OUTPUT +select release_lock('ee_16407_2') from dual +END +INPUT +select insert('hello', 18446744073709551616, 18446744073709551616, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select date_add("1997-12-31 23:59:59.000002",INTERVAL "999999" MICROSECOND); +END +OUTPUT +select date_add('1997-12-31 23:59:59.000002', interval '999999' MICROSECOND) from dual +END +INPUT +select inet_aton("122.226."); +END +OUTPUT +select inet_aton('122.226.') from dual +END +INPUT +select from v1 where id=1000 group by id; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 1 from t1 order by 2; +END +OUTPUT +select 1 from t1 order by 2 asc +END +INPUT +select max(a) as b from t1 having b=1; +END +OUTPUT +select max(a) as b from t1 having b = 1 +END +INPUT +select @invoked; +END +OUTPUT +select @invoked from dual +END +INPUT +select POSITION(_latin1'B' IN _latin1'abcd' COLLATE latin1_bin); +END +ERROR +syntax error at position 38 near '_latin1' +END +INPUT +select concat(a,'.') from t1 where a='aaa'; +END +OUTPUT +select concat(a, '.') from t1 where a = 'aaa' +END +INPUT +select from t1 where a = 2 or not(a < 5 or a > 15); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 'e'='`'; +END +OUTPUT +select 'e' = '`' from dual +END +INPUT +select min(7) from t2i join t1i; +END +OUTPUT +select min(7) from t2i join t1i +END +INPUT +select right('hello', 18446744073709551616); +END +OUTPUT +select right('hello', 18446744073709551616) from dual +END +INPUT +select mod(NULL, 2) as 'NULL'; +END +OUTPUT +select mod(null, 2) as `NULL` from dual +END +INPUT +select sql_small_result t2.id, avg(rating) from t2 group by t2.id; +END +ERROR +syntax error at position 28 +END +INPUT +select mid('hello',1,null),mid('hello',null,1),mid(null,1,1); +END +OUTPUT +select mid('hello', 1, null), mid('hello', null, 1), mid(null, 1, 1) from dual +END +INPUT +select locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3); +END +ERROR +syntax error at position 27 near '0xa2a1' +END +INPUT +select a1,a2,b, max(c) from t2 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c) from t2 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1, a2, b +END +INPUT +select min(a3) from t1 where a2 = 2 and a3 >= 'CHI'; +END +OUTPUT +select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' +END +INPUT +select 1 as `a'b`, 2 as `a"b`; +END +OUTPUT +select 1 as `a'b`, 2 as `a"b` from dual +END +INPUT +select min(a) from t1m; +END +OUTPUT +select min(a) from t1m +END +INPUT +select ST_astext(ST_MPointFromWKB(ST_AsWKB(MultiPoint(Point('0', '0'),Point('-0', '0'), Point('0', '-0'))))) as result; +END +OUTPUT +select ST_astext(ST_MPointFromWKB(ST_AsWKB(MultiPoint(Point('0', '0'), Point('-0', '0'), Point('0', '-0'))))) as result from dual +END +INPUT +select IF(0,"ERROR","this"),IF(1,"is","ERROR"),IF(NULL,"ERROR","a"),IF(1,2,3)|0,IF(1,2.0,3.0)+0; +END +OUTPUT +select if(0, 'ERROR', 'this'), if(1, 'is', 'ERROR'), if(null, 'ERROR', 'a'), if(1, 2, 3) | 0, if(1, 2.0, 3.0) + 0 from dual +END +INPUT +select from t1 where a=if(b>10,_ucs2 0x0061,_ucs2 0x0062); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select ST_Crosses(ST_GeomFromText('MULTIPOINT(1 0,15 0,10 10)'),ST_GeomFromText('MULTILINESTRING((15 0,20 0,20 20,15 0))')) as result; +END +OUTPUT +select ST_Crosses(ST_GeomFromText('MULTIPOINT(1 0,15 0,10 10)'), ST_GeomFromText('MULTILINESTRING((15 0,20 0,20 20,15 0))')) as result from dual +END +INPUT +select ST_AsText(a) from t1 where MBRContains(ST_GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a) or MBRContains(ST_GeomFromText('Polygon((2 2, 2 5, 5 5, 5 2, 2 2))'), a); +END +OUTPUT +select ST_AsText(a) from t1 where MBRContains(ST_GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a) or MBRContains(ST_GeomFromText('Polygon((2 2, 2 5, 5 5, 5 2, 2 2))'), a) +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL "10000:1" DAY_HOUR); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval '10000:1' DAY_HOUR) from dual +END +INPUT +select st_contains(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_contains(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select hex(soundex(_ucs2 0x041004110412)); +END +ERROR +syntax error at position 40 near '0x041004110412' +END +INPUT +select concat(a,if(b>10,_ucs2 0x0062,_ucs2 0x00C0)) from t1; +END +ERROR +syntax error at position 37 near '0x0062' +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovenian_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_slovenian_ci +END +INPUT +select insert('hello', 18446744073709551615, 1, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select (select d from t2 where d > a), t1.* as 'with_alias' from t1; +END +ERROR +syntax error at position 47 near 'as' +END +INPUT +select from t1,t2 natural right join t3 order by t1.i,t2.i,t3.i; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*) from t1 where match a against ('000000'); +END +ERROR +syntax error at position 38 near 'a' +END +INPUT +select hex(_utf16 0x113344); +END +ERROR +syntax error at position 27 near '0x113344' +END +INPUT +select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 where (a1 >= 'c' or a2 < 'b') and b > 'a' group by a1, a2, b +END +INPUT +select concat(a, if(b>10, _utf8mb4'x', _utf8mb4'y')) from t1; +END +OUTPUT +select concat(a, if(b > 10, _utf8mb4 'x', _utf8mb4 'y')) from t1 +END +INPUT +select make_set(0,'a','b','c'),make_set(-1,'a','b','c'),make_set(1,'a','b','c'),make_set(2,'a','b','c'),make_set(1+2,concat('a','b'),'c'); +END +OUTPUT +select make_set(0, 'a', 'b', 'c'), make_set(-1, 'a', 'b', 'c'), make_set(1, 'a', 'b', 'c'), make_set(2, 'a', 'b', 'c'), make_set(1 + 2, concat('a', 'b'), 'c') from dual +END +INPUT +select repeat('hello', -18446744073709551615); +END +OUTPUT +select repeat('hello', -18446744073709551615) from dual +END +INPUT +select t1.*, a, t1.* from t1; +END +OUTPUT +select t1.*, a, t1.* from t1 +END +INPUT +select from ((t1 natural join t2), (t3 natural join t4)) natural join t6; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select date_add("2001-01-01 23:59:59",INTERVAL -2000 YEAR); +END +OUTPUT +select date_add('2001-01-01 23:59:59', interval -2000 YEAR) from dual +END +INPUT +select avg(2) from t1; +END +OUTPUT +select avg(2) from t1 +END +INPUT +select substring_index('aaaaaaaaa1','aa',4); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aa', 4) from dual +END +INPUT +select st_disjoint(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_disjoint(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select cast(-5 as unsigned) -1, cast(-5 as unsigned) + 1; +END +OUTPUT +select convert(-5, unsigned) - 1, convert(-5, unsigned) + 1 from dual +END +INPUT +select hex(a) from t1; +END +OUTPUT +select hex(a) from t1 +END +INPUT +select from t1 where MATCH a,b AGAINST ('"text search" +"now support"' IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select trigger_name from information_schema.triggers where event_object_table='t1'; +END +OUTPUT +select trigger_name from information_schema.`triggers` where event_object_table = 't1' +END +INPUT +select group_concat(b order by b) from t1 group by a; +END +OUTPUT +select group_concat(b order by b asc) from t1 group by a +END +INPUT +select get_lock('mysqltest_lock', 100); +END +OUTPUT +select get_lock('mysqltest_lock', 100) from dual +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_latvian_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_latvian_ci +END +INPUT +select "a is a and less is more" as txt; +END +OUTPUT +select 'a is a and less is more' as txt from dual +END +INPUT +select CONVERT(_koi8r'����' USING utf8) LIKE CONVERT(_koi8r'����' USING utf8); +END +ERROR +syntax error at position 36 near '����' +END +INPUT +select - a from t1; +END +OUTPUT +select -a from t1 +END +INPUT +select extract(DAY FROM "1999-01-02"); +END +ERROR +syntax error at position 24 near 'FROM' +END +INPUT +select from t1, t2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(_utf16 0x44); +END +ERROR +syntax error at position 23 near '0x44' +END +INPUT +select ROUTINE_NAME from information_schema.routines where routine_schema='test'; +END +OUTPUT +select ROUTINE_NAME from information_schema.routines where routine_schema = 'test' +END +INPUT +select count(distinct n1,n2) from t1; +END +OUTPUT +select count(distinct n1, n2) from t1 +END +INPUT +select date_sub("1998-01-01 00:00:00",INTERVAL "1:1:1" HOUR_SECOND); +END +OUTPUT +select date_sub('1998-01-01 00:00:00', interval '1:1:1' HOUR_SECOND) from dual +END +INPUT +select round(std(s1/s2), 17) from bug22555; +END +OUTPUT +select round(std(s1 / s2), 17) from bug22555 +END +INPUT +select from t1 where MATCH(a,b) AGAINST("support collections" IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select distinct t_00.a1 from t1 t_00 where exists ( select from t2 where a1 = t_00.a1 ); +END +ERROR +syntax error at position 64 near 'from' +END +INPUT +select locate('LO','hello' collate utf8mb4_bin,2); +END +OUTPUT +select locate('LO', 'hello' collate utf8mb4_bin, 2) from dual +END +INPUT +select table_name, column_name, data_type from information_schema.columns where table_schema = 'test' and table_name in ('t1', 't2'); +END +OUTPUT +select table_name, column_name, data_type from information_schema.`columns` where table_schema = 'test' and table_name in ('t1', 't2') +END +INPUT +select substring_index('aaaaaaaaa1','aa',3); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aa', 3) from dual +END +INPUT +select from information_schema.views where table_schema != 'sys' order by table_schema, table_name; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select straight_join from t1,t2 force index (primary) where t1.a=t2.a; +END +ERROR +syntax error at position 26 near 'from' +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_esperanto_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_esperanto_ci +END +INPUT +select from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b order by t1.a,t1.b; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where btn like " %"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(substr(_utf16 0x00e400e50068,1)); +END +ERROR +syntax error at position 40 near '0x00e400e50068' +END +INPUT +select concat(a, if(b>10, _utf8 0x78, _utf8 0x79)) from t1; +END +OUTPUT +select concat(a, if(b > 10, _utf8 0x78, _utf8 0x79)) from t1 +END +INPUT +select cast(19999999999999999999 as signed); +END +OUTPUT +select convert(19999999999999999999, signed) from dual +END +INPUT +select group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a) desc) as grp from t1; +END +OUTPUT +select group_concat(c order by (select mid(group_concat(c order by a asc), 1, 5) from t2 where t2.a = t1.a) desc) as grp from t1 +END +INPUT +select a.text, b.id, b.betreff from t2 a inner join t3 b on a.id = b.forum inner join t1 c on b.id = c.thread where match(b.betreff) against ('+abc' in boolean mode) union select a.text, b.id, b.betreff from t2 a inner join t3 b on a.id = b.forum inner join t1 c on b.id = c.thread where match(c.beitrag) against ('+abc' in boolean mode) order by match(betreff) against ('+abc' in boolean mode) desc; +END +OUTPUT +(select a.`text`, b.id, b.betreff from t2 as a join t3 as b on a.id = b.forum join t1 as c on b.id = c.thread where match(b.betreff) against ('+abc' in boolean mode)) union (select a.`text`, b.id, b.betreff from t2 as a join t3 as b on a.id = b.forum join t1 as c on b.id = c.thread where match(c.beitrag) against ('+abc' in boolean mode)) order by match(betreff) against ('+abc' in boolean mode) desc +END +INPUT +select @a; +END +OUTPUT +select @a from dual +END +INPUT +select left('hello', 0); +END +OUTPUT +select left('hello', 0) from dual +END +INPUT +select date,format,DATE(str_to_date(date, format)) as date2 from t1; +END +OUTPUT +select `date`, `format`, DATE(str_to_date(`date`, `format`)) as date2 from t1 +END +INPUT +select FIND_IN_SET(_latin1'B' COLLATE latin1_bin,_latin1'a,b,c,d'); +END +OUTPUT +select FIND_IN_SET(_latin1 'B' collate latin1_bin, _latin1 'a,b,c,d') from dual +END +INPUT +select position(binary 'll' in 'hello'),position('a' in binary 'hello'); +END +ERROR +syntax error at position 39 near 'hello' +END +INPUT +select CAST('10 ' as unsigned integer); +END +OUTPUT +select convert('10 ', unsigned) from dual +END +INPUT +select a,c,(select group_concat(c order by a) from t2 where a=t1.a) as grp from t1 order by grp; +END +OUTPUT +select a, c, (select group_concat(c order by a asc) from t2 where a = t1.a) as grp from t1 order by grp asc +END +INPUT +select cast('a10' as unsigned integer); +END +OUTPUT +select convert('a10', unsigned) from dual +END +INPUT +select a as like_llll from t1 where a like 'llll%'; +END +OUTPUT +select a as like_llll from t1 where a like 'llll%' +END +INPUT +select format(col2,6) from t1 where col1=7; +END +OUTPUT +select format(col2, 6) from t1 where col1 = 7 +END +INPUT +select locate("a","b",2),locate("","a",1); +END +OUTPUT +select locate('a', 'b', 2), locate('', 'a', 1) from dual +END +INPUT +select from t3 right join t2 on (t3.i=t2.i) right join t1 on (t2.i=t1.i); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser10' and host='localhost'; +END +OUTPUT +select db, table_name, table_priv from mysql.tables_priv where `user` = 'mysqluser10' and host = 'localhost' +END +INPUT +select std(o1/o2) from bug22555; +END +OUTPUT +select std(o1 / o2) from bug22555 +END +INPUT +select st_touches(ST_GeomFromText('polygon((0 0, 2 2, 0 4, 0 0))'), ST_GeomFromText('polygon((1 1, 1 0, 2 0, 1 1))')); +END +OUTPUT +select st_touches(ST_GeomFromText('polygon((0 0, 2 2, 0 4, 0 0))'), ST_GeomFromText('polygon((1 1, 1 0, 2 0, 1 1))')) from dual +END +INPUT +select t1.* as 'with_alias', (select a from t2 where d > a) from t1; +END +ERROR +syntax error at position 15 near 'as' +END +INPUT +select hex(weight_string(_utf32 0x10000 collate utf32_unicode_ci)); +END +ERROR +syntax error at position 40 near '0x10000' +END +INPUT +select mbrcoveredby(ST_GeomFromText("point(2 4)"), ST_GeomFromText("polygon((2 2, 10 2, 10 10, 2 10, 2 2))")); +END +OUTPUT +select mbrcoveredby(ST_GeomFromText('point(2 4)'), ST_GeomFromText('polygon((2 2, 10 2, 10 10, 2 10, 2 2))')) from dual +END +INPUT +select date,format,str_to_date(date, format) as str_to_date from t1; +END +OUTPUT +select `date`, `format`, str_to_date(`date`, `format`) as str_to_date from t1 +END +INPUT +select ST_astext(st_symdifference(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_difference(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))); +END +OUTPUT +select ST_astext(st_symdifference(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_difference(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))) from dual +END +INPUT +select user() like _latin1"%@%"; +END +OUTPUT +select user() like _latin1 '%@%' from dual +END +INPUT +select table_name from tables where table_name='user'; +END +OUTPUT +select table_name from `tables` where table_name = 'user' +END +INPUT +select rpad('abcd',7,'ab'),lpad('abcd',7,'ab'); +END +OUTPUT +select rpad('abcd', 7, 'ab'), lpad('abcd', 7, 'ab') from dual +END +INPUT +select from t1 where soundex(a) = soundex('TEST'); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(soundex(_utf8mb4 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB)); +END +OUTPUT +select hex(soundex(_utf8mb4 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB)) from dual +END +INPUT +select count(*) from t1 where facility = NULL; +END +OUTPUT +select count(*) from t1 where facility = null +END +INPUT +select distinct b.id, b.betreff from t3 b order by match(betreff) against ('+abc' in boolean mode) desc; +END +OUTPUT +select distinct b.id, b.betreff from t3 as b order by match(betreff) against ('+abc' in boolean mode) desc +END +INPUT +select _latin1 0xF7 regexp _latin1 '[[:alpha:]]'; +END +OUTPUT +select _latin1 0xF7 regexp _latin1 '[[:alpha:]]' from dual +END +INPUT +select reverse(""); +END +OUTPUT +select reverse('') from dual +END +INPUT +select t2.fld3 FROM t2 where fld3 LIKE 'hon_ysuckl_'; +END +OUTPUT +select t2.fld3 from t2 where fld3 like 'hon_ysuckl_' +END +INPUT +select count(*) from information_schema.ROUTINES where routine_schema='test'; +END +OUTPUT +select count(*) from information_schema.ROUTINES where routine_schema = 'test' +END +INPUT +select from ((t3 join (t1 join t2 on c > a) on t3.b < t2.a) join t4 on y > t1.c) join t5 on z = t1.b + 3; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select cast(_latin1'test' as char character set latin2); +END +OUTPUT +select convert(_latin1 'test', char character set latin2) from dual +END +INPUT +select ST_DISTANCE(ST_GeomFromText('polygon((0 0, 1 2, 2 1, 0 0))'), ST_GeomFromText('polygon((2 2, 3 4, 4 3, 2 2))')); +END +OUTPUT +select ST_DISTANCE(ST_GeomFromText('polygon((0 0, 1 2, 2 1, 0 0))'), ST_GeomFromText('polygon((2 2, 3 4, 4 3, 2 2))')) from dual +END +INPUT +select p from t1; +END +OUTPUT +select p from t1 +END +INPUT +select @arg00 FROM t1 where a=1 union distinct select 1 FROM t1 where a=1; +END +OUTPUT +(select @arg00 from t1 where a = 1) union (select 1 from t1 where a = 1) +END +INPUT +select @@max_sort_length; +END +OUTPUT +select @@max_sort_length from dual +END +INPUT +select routine_name, routine_type from information_schema.routines where routine_schema = 'test'; +END +OUTPUT +select routine_name, routine_type from information_schema.routines where routine_schema = 'test' +END +INPUT +select insert(_utf16 0x006100620063,1,2,_utf16 0x006400650066); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select length(_utf8 0xD0B1), bit_length(_utf8 0xD0B1), char_length(_utf8 0xD0B1); +END +OUTPUT +select length(_utf8 0xD0B1), bit_length(_utf8 0xD0B1), char_length(_utf8 0xD0B1) from dual +END +INPUT +select @@keycache1.key_buffer_size; +END +OUTPUT +select @@keycache1.key_buffer_size from dual +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_polish_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_polish_ci +END +INPUT +select make_set(NULL,'a','b','c'),make_set(1|4,'a',NULL,'c'),make_set(1+2,'a',NULL,'c'); +END +OUTPUT +select make_set(null, 'a', 'b', 'c'), make_set(1 | 4, 'a', null, 'c'), make_set(1 + 2, 'a', null, 'c') from dual +END +INPUT +select log10(-1); +END +OUTPUT +select log10(-1) from dual +END +INPUT +select a from t1 where mid(a+0,6,3) = ( mid(20040106123400,6,3) ); +END +OUTPUT +select a from t1 where mid(a + 0, 6, 3) = mid(20040106123400, 6, 3) +END +INPUT +select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d')); +END +OUTPUT +select concat('', str_to_date('8:11:2.123456 03-01-02', '%H:%i:%S.%f %y-%m-%d')) from dual +END +INPUT +select locate('he','hello'),locate('he','hello',2),locate('lo','hello',2); +END +OUTPUT +select locate('he', 'hello'), locate('he', 'hello', 2), locate('lo', 'hello', 2) from dual +END +INPUT +select format(pi(), @dec); +END +OUTPUT +select format(pi(), @`dec`) from dual +END +INPUT +select strcmp(localtime(),concat(current_date()," ",current_time())); +END +OUTPUT +select strcmp(localtime(), concat(current_date(), ' ', current_time())) from dual +END +INPUT +select from t1 a, t1 b group by a.s1 having s1 is null; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select benchmark(10, pi()); +END +OUTPUT +select benchmark(10, pi()) from dual +END +INPUT +select "Test 'go' command(vertical output) G" as "_"; +END +OUTPUT +select 'Test \'go\' command(vertical output) G' as _ from dual +END +INPUT +select ifnull(load_file("lkjlkj"),"it is null"); +END +OUTPUT +select ifnull(load_file('lkjlkj'), 'it is null') from dual +END +INPUT +select "a "="A", "A "="a", "a " <= "A b"; +END +OUTPUT +select 'a ' = 'A', 'A ' = 'a', 'a ' <= 'A b' from dual +END +INPUT +select a1,a2, max(c) from t2 where (b = 'b') group by a1,a2; +END +OUTPUT +select a1, a2, max(c) from t2 where b = 'b' group by a1, a2 +END +INPUT +select t1.*,t2.* from t1 left join t2 using (c); +END +OUTPUT +select t1.*, t2.* from t1 left join t2 using (c) +END +INPUT +select into outfile 'test/t1.txt' from t1; +END +ERROR +syntax error at position 12 near 'into' +END +INPUT +select a.f1 as a, b.f4 as b, a.f1 > b.f4 as gt, a.f1 < b.f4 as lt, a.f1<=>b.f4 as eq from t1 a, t1 b; +END +OUTPUT +select a.f1 as a, b.f4 as b, a.f1 > b.f4 as gt, a.f1 < b.f4 as lt, a.f1 <=> b.f4 as eq from t1 as a, t1 as b +END +INPUT +select v,count(*) from t1 group by v order by v limit 9; +END +OUTPUT +select v, count(*) from t1 group by v order by v asc limit 9 +END +INPUT +select t1.* as 'with_alias', a, t1.* as 'alias2' from t1; +END +ERROR +syntax error at position 15 near 'as' +END +INPUT +select locate('LO','hello' collate ujis_bin,2); +END +OUTPUT +select locate('LO', 'hello' collate ujis_bin, 2) from dual +END +INPUT +select from t1 where f1='test' and (f2= sha("TEST") or f2= sha("test")); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(substr(_utf16 0x00e400e50068,3)); +END +ERROR +syntax error at position 40 near '0x00e400e50068' +END +INPUT +select @@sql_mode into @full_mode; +END +ERROR +syntax error at position 34 near 'full_mode' +END +INPUT +select @a, @b; +END +OUTPUT +select @a, @b from dual +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_czech_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_czech_ci +END +INPUT +select var_samp(o), var_pop(o) from bug22555; +END +OUTPUT +select var_samp(o), var_pop(o) from bug22555 +END +INPUT +select version()>=_utf8"3.23.29"; +END +OUTPUT +select version() >= _utf8 '3.23.29' from dual +END +INPUT +select table_name, column_name, privileges from information_schema.columns where table_schema = 'mysqltest' and table_name = 'v1' order by table_name, column_name; +END +OUTPUT +select table_name, column_name, `privileges` from information_schema.`columns` where table_schema = 'mysqltest' and table_name = 'v1' order by table_name asc, column_name asc +END +INPUT +select from t1 order by a,b; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL -100000 DAY); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval -100000 DAY) from dual +END +INPUT +select dummy1,count(distinct id) from t1 group by dummy1; +END +OUTPUT +select dummy1, count(distinct id) from t1 group by dummy1 +END +INPUT +select distinct sum(b) from t1 group by a; +END +OUTPUT +select distinct sum(b) from t1 group by a +END +INPUT +select t1.* as 'with_alias' from t1; +END +ERROR +syntax error at position 15 near 'as' +END +INPUT +select round(1.5, -9223372036854775808), round(1.5, 9223372036854775808); +END +OUTPUT +select round(1.5, -9223372036854775808), round(1.5, 9223372036854775808) from dual +END +INPUT +select t1.*,t2.* from t1 left join t2 using (a,c); +END +OUTPUT +select t1.*, t2.* from t1 left join t2 using (a, c) +END +INPUT +select substring('hello', -4294967297, 1); +END +OUTPUT +select substr('hello', -4294967297, 1) from dual +END +INPUT +select a1,a2,b,min(c),max(c) from t2 where ((c > 'b111') and (c <= 'g112')) or ((c > 'd000') and (c <= 'i110')) group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t2 where c > 'b111' and c <= 'g112' or c > 'd000' and c <= 'i110' group by a1, a2, b +END +INPUT +select _latin1'B' in (_latin1'a',_latin1'b' collate latin1_bin); +END +OUTPUT +select _latin1 'B' in (_latin1 'a', _latin1 'b' collate latin1_bin) from dual +END +INPUT +select from t1 where a is null and b=2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a, left(a,1) as b from t1 group by a; +END +OUTPUT +select a, left(a, 1) as b from t1 group by a +END +INPUT +select @@keycache2.key_buffer_size; +END +OUTPUT +select @@keycache2.key_buffer_size from dual +END +INPUT +select from t1 where MATCH(a,b) AGAINST ("indexes collections"); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select _latin2'B' between _latin1'a' and _latin1'b'; +END +ERROR +syntax error at position 26 near 'between' +END +INPUT +select release_lock('bug27638'); +END +OUTPUT +select release_lock('bug27638') from dual +END +INPUT +select hex(weight_string('s')); +END +OUTPUT +select hex(weight_string('s')) from dual +END +INPUT +select locate('lo','hello',-18446744073709551616); +END +OUTPUT +select locate('lo', 'hello', -18446744073709551616) from dual +END +INPUT +select collation(cast('a' as char(2))), collation(cast('a' as char(2) binary)); +END +ERROR +syntax error at position 77 near 'binary' +END +INPUT +select from v1d join v2a on v1d.a = v2a.c; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select t2.isbn,city,t1.libname,count(distinct t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city having count(distinct concat(t1.libname,'a')) > 1; +END +OUTPUT +select t2.isbn, city, t1.libname, count(distinct t1.libname) as a from t3 left join t1 on t3.libname = t1.libname left join t2 on t3.isbn = t2.isbn group by city having count(distinct concat(t1.libname, 'a')) > 1 +END +INPUT +select concat("a",NULL),replace(NULL,"a","b"),replace("string","i",NULL),replace("string",NULL,"i"),insert("abc",1,1,NULL),left(NULL,1); +END +ERROR +syntax error at position 107 near 'insert' +END +INPUT +select substring_index('aaaaaaaaa1','1',1); +END +OUTPUT +select substring_index('aaaaaaaaa1', '1', 1) from dual +END +INPUT +select distinct n1 from t1; +END +OUTPUT +select distinct n1 from t1 +END +INPUT +select c1,c2,c3,c4,hex(c5) from t1; +END +OUTPUT +select c1, c2, c3, c4, hex(c5) from t1 +END +INPUT +select from t2 where MATCH inhalt AGAINST (NULL); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select table_name from information_schema.tables where table_schema = 'test' and table_name not in (select table_name from information_schema.columns where table_schema = 'test' and column_name = 'f3') order by table_name; +END +OUTPUT +select table_name from information_schema.`tables` where table_schema = 'test' and table_name not in (select table_name from information_schema.`columns` where table_schema = 'test' and column_name = 'f3') order by table_name asc +END +INPUT +select (select t2.* as 'x' from t2) from t1; +END +ERROR +syntax error at position 23 near 'as' +END +INPUT +select group_concat(b) from t1 group by a; +END +OUTPUT +select group_concat(b) from t1 group by a +END +INPUT +select from (select from t1 where t1.a=(select t2.a from t2 where t2.a=t1.a) union select t1.a, t1.b from t1) a; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select @@character_set_client; +END +OUTPUT +select @@character_set_client from dual +END +INPUT +select from t1 limit 0; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string); +END +OUTPUT +select uncompressed_length(compress(@test_compress_string)) = length(@test_compress_string) from dual +END +INPUT +select from t1 natural join (t4 natural join t5) where t4.y > 7; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a1,a2,b,max(c) from t2 where (a2 = 'a') and b is NULL group by a1; +END +OUTPUT +select a1, a2, b, max(c) from t2 where a2 = 'a' and b is null group by a1 +END +INPUT +select round(999999999, -9); +END +OUTPUT +select round(999999999, -9) from dual +END +INPUT +select from_unixtime(unix_timestamp("1994-03-02 10:11:12")),from_unixtime(unix_timestamp("1994-03-02 10:11:12"),"%Y-%m-%d %h:%i:%s"),from_unixtime(unix_timestamp("1994-03-02 10:11:12"))+0; +END +OUTPUT +select from_unixtime(unix_timestamp('1994-03-02 10:11:12')), from_unixtime(unix_timestamp('1994-03-02 10:11:12'), '%Y-%m-%d %h:%i:%s'), from_unixtime(unix_timestamp('1994-03-02 10:11:12')) + 0 from dual +END +INPUT +select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name; +END +OUTPUT +select event_schema, event_name, sql_mode from information_schema.events order by event_schema asc, event_name asc +END +INPUT +select char(0xff,0x8f using utf8mb4); +END +ERROR +syntax error at position 28 near 'using' +END +INPUT +select a, group_concat(b) from t1 group by a with rollup; +END +ERROR +syntax error at position 50 near 'with' +END +INPUT +select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select ifnull(A, 'N') as A, ifnull(B, 'N') as B, ifnull(not A, 'N') as nA, ifnull(not B, 'N') as nB, ifnull(A and B, 'N') as AB, ifnull(not (A and B), 'N') as `n(AB)`, ifnull((not A or not B), 'N') as nAonB, ifnull(A or B, 'N') as AoB, ifnull(not(A or B), 'N') as `n(AoB)`, ifnull(not A and not B, 'N') as nAnB from t1; +END +OUTPUT +select ifnull(A, 'N') as A, ifnull(B, 'N') as B, ifnull(not A, 'N') as nA, ifnull(not B, 'N') as nB, ifnull(A and B, 'N') as AB, ifnull(not (A and B), 'N') as `n(AB)`, ifnull(not A or not B, 'N') as nAonB, ifnull(A or B, 'N') as AoB, ifnull(not (A or B), 'N') as `n(AoB)`, ifnull(not A and not B, 'N') as nAnB from t1 +END +INPUT +select *, uncompress(a) from t1; +END +OUTPUT +select *, uncompress(a) from t1 +END +INPUT +select extract(MINUTE_MICROSECOND FROM "1999-01-02 10:11:12.000123"); +END +ERROR +syntax error at position 39 near 'FROM' +END +INPUT +select charset(max(a)), coercibility(max(a)), charset(min(a)), coercibility(min(a)) from t1; +END +OUTPUT +select charset(max(a)), coercibility(max(a)), charset(min(a)), coercibility(min(a)) from t1 +END +INPUT +select collation(trim(LEADING _latin2' ' FROM _latin2'a')), coercibility(trim(LEADING _latin2'a' FROM _latin2'a')); +END +ERROR +syntax error at position 41 near ' ' +END +INPUT +select from t1 AS m LEFT JOIN t2 AS c1 ON m.c1id = c1.id AND c1.active = 'Yes' LEFT JOIN t3 AS c2 ON m.c2id = c2.id AND c2.active = 'Yes' WHERE m.pid=1 AND (c1.id IS NOT NULL OR c2.id IS NOT NULL); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select id, stddev_pop(value1), var_pop(value1), stddev_samp(value1), var_samp(value1) from t1 group by id; +END +OUTPUT +select id, stddev_pop(value1), var_pop(value1), stddev_samp(value1), var_samp(value1) from t1 group by id +END +INPUT +select extract(YEAR FROM "1999-01-02 10:11:12"); +END +ERROR +syntax error at position 25 near 'FROM' +END +INPUT +select c,table_name from v1 inner join information_schema.TABLES v2 on (v1.c=v2.table_name) where v1.c rlike "t[1-5]{1}$" order by c; +END +OUTPUT +select c, table_name from v1 join information_schema.`TABLES` as v2 on v1.c = v2.table_name where v1.c regexp 't[1-5]{1}$' order by c asc +END +INPUT +select from t1 natural join t2 where t1.b > 0; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 0x00b25278956e0044683dfc180cd886aeff2f5bc3fc18 like '%-122%'; +END +OUTPUT +select 0x00b25278956e0044683dfc180cd886aeff2f5bc3fc18 like '%-122%' from dual +END +INPUT +select HEX(0x19c9bbcce9e0a88f5212572b0c5b9e6d0 | _binary 0x13c19e5cfdf03b19518cbe3d65faf10d2), HEX(0x19c9bbcce9e0a88f5212572b0c5b9e6d0 ^ _binary 0x13c19e5cfdf03b19518cbe3d65faf10d2), HEX(0x19c9bbcce9e0a88f5212572b0c5b9e6d0 & _binary 0x13c19e5cfdf03b19518cbe3d65faf10d2), HEX(~ _binary 0x19c9bbcce9e0a88f5212572b0c5b9e6d0), HEX(~ _binary 0x13c19e5cfdf03b19518cbe3d65faf10d2); +END +OUTPUT +select HEX(0x19c9bbcce9e0a88f5212572b0c5b9e6d0 | _binary 0x13c19e5cfdf03b19518cbe3d65faf10d2), HEX(0x19c9bbcce9e0a88f5212572b0c5b9e6d0 ^ _binary 0x13c19e5cfdf03b19518cbe3d65faf10d2), HEX(0x19c9bbcce9e0a88f5212572b0c5b9e6d0 & _binary 0x13c19e5cfdf03b19518cbe3d65faf10d2), HEX(~ _binary 0x19c9bbcce9e0a88f5212572b0c5b9e6d0), HEX(~ _binary 0x13c19e5cfdf03b19518cbe3d65faf10d2) from dual +END +INPUT +select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 = 'MIN'; +END +OUTPUT +select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 = 'MIN' +END +INPUT +select group_concat(distinct a, c order by a, c) from t1; +END +OUTPUT +select group_concat(distinct a, c order by a asc, c asc) from t1 +END +INPUT +select char_length('; +END +ERROR +syntax error at position 22 near ';' +END +INPUT +select ST_geomfromtext(col9,col89) as a from t1; +END +OUTPUT +select ST_geomfromtext(col9, col89) as a from t1 +END +INPUT +select from t4 order by b,a limit 3; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select @@key_buffer_size; +END +OUTPUT +select @@key_buffer_size from dual +END +INPUT +select from t1 where not(a < 5 or a > 15); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where not(NULL and a > 5); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select period FROM t1; +END +OUTPUT +select period from t1 +END +INPUT +select from `information_schema`.`PARTITIONS` where `TABLE_NAME` = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from (t1 cross join t2) join (t3 cross join t4) on (a < y and t2.b < t3.c); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select t2.fld3 FROM t2 where fld3 LIKE 'honeysuckl_'; +END +OUTPUT +select t2.fld3 from t2 where fld3 like 'honeysuckl_' +END +INPUT +select mbrtouches(ST_GeomFromText("point(2 4)"), ST_GeomFromText("polygon((2 2, 6 2, 6 6, 2 6, 2 2))")); +END +OUTPUT +select mbrtouches(ST_GeomFromText('point(2 4)'), ST_GeomFromText('polygon((2 2, 6 2, 6 6, 2 6, 2 2))')) from dual +END +INPUT +select from t1, t2 where t1.start between t2.ctime1 and t2.ctime2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a, MAX(b), ELT(MAX(b), 'a', 'b', 'c', 'd', 'e', 'f') from t1 group by a; +END +OUTPUT +select a, MAX(b), ELT(MAX(b), 'a', 'b', 'c', 'd', 'e', 'f') from t1 group by a +END +INPUT +select avg ( (select (select sum(outr.a + innr.a) from t1 as innr limit 1) as tt from t1 as outr order by outr.a limit 1)) from t1 as most_outer; +END +OUTPUT +select avg((select (select sum(outr.a + innr.a) from t1 as innr limit 1) as tt from t1 as outr order by outr.a asc limit 1)) from t1 as most_outer +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_spanish_ci +END +INPUT +select substring('hello', 4294967297, 4294967297); +END +OUTPUT +select substr('hello', 4294967297, 4294967297) from dual +END +INPUT +select 0x003c8793403032 like '%-112%'; +END +OUTPUT +select 0x003c8793403032 like '%-112%' from dual +END +INPUT +select from t3; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select concat(a,ifnull(min(date_format(now(), '%Y-%m-%d')),' ull')) from t1; +END +OUTPUT +select concat(a, ifnull(min(date_format(now(), '%Y-%m-%d')), ' ull')) from t1 +END +INPUT +select conv(1,10,16),conv((1<<2)-1,10,16),conv((1<<10)-2,10,16),conv((1<<16)-3,10,16),conv((1<<25)-4,10,16),conv((1<<31)-5,10,16),conv((1<<36)-6,10,16),conv((1<<47)-7,10,16),conv((1<<48)-8,10,16),conv((1<<55)-9,10,16),conv((1<<56)-10,10,16),conv((1<<63)-11,10,16); +END +OUTPUT +select conv(1, 10, 16), conv((1 << 2) - 1, 10, 16), conv((1 << 10) - 2, 10, 16), conv((1 << 16) - 3, 10, 16), conv((1 << 25) - 4, 10, 16), conv((1 << 31) - 5, 10, 16), conv((1 << 36) - 6, 10, 16), conv((1 << 47) - 7, 10, 16), conv((1 << 48) - 8, 10, 16), conv((1 << 55) - 9, 10, 16), conv((1 << 56) - 10, 10, 16), conv((1 << 63) - 11, 10, 16) from dual +END +INPUT +select from t1 where f1='test' and (f2= md5("TEST") or f2= md5("test")); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(char(0x01020304 using ucs2)); +END +ERROR +syntax error at position 33 near 'using' +END +INPUT +select 'a' union select concat('a', -0.0000); +END +OUTPUT +(select 'a' from dual) union (select concat('a', -0.0000) from dual) +END +INPUT +select locate('lo','hello',-4294967296); +END +OUTPUT +select locate('lo', 'hello', -4294967296) from dual +END +INPUT +select from events_test.events_smode_test order by ev_name, a; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select insert(_utf16 0x006100620063,10,2,_utf16 0x006400650066); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select FIELD('1',_latin2'3','2',1); +END +OUTPUT +select FIELD('1', _latin2 as `3`, '2', 1) from dual +END +INPUT +select date_format(d,"%d") from t1 order by 1; +END +OUTPUT +select date_format(d, '%d') from t1 order by 1 asc +END +INPUT +select LEAST(NULL,'HARRY','HARRIOT',NULL,'HAROLD'),GREATEST(NULL,'HARRY','HARRIOT',NULL,'HAROLD'); +END +OUTPUT +select LEAST(null, 'HARRY', 'HARRIOT', null, 'HAROLD'), GREATEST(null, 'HARRY', 'HARRIOT', null, 'HAROLD') from dual +END +INPUT +select a1,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1; +END +OUTPUT +select a1, max(c), min(c) from t1 where a2 = 'a' and b = 'b' group by a1 +END +INPUT +select max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 = 'CA'; +END +OUTPUT +select max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 = 'CA' +END +INPUT +select from information_schema.schema_privileges order by grantee; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select @@autocommit; +END +OUTPUT +select @@autocommit from dual +END +INPUT +select hex(substr(_ucs2 0x00e400e50068,-3)); +END +ERROR +syntax error at position 39 near '0x00e400e50068' +END +INPUT +select -1,-11,-101,-1001,-10001,-100001,-1000001,-10000001,-100000001,-1000000001,-10000000001,-100000000001,-1000000000001,-10000000000001,-100000000000001,-1000000000000001,-10000000000000001,-100000000000000001,-1000000000000000001,-10000000000000000001; +END +OUTPUT +select -1, -11, -101, -1001, -10001, -100001, -1000001, -10000001, -100000001, -1000000001, -10000000001, -100000000001, -1000000000001, -10000000000001, -100000000000001, -1000000000000001, -10000000000000001, -100000000000000001, -1000000000000000001, -10000000000000000001 from dual +END +INPUT +select a from t1 order by a desc,b; +END +OUTPUT +select a from t1 order by a desc, b asc +END +INPUT +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost'; +END +OUTPUT +select db, table_name, table_priv from mysql.tables_priv where `user` = 'mysqluser1' and host = 'localhost' +END +INPUT +select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 where c > 'b1' group by a1, a2, b +END +INPUT +select distinct t1_outer.a from t1 t1_outer order by t1_outer.b; +END +OUTPUT +select distinct t1_outer.a from t1 as t1_outer order by t1_outer.b asc +END +INPUT +select std(s1/s2) from bug22555; +END +OUTPUT +select std(s1 / s2) from bug22555 +END +INPUT +select substring('hello', 1, 4294967295); +END +OUTPUT +select substr('hello', 1, 4294967295) from dual +END +INPUT +select lpad('hello', 18446744073709551615, '1'); +END +OUTPUT +select lpad('hello', 18446744073709551615, '1') from dual +END +INPUT +select t1.*,t2.* from t1 as t0,{ oj t2 left outer join t1 on (t1.a=t2.a) } WHERE t0.a=2; +END +ERROR +syntax error at position 33 near '{' +END +INPUT +select length(s1),char_length(s1) from t1; +END +OUTPUT +select length(s1), char_length(s1) from t1 +END +INPUT +select @@global.key_buffer_size; +END +OUTPUT +select @@global.key_buffer_size from dual +END +INPUT +select stddev(2) from t1; +END +OUTPUT +select stddev(2) from t1 +END +INPUT +select field(NULL,1,2,NULL), field(NULL,1,2,0); +END +OUTPUT +select field(null, 1, 2, null), field(null, 1, 2, 0) from dual +END +INPUT +select CAST(CAST(1-2 AS UNSIGNED) AS SIGNED INTEGER); +END +OUTPUT +select convert(convert(1 - 2, UNSIGNED), SIGNED) from dual +END +INPUT +select a1,a2,b,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1; +END +OUTPUT +select a1, a2, b, max(c), min(c) from t3 where a2 = 'a' and b = 'b' group by a1 +END +INPUT +select insert('hello', 4294967295, 4294967295, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select INDEX_NAME from information_schema.statistics where table_schema='test' order by INDEX_NAME; +END +OUTPUT +select INDEX_NAME from information_schema.statistics where table_schema = 'test' order by INDEX_NAME asc +END +INPUT +select substring('hello', 1, -18446744073709551616); +END +OUTPUT +select substr('hello', 1, -18446744073709551616) from dual +END +INPUT +select table_name from information_schema.TABLES where table_schema = "mysqltest" and table_name rlike "t[1-5]{1}$" order by table_name; +END +OUTPUT +select table_name from information_schema.`TABLES` where table_schema = 'mysqltest' and table_name regexp 't[1-5]{1}$' order by table_name asc +END +INPUT +select count(*) from T1; +END +OUTPUT +select count(*) from T1 +END +INPUT +select get_lock('ee_22830', 60); +END +OUTPUT +select get_lock('ee_22830', 60) from dual +END +INPUT +select date_format('2004-01-01','%W (%a), %e %M (%b) %Y'); +END +OUTPUT +select date_format('2004-01-01', '%W (%a), %e %M (%b) %Y') from dual +END +INPUT +select from t1 where bigint_col=17666000000000000000; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select v,count(c) from t1 group by v order by v limit 10; +END +OUTPUT +select v, count(c) from t1 group by v order by v asc limit 10 +END +INPUT +select nullif(1,'test'); +END +OUTPUT +select nullif(1, 'test') from dual +END +INPUT +select date_sub("1998-01-02",INTERVAL 31 DAY); +END +OUTPUT +select date_sub('1998-01-02', interval 31 DAY) from dual +END +INPUT +select from db where user = 'mysqltest_1'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select time_format(19980131000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); +END +OUTPUT +select time_format(19980131000000, '%H|%I|%k|%l|%i|%p|%r|%S|%T') from dual +END +INPUT +select c1 as 'no index' from t1 where c1 like cast(concat('%',0xA4A2, '%') as char character set ujis); +END +OUTPUT +select c1 as `no index` from t1 where c1 like convert(concat('%', 0xA4A2, '%'), char character set ujis) +END +INPUT +select date_add("1997-12-31 23:59:59.000002",INTERVAL "10000:99:99.999999" HOUR_MICROSECOND); +END +OUTPUT +select date_add('1997-12-31 23:59:59.000002', interval '10000:99:99.999999' HOUR_MICROSECOND) from dual +END +INPUT +select @@event_scheduler; +END +OUTPUT +select @@event_scheduler from dual +END +INPUT +select CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH from information_schema.columns where table_schema='test' and table_name = 't1'; +END +OUTPUT +select CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH from information_schema.`columns` where table_schema = 'test' and table_name = 't1' +END +INPUT +select st_touches(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')); +END +OUTPUT +select st_touches(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')) from dual +END +INPUT +select left(_utf8 0xD0B0D0B1D0B2,1); +END +OUTPUT +select left(_utf8 0xD0B0D0B1D0B2, 1) from dual +END +INPUT +select from information_schema.SCHEMA_PRIVILEGES where grantee like '%mysqltest_1%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select i, count(*) from bug22555 group by i; +END +OUTPUT +select i, count(*) from bug22555 group by i +END +INPUT +select t2.fld3 FROM t2 where fld3 LIKE 'h%le'; +END +OUTPUT +select t2.fld3 from t2 where fld3 like 'h%le' +END +INPUT +select compress(a) is null from t1; +END +OUTPUT +select compress(a) is null from t1 +END +INPUT +select 5.9 div 2, 1.23456789e3 DIV 2, 1.23456789e9 DIV 2, 1.23456789e19 DIV 2; +END +OUTPUT +select 5.9 div 2, 1.23456789e3 div 2, 1.23456789e9 div 2, 1.23456789e19 div 2 from dual +END +INPUT +select 0, ST_Intersects(ST_GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), ST_GeomFromText('POLYGON((10 40, 40 50, 20 70, 10 40))')); +END +OUTPUT +select 0, ST_Intersects(ST_GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), ST_GeomFromText('POLYGON((10 40, 40 50, 20 70, 10 40))')) from dual +END +INPUT +select a, group_concat(distinct b order by b) from t1 group by a with rollup; +END +ERROR +syntax error at position 70 near 'with' +END +INPUT +select 4|||| delimiter 'abcd'|||| select 5; +END +ERROR +syntax error at position 13 +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_german2_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_german2_ci +END +INPUT +select str_to_date( 1, NULL ); +END +OUTPUT +select str_to_date(1, null) from dual +END +INPUT +select "A"<=>"B","A"<=>NULL,NULL<=>"A"; +END +OUTPUT +select 'A' <=> 'B', 'A' <=> null, null <=> 'A' from dual +END +INPUT +select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.55555,3),format(123456.5555,4),format(1234567.5555,5),format("12345.2399",2); +END +OUTPUT +select format(1.5555, 0), format(123.5555, 1), format(1234.5555, 2), format(12345.55555, 3), format(123456.5555, 4), format(1234567.5555, 5), format('12345.2399', 2) from dual +END +INPUT +select length(compress(@test_compress_string)) 2 order by a; +END +OUTPUT +select a from t1 where a > 2 order by a asc +END +INPUT +select AUTO_INCREMENT from information_schema.tables where table_name = 't1'; +END +OUTPUT +select `AUTO_INCREMENT` from information_schema.`tables` where table_name = 't1' +END +INPUT +select from mysql.slow_log where sql_text NOT LIKE '%slow_log%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t3 order by a,b; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select SUBSTR('abcdefg',3,2); +END +OUTPUT +select substr('abcdefg', 3, 2) from dual +END +INPUT +select collation(rpad(_latin2'a',4,_latin2'b')), coercibility(rpad(_latin2'a',4,_latin2'b')); +END +OUTPUT +select collation(rpad(_latin2 as a, 4, _latin2 as b)), coercibility(rpad(_latin2 as a, 4, _latin2 as b)) from dual +END +INPUT +select right('hello', 4294967297); +END +OUTPUT +select right('hello', 4294967297) from dual +END +INPUT +select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id order by one.id; +END +OUTPUT +select one.id, elt(two.val, 'one', 'two') from t1 as one, t2 as two where two.id = one.id order by one.id asc +END +INPUT +select sec_to_time(9001),sec_to_time(9001)+0,time_to_sec("15:12:22"), sec_to_time(time_to_sec("0:30:47")/6.21); +END +OUTPUT +select sec_to_time(9001), sec_to_time(9001) + 0, time_to_sec('15:12:22'), sec_to_time(time_to_sec('0:30:47') / 6.21) from dual +END +INPUT +select lpad('hello', -4294967296, '1'); +END +OUTPUT +select lpad('hello', -4294967296, '1') from dual +END +INPUT +select case a when 1 then 2 when 2 then 3 else 0 end as fcase, count(*) from t1 group by fcase; +END +OUTPUT +select case a when 1 then 2 when 2 then 3 else 0 end as fcase, count(*) from t1 group by fcase +END +INPUT +select variance(2) from t1; +END +OUTPUT +select variance(2) from t1 +END +INPUT +select last_day("1997-12-1")+0; +END +OUTPUT +select last_day('1997-12-1') + 0 from dual +END +INPUT +select fld3 FROM t2 where fld3 like "L%" and fld3 = "ok"; +END +OUTPUT +select fld3 from t2 where fld3 like 'L%' and fld3 = 'ok' +END +INPUT +select date_add('1000-01-01 00:00:00', interval '1.03:02:01.05' day_microsecond); +END +OUTPUT +select date_add('1000-01-01 00:00:00', interval '1.03:02:01.05' day_microsecond) from dual +END +INPUT +select from t1 where a=database(); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select ST_Crosses(ST_GeomFromText('MULTIPOINT(1 0,15 0,10 10)'),ST_GeomFromText('LINESTRING(15 0,20 0,10 10,20 20)')) as result; +END +OUTPUT +select ST_Crosses(ST_GeomFromText('MULTIPOINT(1 0,15 0,10 10)'), ST_GeomFromText('LINESTRING(15 0,20 0,10 10,20 20)')) as result from dual +END +INPUT +select date_sub("0000-00-00 00:00:00",INTERVAL 1 SECOND); +END +OUTPUT +select date_sub('0000-00-00 00:00:00', interval 1 SECOND) from dual +END +INPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name = 'tm' and index_name = 'v' order by table_name; +END +OUTPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name = 'tm' and index_name = 'v' order by table_name asc +END +INPUT +select v; +END +OUTPUT +select v from dual +END +INPUT +select null % null as 'NULL'; +END +OUTPUT +select null % null as `NULL` from dual +END +INPUT +select t1.* FROM t1; +END +OUTPUT +select t1.* from t1 +END +INPUT +select hex(a) a, hex(@u:=convert(a using utf8)) b, hex(convert(@u using big5)) c from t1 order by a; +END +ERROR +syntax error at position 25 near ':' +END +INPUT +select t,count(t) from t1 group by t order by t limit 10; +END +OUTPUT +select t, count(t) from t1 group by t order by t asc limit 10 +END +INPUT +select cast(NULL as DATE); +END +OUTPUT +select convert(null, DATE) from dual +END +INPUT +select substring('hello', 1, -18446744073709551615); +END +OUTPUT +select substr('hello', 1, -18446744073709551615) from dual +END +INPUT +select c cx from t1 where c='x'; +END +OUTPUT +select c as cx from t1 where c = 'x' +END +INPUT +select date_sub("1998-01-01 00:00:00.000001",INTERVAL "1 1:1:1.000002" DAY_MICROSECOND); +END +OUTPUT +select date_sub('1998-01-01 00:00:00.000001', interval '1 1:1:1.000002' DAY_MICROSECOND) from dual +END +INPUT +select date_add(date,INTERVAL "1 1:1" DAY_MINUTE) from t1; +END +OUTPUT +select date_add(`date`, interval '1 1:1' DAY_MINUTE) from t1 +END +INPUT +select hex(char(0xFF using utf8)); +END +ERROR +syntax error at position 27 near 'using' +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL -100000 YEAR); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval -100000 YEAR) from dual +END +INPUT +select substring_index('the king of the the hill',' ',-2); +END +OUTPUT +select substring_index('the king of the the hill', ' ', -2) from dual +END +INPUT +select "a" as a; +END +OUTPUT +select 'a' as a from dual +END +INPUT +select a1, max(c) from t1 where a1 >= 'c' or a1 < 'b' group by a1,a2,b; +END +OUTPUT +select a1, max(c) from t1 where a1 >= 'c' or a1 < 'b' group by a1, a2, b +END +INPUT +select st_astext(geometrycollection()) as result; +END +OUTPUT +select st_astext(geometrycollection()) as result from dual +END +INPUT +select event_definition, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from information_schema.events; +END +OUTPUT +select event_definition, `definer`, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from information_schema.events +END +INPUT +select uncompressed_length(compress(@test_compress_string)); +END +OUTPUT +select uncompressed_length(compress(@test_compress_string)) from dual +END +INPUT +select a from t1 having a=1; +END +OUTPUT +select a from t1 having a = 1 +END +INPUT +select a as 'x', t1.* as 'with_alias', b as 'x' from t1; +END +ERROR +syntax error at position 25 near 'as' +END +INPUT +select yearweek("2000-01-06",0) as '2000', yearweek("2001-01-06",0) as '2001', yearweek("2002-01-06",0) as '2002',yearweek("2003-01-06",0) as '2003', yearweek("2004-01-06",0) as '2004', yearweek("2005-01-06",0) as '2005', yearweek("2006-01-06",0) as '2006'; +END +OUTPUT +select yearweek('2000-01-06', 0) as `2000`, yearweek('2001-01-06', 0) as `2001`, yearweek('2002-01-06', 0) as `2002`, yearweek('2003-01-06', 0) as `2003`, yearweek('2004-01-06', 0) as `2004`, yearweek('2005-01-06', 0) as `2005`, yearweek('2006-01-06', 0) as `2006` from dual +END +INPUT +select a, t1.* from t1; +END +OUTPUT +select a, t1.* from t1 +END +INPUT +select CASE "c" when "a" then 1 when "b" then 2 ELSE 3 END; +END +OUTPUT +select case 'c' when 'a' then 1 when 'b' then 2 else 3 end from dual +END +INPUT +select substring_index('the king of the the hill','the',-2); +END +OUTPUT +select substring_index('the king of the the hill', 'the', -2) from dual +END +INPUT +select 'abc' like '%c','abcabc' like '%c', "ab" like "", "ab" like "a", "ab" like "ab"; +END +OUTPUT +select 'abc' like '%c', 'abcabc' like '%c', 'ab' like '', 'ab' like 'a', 'ab' like 'ab' from dual +END +INPUT +select (select sum(outr.a + t1.a) from t1 limit 1) as tt from t1 as outr order by outr.a; +END +OUTPUT +select (select sum(outr.a + t1.a) from t1 limit 1) as tt from t1 as outr order by outr.a asc +END +INPUT +select a from t1 where left(a+0,6) in ( left(20040106,6) ); +END +OUTPUT +select a from t1 where left(a + 0, 6) in (left(20040106, 6)) +END +INPUT +select from t1, t2, t3 where t3.a=t1.a and t2.a=t1.b; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 as x1, (select from t1) as x2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(soundex(_utf16 0x041004110412)); +END +ERROR +syntax error at position 41 near '0x041004110412' +END +INPUT +select hex(s1), hex(convert(s1 using utf8)) from t1 order by binary s1; +END +OUTPUT +select hex(s1), hex(convert(s1 using utf8)) from t1 order by binary s1 asc +END +INPUT +select "Test delimiter without arg" as " "; +END +OUTPUT +select 'Test delimiter without arg' as ` ` from dual +END +INPUT +select t1.*, (select t2.* as 'x' from t2) from t1; +END +ERROR +syntax error at position 29 near 'as' +END +INPUT +select hex(weight_string(_utf16 0xD800DC00 collate utf16_unicode_ci)); +END +ERROR +syntax error at position 43 near '0xD800DC00' +END +INPUT +select from information_schema.tables where table_name = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select max(7) from t1i; +END +OUTPUT +select max(7) from t1i +END +INPUT +select fld3 from t2 order by fld3 desc limit 5,5; +END +OUTPUT +select fld3 from t2 order by fld3 desc limit 5, 5 +END +INPUT +select pow(10,log10(10)),power(2,4); +END +OUTPUT +select pow(10, log10(10)), power(2, 4) from dual +END +INPUT +select strcmp('�a','ss'),strcmp('ssa','�'),strcmp('sssb','s�a'),strcmp('�','s'); +END +OUTPUT +select strcmp('�a', 'ss'), strcmp('ssa', '�'), strcmp('sssb', 's�a'), strcmp('�', 's') from dual +END +INPUT +select round(match(t1.texte,t1.sujet,t1.motsclefs) against('droit'),5) from t1 left join t2 on t2.id=t1.id; +END +OUTPUT +select round(match(t1.texte, t1.sujet, t1.motsclefs) against ('droit'), 5) from t1 left join t2 on t2.id = t1.id +END +INPUT +select grp,group_concat(c order by c desc) from t1 group by grp; +END +OUTPUT +select grp, group_concat(c order by c desc) from t1 group by grp +END +INPUT +select u.gender as gender, count(distinct u.id) as dist_count, (count(distinct u.id)/5*100) as percentage from t1 u, t2 l where l.user_id = u.id group by u.gender; +END +OUTPUT +select u.gender as gender, count(distinct u.id) as dist_count, count(distinct u.id) / 5 * 100 as percentage from t1 as u, t2 as l where l.user_id = u.id group by u.gender +END +INPUT +select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1; +END +OUTPUT +select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1 +END +INPUT +select FIND_IN_SET(_latin1'B' COLLATE latin1_general_ci,_latin1'a,b,c,d' COLLATE latin1_bin); +END +OUTPUT +select FIND_IN_SET(_latin1 'B' collate latin1_general_ci, _latin1 'a,b,c,d' collate latin1_bin) from dual +END +INPUT +select ifnull(a, 'xyz') from t1 group by a; +END +OUTPUT +select ifnull(a, 'xyz') from t1 group by a +END +INPUT +select a1,a2,b,min(c),max(c) from t2 where (c > 'b111') and (c <= 'g112') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t2 where c > 'b111' and c <= 'g112' group by a1, a2, b +END +INPUT +select from t1 where a in (869751,736494,226312,802616); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name ='tm' order by table_name; +END +OUTPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name = 'tm' order by table_name asc +END +INPUT +select count(*) from t1 where id1 > 90; +END +OUTPUT +select count(*) from t1 where id1 > 90 +END +INPUT +select n,d,unix_timestamp(t) from t1; +END +OUTPUT +select n, d, unix_timestamp(t) from t1 +END +INPUT +select str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA')); +END +OUTPUT +select str_to_date('15-01-2001 12:59:59', GET_FORMAT(`DATE`, 'USA')) from dual +END +INPUT +select substring('hello', 18446744073709551617, 1); +END +OUTPUT +select substr('hello', 18446744073709551617, 1) from dual +END +INPUT +select mbrtouches(ST_GeomFromText("point (2 4)"), ST_GeomFromText("point (2 4)")); +END +OUTPUT +select mbrtouches(ST_GeomFromText('point (2 4)'), ST_GeomFromText('point (2 4)')) from dual +END +INPUT +select distinct t1.a1,t2.a1 from t1,t2; +END +OUTPUT +select distinct t1.a1, t2.a1 from t1, t2 +END +INPUT +select HOUR("1997-03-03 23:03:22"), MINUTE("23:03:22"), SECOND(230322); +END +OUTPUT +select HOUR('1997-03-03 23:03:22'), MINUTE('23:03:22'), SECOND(230322) from dual +END +INPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name like 't%' and index_name = 'v' order by table_name; +END +OUTPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name like 't%' and index_name = 'v' order by table_name asc +END +INPUT +select timestamp("2001-13-01", "01:01:01.000001"); +END +OUTPUT +select timestamp('2001-13-01', '01:01:01.000001') from dual +END +INPUT +select a1,a2,b, max(c) from t1 where (c < 'a0') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c) from t1 where c < 'a0' group by a1, a2, b +END +INPUT +select hex(_utf16 0x3344); +END +ERROR +syntax error at position 25 near '0x3344' +END +INPUT +select round(-5000111000111000155,-1); +END +OUTPUT +select round(-5000111000111000155, -1) from dual +END +INPUT +select interval(null, 1, 10, 100); +END +ERROR +syntax error at position 35 +END +INPUT +select TABLE_ROWS from information_schema.tables where table_schema="information_schema" and table_name="COLUMNS"; +END +OUTPUT +select TABLE_ROWS from information_schema.`tables` where table_schema = 'information_schema' and table_name = 'COLUMNS' +END +INPUT +select hex(ujis), hex(ucs2), hex(ujis2), name from t1; +END +OUTPUT +select hex(ujis), hex(ucs2), hex(ujis2), `name` from t1 +END +INPUT +select from t1 LEFT JOIN t1 t2 ON (t1.id=t2.pid) AND t2.rep_del IS NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select benchmark(5+5, pi()); +END +OUTPUT +select benchmark(5 + 5, pi()) from dual +END +INPUT +select from t2 left join t1 ignore index(primary) on t1.fooID = t2.fooID and t1.fooID = 30; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select locate('lo','hello',4294967296); +END +OUTPUT +select locate('lo', 'hello', 4294967296) from dual +END +INPUT +select t1.* from t1 inner join t2 where t1.a = t2.a group by t1.a order by 1, 2; +END +OUTPUT +select t1.* from t1 join t2 where t1.a = t2.a group by t1.a order by 1 asc, 2 asc +END +INPUT +select 10E+0+'10'; +END +OUTPUT +select 10E+0 + '10' from dual +END +INPUT +select _latin1'B' collate latin1_bin in (_latin1'a',_latin1'b'); +END +OUTPUT +select _latin1 'B' collate latin1_bin in (_latin1 'a', _latin1 'b') from dual +END +INPUT +select from t1 where field = '2006-11-06 04:08:36.0'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select t2.fld3 FROM t2 where fld3 LIKE 'honeysuckle%'; +END +OUTPUT +select t2.fld3 from t2 where fld3 like 'honeysuckle%' +END +INPUT +select min(a3) from t1 where a2 = 2 and a3 < 'SEA'; +END +OUTPUT +select min(a3) from t1 where a2 = 2 and a3 < 'SEA' +END +INPUT +select _koi8r'a' COLLATE koi8r_bin = _koi8r'A'; +END +ERROR +syntax error at position 25 near 'COLLATE' +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_danish_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_danish_ci +END +INPUT +select group_concat(c order by (select concat(5-t1.c,group_concat(c order by a)) from t2 where t2.a=t1.a)) as grp from t1; +END +OUTPUT +select group_concat(c order by (select concat(5 - t1.c, group_concat(c order by a asc)) from t2 where t2.a = t1.a) asc) as grp from t1 +END +INPUT +select _latin1 0xFF regexp _latin1 '[[:upper:]]' COLLATE latin1_bin; +END +OUTPUT +select _latin1 0xFF regexp _latin1 '[[:upper:]]' collate latin1_bin from dual +END +INPUT +select from ((t1 natural join t2) cross join (t3 natural join t4)) natural join t5; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select dayofmonth("0000-00-00"),dayofmonth(d),dayofmonth(dt),dayofmonth(t),dayofmonth(c) from t1; +END +OUTPUT +select dayofmonth('0000-00-00'), dayofmonth(d), dayofmonth(dt), dayofmonth(t), dayofmonth(c) from t1 +END +INPUT +select date_add("1997-12-31",INTERVAL 1 SECOND); +END +OUTPUT +select date_add('1997-12-31', interval 1 SECOND) from dual +END +INPUT +select 'a' = 'a ', 'a' < 'a ', 'a' > 'a '; +END +OUTPUT +select 'a' = 'a\t', 'a' < 'a\t', 'a' > 'a\t' from dual +END +INPUT +select field(NULL,"a","b","c"); +END +OUTPUT +select field(null, 'a', 'b', 'c') from dual +END +INPUT +select round(10000000000000000000, -19), truncate(10000000000000000000, -19); +END +OUTPUT +select round(10000000000000000000, -19), truncate(10000000000000000000, -19) from dual +END +INPUT +select 1.1 + '1.2xxx'; +END +OUTPUT +select 1.1 + '1.2xxx' from dual +END +INPUT +select @@optimizer_search_depth; +END +OUTPUT +select @@optimizer_search_depth from dual +END +INPUT +select a,b,c from t3 force index (a) where a=1 order by a,b,c; +END +OUTPUT +select a, b, c from t3 force index (a) where a = 1 order by a asc, b asc, c asc +END +INPUT +select date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND); +END +OUTPUT +select date_sub('0050-01-01 00:00:01', interval 2 SECOND) from dual +END +INPUT +select t1.f1,count(distinct t2.f2),count(distinct 1,NULL) from t1 left join t2 on t1.f1=t2.f1 group by t1.f1; +END +OUTPUT +select t1.f1, count(distinct t2.f2), count(distinct 1, null) from t1 left join t2 on t1.f1 = t2.f1 group by t1.f1 +END +INPUT +select a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using (a) left join t1 as t4 using (a) left join t1 as t5 using (a) left join t1 as t6 using (a) left join t1 as t7 using (a) left join t1 as t8 using (a) left join t1 as t9 using (a) left join t1 as t10 using (a) left join t1 as t11 using (a) left join t1 as t12 using (a) left join t1 as t13 using (a) left join t1 as t14 using (a) left join t1 as t15 using (a) left join t1 as t16 using (a) left join t1 as t17 using (a) left join t1 as t18 using (a) left join t1 as t19 using (a) left join t1 as t20 using (a) left join t1 as t21 using (a) left join t1 as t22 using (a) left join t1 as t23 using (a) left join t1 as t24 using (a) left join t1 as t25 using (a) left join t1 as t26 using (a) left join t1 as t27 using (a) left join t1 as t28 using (a) left join t1 as t29 using (a) left join t1 as t30 using (a) left join t1 as t31 using (a); +END +OUTPUT +select a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using (a) left join t1 as t4 using (a) left join t1 as t5 using (a) left join t1 as t6 using (a) left join t1 as t7 using (a) left join t1 as t8 using (a) left join t1 as t9 using (a) left join t1 as t10 using (a) left join t1 as t11 using (a) left join t1 as t12 using (a) left join t1 as t13 using (a) left join t1 as t14 using (a) left join t1 as t15 using (a) left join t1 as t16 using (a) left join t1 as t17 using (a) left join t1 as t18 using (a) left join t1 as t19 using (a) left join t1 as t20 using (a) left join t1 as t21 using (a) left join t1 as t22 using (a) left join t1 as t23 using (a) left join t1 as t24 using (a) left join t1 as t25 using (a) left join t1 as t26 using (a) left join t1 as t27 using (a) left join t1 as t28 using (a) left join t1 as t29 using (a) left join t1 as t30 using (a) left join t1 as t31 using (a) +END +INPUT +select _koi8r'a' COLLATE koi8r_bin = _koi8r'A' COLLATE koi8r_general_ci; +END +ERROR +syntax error at position 25 near 'COLLATE' +END +INPUT +select from t1 where MATCH(a,b) AGAINST ("indexes" IN NATURAL LANGUAGE MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select @my_uuid_date - @my_uuid_synthetic; +END +OUTPUT +select @my_uuid_date - @my_uuid_synthetic from dual +END +INPUT +select i, count(*), variance(e1/e2) from bug22555 group by i order by i; +END +OUTPUT +select i, count(*), variance(e1 / e2) from bug22555 group by i order by i asc +END +INPUT +select substring_index('aaaaaaaaa1','aaa',-4); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aaa', -4) from dual +END +INPUT +select 1 and 0 or 2, 2 or 1 and 0; +END +OUTPUT +select 1 and 0 or 2, 2 or 1 and 0 from dual +END +INPUT +select from t1 where a like '%PESA %'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select length(data) from t1; +END +OUTPUT +select length(`data`) from t1 +END +INPUT +select table_schema, table_name, table_comment from information_schema.tables where table_schema = 'test' and table_name like 't_bug44738_%'; +END +OUTPUT +select table_schema, table_name, table_comment from information_schema.`tables` where table_schema = 'test' and table_name like 't_bug44738_%' +END +INPUT +select count(*) from t3 where id3 > 90; +END +OUTPUT +select count(*) from t3 where id3 > 90 +END +INPUT +select (select dt.a from (select 1 as a, 3 as b from t2 having t1.a) dt where dt.b=t1.a) as subq from t1; +END +OUTPUT +select (select dt.a from (select 1 as a, 3 as b from t2 having t1.a) as dt where dt.b = t1.a) as subq from t1 +END +INPUT +select ST_Touches(ST_GeomFromText('POLYGON((0 0,5 0,5 5,0 5,0 0),(1 1,3 1,3 3,1 3,1 1))'),ST_GeomFromText('LINESTRING(3 3,10 10)')) as result; +END +OUTPUT +select ST_Touches(ST_GeomFromText('POLYGON((0 0,5 0,5 5,0 5,0 0),(1 1,3 1,3 3,1 3,1 1))'), ST_GeomFromText('LINESTRING(3 3,10 10)')) as result from dual +END +INPUT +select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_general_ci); +END +ERROR +syntax error at position 43 near 'COLLATE' +END +INPUT +select substring_index('aaaaaaaaa1','aaa',-3); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aaa', -3) from dual +END +INPUT +select a1,a2,b, max(c) from t2 where (c > 'b1') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c) from t2 where c > 'b1' group by a1, a2, b +END +INPUT +select if(1,c1,'�'), if(0,c1,'�') from t1; +END +OUTPUT +select if(1, c1, '�'), if(0, c1, '�') from t1 +END +INPUT +select from v2b; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select "123456789012345678901234567890.123456789012345678901234567890" div 1 as x; +END +OUTPUT +select '123456789012345678901234567890.123456789012345678901234567890' div 1 as x from dual +END +INPUT +select concat("-",a,"-",b,"-") from t1 where a="hello "; +END +OUTPUT +select concat('-', a, '-', b, '-') from t1 where a = 'hello ' +END +INPUT +select a, (select t2.* as 'x' from t2) from t1; +END +ERROR +syntax error at position 26 near 'as' +END +INPUT +select max(a3) from t1 where a3 = 'DEN' and a2 = 2; +END +OUTPUT +select max(a3) from t1 where a3 = 'DEN' and a2 = 2 +END +INPUT +select i from t1 where a=repeat(_utf8 'a',200); +END +OUTPUT +select i from t1 where a = repeat(_utf8 'a', 200) +END +INPUT +select time_format('100:00:00', '%H %k %h %I %l'); +END +OUTPUT +select time_format('100:00:00', '%H %k %h %I %l') from dual +END +INPUT +select t1.*, t2.* from t1, t2 where t2.id=t1.t2_id limit 2; +END +OUTPUT +select t1.*, t2.* from t1, t2 where t2.id = t1.t2_id limit 2 +END +INPUT +select 24 60 60 1000 1000 10 into @my_uuid_one_day; +END +ERROR +syntax error at position 13 near '60' +END +INPUT +select count(*) from t2 where t = "bbb"; +END +OUTPUT +select count(*) from t2 where t = 'bbb' +END +INPUT +select upper('abcd'), lower('ABCD'); +END +OUTPUT +select upper('abcd'), lower('ABCD') from dual +END +INPUT +select max(a3) from t1 where a3 < 'SEA' and a2 = 2 and a3 <= 'MIN'; +END +OUTPUT +select max(a3) from t1 where a3 < 'SEA' and a2 = 2 and a3 <= 'MIN' +END +INPUT +select t1.*, t1.* from t1; +END +OUTPUT +select t1.*, t1.* from t1 +END +INPUT +select strcmp(date_sub(localtimestamp(), interval 3 hour), utc_timestamp())=0; +END +OUTPUT +select strcmp(date_sub(localtimestamp(), interval 3 hour), utc_timestamp()) = 0 from dual +END +INPUT +select a1 from t1 where a2 = 'b' group by a1; +END +OUTPUT +select a1 from t1 where a2 = 'b' group by a1 +END +INPUT +select from (select a as d, 2*a as two from t) dt; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select concat(a1,min(c)),b,max(c) from t1 where a1 < 'd' group by a1,a2,b; +END +OUTPUT +select concat(a1, min(c)), b, max(c) from t1 where a1 < 'd' group by a1, a2, b +END +INPUT +select _latin1'B' between _latin1'a' and _latin1'c'; +END +OUTPUT +select _latin1 'B' between _latin1 'a' and _latin1 'c' from dual +END +INPUT +select from t_bug25347; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from information_schema.SCHEMATA where schema_name > 'm' ORDER BY SCHEMA_NAME; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select cast(ltrim(' 20.06 ') as decimal(19,2)); +END +OUTPUT +select convert(ltrim(' 20.06 '), decimal(19, 2)) from dual +END +INPUT +select strcmp('�','ae'),strcmp('ae','�'),strcmp('aeq','�q'),strcmp('�q','aeq'); +END +OUTPUT +select strcmp('�', 'ae'), strcmp('ae', '�'), strcmp('aeq', '�q'), strcmp('�q', 'aeq') from dual +END +INPUT +select collation(reverse(_latin2'ab')), coercibility(reverse(_latin2'ab')); +END +OUTPUT +select collation(reverse(_latin2 as ab)), coercibility(reverse(_latin2 as ab)) from dual +END +INPUT +select cast(-2 as unsigned), 18446744073709551614, -2; +END +OUTPUT +select convert(-2, unsigned), 18446744073709551614, -2 from dual +END +INPUT +select timestampdiff(month,'2004-02-28','2005-02-28'); +END +OUTPUT +select timestampdiff(month, '2004-02-28', '2005-02-28') from dual +END +INPUT +select count(*), f1,if(1,'',f1) from t1 group by 2,3; +END +OUTPUT +select count(*), f1, if(1, '', f1) from t1 group by 2, 3 +END +INPUT +select str_to_date('04/30/2004 ', '%m/%d/%Y '); +END +OUTPUT +select str_to_date('04/30/2004 ', '%m/%d/%Y ') from dual +END +INPUT +select c ca10 from t1 where c='aaaaaaaaaa'; +END +OUTPUT +select c as ca10 from t1 where c = 'aaaaaaaaaa' +END +INPUT +select concat(':',trim(LEADING FROM ' left'),':',trim(TRAILING FROM ' right '),':'); +END +ERROR +syntax error at position 36 near 'FROM' +END +INPUT +select ST_AsText(ST_PolygonFromText('POLYGON((10 10,20 10,20 20,10 20, 10 10))')); +END +OUTPUT +select ST_AsText(ST_PolygonFromText('POLYGON((10 10,20 10,20 20,10 20, 10 10))')) from dual +END +INPUT +select 10.0+'10'; +END +OUTPUT +select 10.0 + '10' from dual +END +INPUT +select round(1.12e1, 4294967296), truncate(1.12e1, 4294967296); +END +OUTPUT +select round(1.12e1, 4294967296), truncate(1.12e1, 4294967296) from dual +END +INPUT +select a1,a2,b,min(c),max(c) from t2 where (c < 'c5') or (c = 'g412') or (c = 'k421') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t2 where c < 'c5' or c = 'g412' or c = 'k421' group by a1, a2, b +END +INPUT +select microsecond("1997-12-31 23:59:59.01") as a; +END +OUTPUT +select microsecond('1997-12-31 23:59:59.01') as a from dual +END +INPUT +select count(*) from t1 where c='a '; +END +OUTPUT +select count(*) from t1 where c = 'a ' +END +INPUT +select std(e1/e2) from bug22555; +END +OUTPUT +select std(e1 / e2) from bug22555 +END +INPUT +select 'вася' rlike '[[:<:]]вася[[:>:]]'; +END +OUTPUT +select 'вася' regexp '[[:<:]]вася[[:>:]]' from dual +END +INPUT +select insert('hello', -18446744073709551617, -18446744073709551617, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select from t1 where word=CAST(0xDF as CHAR); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select datediff("1997-12-31 23:59:59.000001","1997-12-30"); +END +OUTPUT +select datediff('1997-12-31 23:59:59.000001', '1997-12-30') from dual +END +INPUT +select left('hello', -18446744073709551615); +END +OUTPUT +select left('hello', -18446744073709551615) from dual +END +INPUT +select lpad('hello', -1, '1'); +END +OUTPUT +select lpad('hello', -1, '1') from dual +END +INPUT +select (12%0) is null as '1'; +END +OUTPUT +select 12 % 0 is null as `1` from dual +END +INPUT +select hex(_utf8mb4 B'001111111111'); +END +OUTPUT +select hex(_utf8mb4 B'001111111111') from dual +END +INPUT +select NULLIF(1,NULL), NULLIF(1.0, NULL), NULLIF("test", NULL); +END +OUTPUT +select NULLIF(1, null), NULLIF(1.0, null), NULLIF('test', null) from dual +END +INPUT +select 1 -9223372036854775808 as result; +END +OUTPUT +select 1 - 9223372036854775808 as result from dual +END +INPUT +select ST_contains(ST_GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)), ((6 6, 6 11, 11 11, 11 6, 6 6)))'), ST_GeomFromText('POINT(5 10)')); +END +OUTPUT +select ST_contains(ST_GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)), ((6 6, 6 11, 11 11, 11 6, 6 6)))'), ST_GeomFromText('POINT(5 10)')) from dual +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_unicode_520_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_unicode_520_ci +END +INPUT +select collation(charset(_utf8'a')), collation(collation(_utf8'a')); +END +OUTPUT +select collation(charset(_utf8 'a')), collation(collation(_utf8 'a')) from dual +END +INPUT +select last_day('2000-02-05') as f1, last_day('2002-12-31') as f2, last_day('2003-03-32') as f3, last_day('2003-04-01') as f4, last_day('2001-01-01 01:01:01') as f5, last_day(NULL), last_day('2001-02-12'); +END +OUTPUT +select last_day('2000-02-05') as f1, last_day('2002-12-31') as f2, last_day('2003-03-32') as f3, last_day('2003-04-01') as f4, last_day('2001-01-01 01:01:01') as f5, last_day(null), last_day('2001-02-12') from dual +END +INPUT +select hex(CONVERT(@utf83 USING sjis)); +END +OUTPUT +select hex(convert(@utf83 using sjis)) from dual +END +INPUT +select min(a2) from t1; +END +OUTPUT +select min(a2) from t1 +END +INPUT +select _latin1'1'=_latin2'1'; +END +OUTPUT +select _latin1 '1' = _latin2 as `1` from dual +END +INPUT +select insert('hello', -18446744073709551616, -18446744073709551616, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select concat("*",name,"*") from t1 order by 1; +END +OUTPUT +select concat('*', `name`, '*') from t1 order by 1 asc +END +INPUT +select 'a' union select concat('a', -(4 + 1)); +END +OUTPUT +(select 'a' from dual) union (select concat('a', -(4 + 1)) from dual) +END +INPUT +select otto from (select 1 as otto) as t1; +END +OUTPUT +select otto from (select 1 as otto from dual) as t1 +END +INPUT +select collation(ucase(_latin2'a')), coercibility(ucase(_latin2'a')); +END +OUTPUT +select collation(ucase(_latin2 as a)), coercibility(ucase(_latin2 as a)) from dual +END +INPUT +select hex(@utf83:= CONVERT(@ujis3 USING utf8)); +END +ERROR +syntax error at position 19 near ':' +END +INPUT +select from t1 where MATCH a,b AGAINST('"space model' IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select @ujis4 = CONVERT(@utf84 USING ujis); +END +OUTPUT +select @ujis4 = convert(@utf84 using ujis) from dual +END +INPUT +select (select from (select t1.a) cte) from t1; +END +ERROR +syntax error at position 20 near 'from' +END +INPUT +select from t11; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(a) as b from t1 where a=0 having b > 0; +END +OUTPUT +select count(a) as b from t1 where a = 0 having b > 0 +END +INPUT +select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sum(qty)>2 and count(qty)>1; +END +OUTPUT +select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sum(qty) > 2 and count(qty) > 1 +END +INPUT +select unix_timestamp('1969-11-20 01:00:00'); +END +OUTPUT +select unix_timestamp('1969-11-20 01:00:00') from dual +END +INPUT +select time_format(19980131010203,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); +END +OUTPUT +select time_format(19980131010203, '%H|%I|%k|%l|%i|%p|%r|%S|%T') from dual +END +INPUT +select format(col2,8) from t1; +END +OUTPUT +select format(col2, 8) from t1 +END +INPUT +select hex(a) from t1 ignore key(a) where a like 'A_' order by a; +END +ERROR +syntax error at position 33 near 'key' +END +INPUT +select char(196 using utf8); +END +ERROR +syntax error at position 22 near 'using' +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_romanian_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_romanian_ci +END +INPUT +select substring_index('www.tcx.se','.',-2),substring_index('www.tcx.se','.',1); +END +OUTPUT +select substring_index('www.tcx.se', '.', -2), substring_index('www.tcx.se', '.', 1) from dual +END +INPUT +select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t2 where b is null group by a1, a2 +END +INPUT +select concat("-",a,"-",b,"-") from t1 ignore index (b) where b="hello "; +END +OUTPUT +select concat('-', a, '-', b, '-') from t1 ignore index (b) where b = 'hello ' +END +INPUT +select t2.isbn,city,t1.libname,count(distinct t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city having count(distinct t1.libname) > 1; +END +OUTPUT +select t2.isbn, city, t1.libname, count(distinct t1.libname) as a from t3 left join t1 on t3.libname = t1.libname left join t2 on t3.isbn = t2.isbn group by city having count(distinct t1.libname) > 1 +END +INPUT +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +END +OUTPUT +select t2.fld3 from t2 where companynr = 58 and fld3 like '%imaginable%' +END +INPUT +select S.ID as xID, S.ID1 as xID1, repeat('*',count(distinct yS.ID)) as Level from t1 as S left join t1 as yS on S.ID1 between yS.ID1 and yS.ID2 group by xID order by xID1; +END +OUTPUT +select S.ID as xID, S.ID1 as xID1, repeat('*', count(distinct yS.ID)) as `Level` from t1 as S left join t1 as yS on S.ID1 between yS.ID1 and yS.ID2 group by xID order by xID1 asc +END +INPUT +select t1.col1 from t1 where t1.col2 in (select t2.col2 from t2 group by t2.col1, t2.col2 having col_t1 <= 10); +END +OUTPUT +select t1.col1 from t1 where t1.col2 in (select t2.col2 from t2 group by t2.col1, t2.col2 having col_t1 <= 10) +END +INPUT +select substring('hello', 18446744073709551617, 18446744073709551617); +END +OUTPUT +select substr('hello', 18446744073709551617, 18446744073709551617) from dual +END +INPUT +select repeat('hello', 4294967296); +END +OUTPUT +select repeat('hello', 4294967296) from dual +END +INPUT +select from t1 where not(a is null); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name = 'tm' and index_name = 'l' order by table_name; +END +OUTPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name = 'tm' and index_name = 'l' order by table_name asc +END +INPUT +select log(2,-1); +END +OUTPUT +select log(2, -1) from dual +END +INPUT +select a from t1 having a=3; +END +OUTPUT +select a from t1 having a = 3 +END +INPUT +select a,concat(b,'.') from t1; +END +OUTPUT +select a, concat(b, '.') from t1 +END +INPUT +select from t1 where MATCH a,b AGAINST ('"text search" -"now support"' IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select _rowid,t1._rowid,skey,sval from t1; +END +OUTPUT +select _rowid, t1._rowid, skey, sval from t1 +END +INPUT +select hex(_utf32 X'3344'); +END +ERROR +syntax error at position 26 near '3344' +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_polish_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_polish_ci +END +INPUT +select -((9223372036854775808)); +END +OUTPUT +select -9223372036854775808 from dual +END +INPUT +select from information_schema.COLUMN_PRIVILEGES where grantee like '%mysqltest_1%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a from t1 order by a; +END +OUTPUT +select a from t1 order by a asc +END +INPUT +select collation(rtrim(_latin2' a ')), coercibility(rtrim(_latin2' a ')); +END +OUTPUT +select collation(rtrim(_latin2 as ` a `)), coercibility(rtrim(_latin2 as ` a `)) from dual +END +INPUT +select strcmp('s�', '�a'), strcmp('a�', '�x'); +END +OUTPUT +select strcmp('s�', '�a'), strcmp('a�', '�x') from dual +END +INPUT +select from_unixtime(0); +END +OUTPUT +select from_unixtime(0) from dual +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_unicode_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_unicode_ci +END +INPUT +select ST_GeomFromText('linestring(5 5, 15 4)') into @l; +END +ERROR +syntax error at position 56 near 'l' +END +INPUT +select a1,a2,b,min(c),max(c) from t1 where a1 >= 'c' or a2 < 'b' group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 where a1 >= 'c' or a2 < 'b' group by a1, a2, b +END +INPUT +select from float_test; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 where a > 1 group by b having avg(a) > 2; +END +OUTPUT +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 where a > 1 group by b having avg(a) > 2 +END +INPUT +select isnull(week(now() + 0)), isnull(week(now() + 0.2)), week(20061108), week(20061108.01), week(20061108085411.000002); +END +OUTPUT +select isnull(week(now() + 0)), isnull(week(now() + 0.2)), week(20061108), week(20061108.01), week(20061108085411.000002) from dual +END +INPUT +select hex(substr(_utf32 0x000000e4000000e500000068,1)); +END +ERROR +syntax error at position 52 near '0x000000e4000000e500000068' +END +INPUT +select min(a5), max(a5) from t1; +END +OUTPUT +select min(a5), max(a5) from t1 +END +INPUT +select conv(29223372036854775809, -10, 16) as conv_signed, conv(29223372036854775809, 10, 16) as conv_unsigned; +END +OUTPUT +select conv(29223372036854775809, -10, 16) as conv_signed, conv(29223372036854775809, 10, 16) as conv_unsigned from dual +END +INPUT +select collation(convert('a', char(2))), collation(convert('a', char(2) binary)); +END +ERROR +syntax error at position 79 near 'binary' +END +INPUT +select a as foo, (select t1_inner.b from t1 as t1_inner where t1_inner.a=t1_outer.a+1) as bar from t1 as t1_outer group by a having bar<30 order by bar+5; +END +OUTPUT +select a as foo, (select t1_inner.b from t1 as t1_inner where t1_inner.a = t1_outer.a + 1) as bar from t1 as t1_outer group by a having bar < 30 order by bar + 5 asc +END +INPUT +select count(a) from t1 where a = 1; +END +OUTPUT +select count(a) from t1 where a = 1 +END +INPUT +select a from t3 order by a desc limit 10; +END +OUTPUT +select a from t3 order by a desc limit 10 +END +INPUT +select a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b; +END +OUTPUT +select a1, a2, b from t2 where a1 > 'a' and a2 > 'a' and b = 'c' group by a1, a2, b +END +INPUT +select from general_log; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select @@keycache2.key_cache_block_size; +END +OUTPUT +select @@keycache2.key_cache_block_size from dual +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL "1 1:1:1" DAY_SECOND); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval '1 1:1:1' DAY_SECOND) from dual +END +INPUT +select NULL=NULL,NULL<>NULL,IFNULL(NULL,1.1)+0,IFNULL(NULL,1) | 0; +END +OUTPUT +select null = null, null != null, IFNULL(null, 1.1) + 0, IFNULL(null, 1) | 0 from dual +END +INPUT +select from t1 where MATCH(a,b) AGAINST("sear*" IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*) from t1 where id IS NOT NULL; +END +OUTPUT +select count(*) from t1 where id is not null +END +INPUT +select a as 'x', t1.* from t1; +END +OUTPUT +select a as x, t1.* from t1 +END +INPUT +select date_add(NULL,INTERVAL 100000 SECOND); +END +OUTPUT +select date_add(null, interval 100000 SECOND) from dual +END +INPUT +select from information_schema.tables where table_schema = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select @@keycache1.key_cache_block_size; +END +OUTPUT +select @@keycache1.key_cache_block_size from dual +END +INPUT +select rand(rand); +END +OUTPUT +select rand(rand) from dual +END +INPUT +select round(1e0, -309), truncate(1e0, -309); +END +OUTPUT +select round(1e0, -309), truncate(1e0, -309) from dual +END +INPUT +select str_to_date(a,b) from t1; +END +OUTPUT +select str_to_date(a, b) from t1 +END +INPUT +select count(*) from t1 where match a against ('aaayyy' in boolean mode); +END +ERROR +syntax error at position 38 near 'a' +END +INPUT +select time("1997-12-31 23:59:59.000001"); +END +OUTPUT +select time('1997-12-31 23:59:59.000001') from dual +END +INPUT +select substring_index('aaaaaaaaa1','aa',-4); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aa', -4) from dual +END +INPUT +select right('hello', 10); +END +OUTPUT +select right('hello', 10) from dual +END +INPUT +select dayofmonth("1997-01-02"),dayofmonth(19970323); +END +OUTPUT +select dayofmonth('1997-01-02'), dayofmonth(19970323) from dual +END +INPUT +select unix_timestamp('1969-12-30 01:00:00'); +END +OUTPUT +select unix_timestamp('1969-12-30 01:00:00') from dual +END +INPUT +select from t1 where xxx regexp('is a test of some long text to se'); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where not((a < 5 or a < 10) and (not(a > 16) or a > 17)); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 1,11,101,1001,10001,100001,1000001,10000001,100000001,1000000001,10000000001,100000000001,1000000000001,10000000000001,100000000000001,1000000000000001,10000000000000001,100000000000000001,1000000000000000001,10000000000000000001; +END +OUTPUT +select 1, 11, 101, 1001, 10001, 100001, 1000001, 10000001, 100000001, 1000000001, 10000000001, 100000000001, 1000000000001, 10000000000001, 100000000000001, 1000000000000001, 10000000000000001, 100000000000000001, 1000000000000000001, 10000000000000000001 from dual +END +INPUT +select i, count(*), std(o1/o2) from bug22555 group by i order by i; +END +OUTPUT +select i, count(*), std(o1 / o2) from bug22555 group by i order by i asc +END +INPUT +select max(case col when 1 then val else null end) as color from t1 group by `row`; +END +OUTPUT +select max(case col when 1 then val else null end) as color from t1 group by `row` +END +INPUT +select count(*) > 3 from t1 group by a order by b; +END +OUTPUT +select count(*) > 3 from t1 group by a order by b asc +END +INPUT +select from t1 group by f2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select make_set(3,c1,'�'), make_set(3,'�',c1) from t1; +END +OUTPUT +select make_set(3, c1, '�'), make_set(3, '�', c1) from t1 +END +INPUT +select a.id, a.description, count(b.id) as c from t1 a left join t3 b on a.id=b.order_id group by a.id, a.description having (a.description is not null) and (c=0); +END +OUTPUT +select a.id, a.description, count(b.id) as c from t1 as a left join t3 as b on a.id = b.order_id group by a.id, a.description having a.description is not null and c = 0 +END +INPUT +select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b; +END +OUTPUT +select t1.a, t2.b from t1, t2 where t1.a = t2.a group by t1.a, t2.b +END +INPUT +select from t1 where a = 2 or not(a < 10); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select grp,group_concat(c order by grp desc) from t1 group by grp order by grp; +END +OUTPUT +select grp, group_concat(c order by grp desc) from t1 group by grp order by grp asc +END +INPUT +select a1,a2,b,min(c),max(c) from t2 where (b = 'b') group by a1,a2; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t2 where b = 'b' group by a1, a2 +END +INPUT +select (select t2.* from t2) from t1; +END +OUTPUT +select (select t2.* from t2) from t1 +END +INPUT +select from t1 left outer join t2 using (f2) left outer join t3 using (f3); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select concat_ws(c1,'�','�'), concat_ws('�',c1,'�') from t1; +END +OUTPUT +select concat_ws(c1, '�', '�'), concat_ws('�', c1, '�') from t1 +END +INPUT +select c c3 from t1 where c='3'; +END +OUTPUT +select c as c3 from t1 where c = '3' +END +INPUT +select from t1 where MATCH a AGAINST ("search" IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where concat(A,C,B,D) = 'AAAA2003-03-011051'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from m1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(weight_string('a' as char(1))); +END +ERROR +syntax error at position 38 +END +INPUT +select t1.id, count(t2.id) from t1,t2 where t2.id = t1.id group by t2.id; +END +OUTPUT +select t1.id, count(t2.id) from t1, t2 where t2.id = t1.id group by t2.id +END +INPUT +select hex(@utf84); +END +OUTPUT +select hex(@utf84) from dual +END +INPUT +select truncate(1.5, -4294967296), truncate(1.5, 4294967296); +END +OUTPUT +select truncate(1.5, -4294967296), truncate(1.5, 4294967296) from dual +END +INPUT +select hex(inet_aton('127.1')); +END +OUTPUT +select hex(inet_aton('127.1')) from dual +END +INPUT +select left('hello', 18446744073709551617); +END +OUTPUT +select left('hello', 18446744073709551617) from dual +END +INPUT +select unix_timestamp('2038-01-19 07:14:07'); +END +OUTPUT +select unix_timestamp('2038-01-19 07:14:07') from dual +END +INPUT +select from (t3 natural join t4) natural right join (t1 natural join t2); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 group by f1, f2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select quote(name) from bug20536; +END +OUTPUT +select quote(`name`) from bug20536 +END +INPUT +select round(111,-10); +END +OUTPUT +select round(111, -10) from dual +END +INPUT +select charset(group_concat(c1 order by c2)) from t1; +END +OUTPUT +select charset(group_concat(c1 order by c2 asc)) from t1 +END +INPUT +select ST_astext(ST_Intersection(ST_GeomFromText('LINESTRING(0 0, 50 45, 40 50, 0 0)'), ST_GeomFromText('LINESTRING(50 5, 55 10, 0 45, 50 5)'))); +END +OUTPUT +select ST_astext(ST_Intersection(ST_GeomFromText('LINESTRING(0 0, 50 45, 40 50, 0 0)'), ST_GeomFromText('LINESTRING(50 5, 55 10, 0 45, 50 5)'))) from dual +END +INPUT +select load_file("/proc/self/fd/0"); +END +OUTPUT +select load_file('/proc/self/fd/0') from dual +END +INPUT +select hex(c), c, name from t1 order by 1; +END +OUTPUT +select hex(c), c, `name` from t1 order by 1 asc +END +INPUT +select "NEW CONNECTION"; +END +OUTPUT +select 'NEW CONNECTION' from dual +END +INPUT +select st_astext(st_intersection(ST_GeometryFromText('geometrycollection(polygon((0 0, 1 0, 1 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 2 0, 2 1, 1 1, 1 0)))'))); +END +OUTPUT +select st_astext(st_intersection(ST_GeometryFromText('geometrycollection(polygon((0 0, 1 0, 1 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 2 0, 2 1, 1 1, 1 0)))'))) from dual +END +INPUT +select Fld1, max(Fld2) from t1 group by Fld1 having std(Fld2) is not null; +END +OUTPUT +select Fld1, max(Fld2) from t1 group by Fld1 having std(Fld2) is not null +END +INPUT +select SQL_BIG_RESULT distinct t1.a from t1, t2 group by t1.b order by 1; +END +ERROR +syntax error at position 31 near 'distinct' +END +INPUT +select t1.time+0,t1.date+0,t1.timestamp+0,concat(date," ",time), t1.quarter+t1.week, t1.year+timestampadd, timestampdiff from t1; +END +ERROR +syntax error at position 107 +END +INPUT +select substring_index('aaaaaaaaa1','aa',1); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aa', 1) from dual +END +INPUT +select -(0-3),round(-(0-3)), round(9999999999999999999); +END +OUTPUT +select -(0 - 3), round(-(0 - 3)), round(9999999999999999999) from dual +END +INPUT +select sum(col1) as co2, count(col2) as cc from t1 group by col1 having col1 =10; +END +OUTPUT +select sum(col1) as co2, count(col2) as cc from t1 group by col1 having col1 = 10 +END +INPUT +select concat(a, if(b>10, N'æ', N'ß')) from t1; +END +OUTPUT +select concat(a, if(b > 10, N as `æ`, N as `ß`)) from t1 +END +INPUT +select date_format(19980021000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T| %M|%W|%D|%Y|%y|%a|%b|%j|%m|%d|%h|%s|%w'); +END +OUTPUT +select date_format(19980021000000, '%H|%I|%k|%l|%i|%p|%r|%S|%T| %M|%W|%D|%Y|%y|%a|%b|%j|%m|%d|%h|%s|%w') from dual +END +INPUT +select 1, ST_Intersects(ST_GeomFromText('LINESTRING(15 15, 50 50)'), ST_GeomFromText('LINESTRING(16 16, 51 51)')); +END +OUTPUT +select 1, ST_Intersects(ST_GeomFromText('LINESTRING(15 15, 50 50)'), ST_GeomFromText('LINESTRING(16 16, 51 51)')) from dual +END +INPUT +select ST_astext(st_difference(ST_GeomFromText('multipoint(2 2, 3 3)'), ST_GeomFromText('multipoint(2 2, 3 3)'))); +END +OUTPUT +select ST_astext(st_difference(ST_GeomFromText('multipoint(2 2, 3 3)'), ST_GeomFromText('multipoint(2 2, 3 3)'))) from dual +END +INPUT +select bit_length('; +END +ERROR +syntax error at position 21 near ';' +END +INPUT +select from t3 order by a desc; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select st_astext(st_difference(ST_GeometryFromText('geometrycollection(polygon((0 0, 1 0, 1 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 2 0, 2 1, 1 1, 1 0)))'))); +END +OUTPUT +select st_astext(st_difference(ST_GeometryFromText('geometrycollection(polygon((0 0, 1 0, 1 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 2 0, 2 1, 1 1, 1 0)))'))) from dual +END +INPUT +select coercibility(col1), collation(col1)from v2; +END +OUTPUT +select coercibility(col1), collation(col1) from v2 +END +INPUT +select hex(char(0x01020304 using utf32)); +END +ERROR +syntax error at position 33 near 'using' +END +INPUT +select count(distinct case when id<=64 then id end) from tb; +END +OUTPUT +select count(distinct case when id <= 64 then id end) from tb +END +INPUT +select from t1 where xxx regexp('is a test of some long text to'); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select b from t1 group by binary b like ''; +END +OUTPUT +select b from t1 group by binary b like '' +END +INPUT +select hex(_utf32 0x3344); +END +ERROR +syntax error at position 25 near '0x3344' +END +INPUT +select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')>time('00:00:00'); +END +OUTPUT +select timediff('2008-09-29 20:10:10', '2008-09-30 20:10:10') > time('00:00:00') from dual +END +INPUT +select st_touches(ST_GeomFromText('point(1 1)'), ST_GeomFromText('point(1 1)')); +END +OUTPUT +select st_touches(ST_GeomFromText('point(1 1)'), ST_GeomFromText('point(1 1)')) from dual +END +INPUT +select SUBSTRING_INDEX(_latin1'abcdabcdabcd' COLLATE latin1_bin,_latin1'd',2); +END +OUTPUT +select SUBSTRING_INDEX(_latin1 'abcdabcdabcd' collate latin1_bin, _latin1 'd', 2) from dual +END +INPUT +select fld3 FROM t2 order by fld3 desc limit 10; +END +OUTPUT +select fld3 from t2 order by fld3 desc limit 10 +END +INPUT +select group_concat(a1 order by (t1.a IN (select a0 from t2))) from t1; +END +OUTPUT +select group_concat(a1 order by t1.a in (select a0 from t2) asc) from t1 +END +INPUT +select st_within(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_within(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select timediff("1997-01-01 23:59:59.000001","1995-12-31 23:59:59.000002"); +END +OUTPUT +select timediff('1997-01-01 23:59:59.000001', '1995-12-31 23:59:59.000002') from dual +END +INPUT +select a as foo, (select t1_inner.b from t1 as t1_inner where t1_inner.a=t1_outer.a+1) as bar from t1 as t1_outer group by foo having bar<30 order by bar+5; +END +OUTPUT +select a as foo, (select t1_inner.b from t1 as t1_inner where t1_inner.a = t1_outer.a + 1) as bar from t1 as t1_outer group by foo having bar < 30 order by bar + 5 asc +END +INPUT +select group_concat(distinct a order by a desc) from t1; +END +OUTPUT +select group_concat(distinct a order by a desc) from t1 +END +INPUT +select ST_astext(ST_symdifference(ST_GeomFromText('polygon((0 0, 1 0, 0 1, 0 0))'), ST_GeomFromText('polygon((0 0, 1 0, 0 0,0 1, 0 0))'))) as result; +END +OUTPUT +select ST_astext(ST_symdifference(ST_GeomFromText('polygon((0 0, 1 0, 0 1, 0 0))'), ST_GeomFromText('polygon((0 0, 1 0, 0 0,0 1, 0 0))'))) as result from dual +END +INPUT +select extract(HOUR_SECOND FROM "10:11:12"); +END +ERROR +syntax error at position 32 near 'FROM' +END +INPUT +select a as like_lllll from t1 where a like 'lllll%'; +END +OUTPUT +select a as like_lllll from t1 where a like 'lllll%' +END +INPUT +select format(NULL, NULL); +END +OUTPUT +select format(null, null) from dual +END +INPUT +select t1.col1 from t1 where t1.col2 in (select t2.col2 from t2 group by t2.col1, t2.col2 having t2.col1 <= (select min(t3.col1) from t3)); +END +OUTPUT +select t1.col1 from t1 where t1.col2 in (select t2.col2 from t2 group by t2.col1, t2.col2 having t2.col1 <= (select min(t3.col1) from t3)) +END +INPUT +select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on t2.b=t3.a order by 1; +END +OUTPUT +select t2.b, ifnull(t2.b, 'this is null') from t1 as t2 left join t1 as t3 on t2.b = t3.a order by 1 asc +END +INPUT +select cast('abc' as signed); +END +OUTPUT +select convert('abc', signed) from dual +END +INPUT +select hex(_utf8mb4 0x616263FF); +END +OUTPUT +select hex(_utf8mb4 0x616263FF) from dual +END +INPUT +select t2.fld3,companynr FROM t2 where companynr = 57+1 order by fld3; +END +OUTPUT +select t2.fld3, companynr from t2 where companynr = 57 + 1 order by fld3 asc +END +INPUT +select cast(NULL as unsigned), cast(1/0 as unsigned); +END +OUTPUT +select convert(null, unsigned), convert(1 / 0, unsigned) from dual +END +INPUT +select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv order by Column_name; +END +OUTPUT +select Host, Db, `User`, Table_name, Column_name, Column_priv from mysql.columns_priv order by Column_name asc +END +INPUT +select COLUMN_NAME from information_schema.columns where table_schema='test' order by COLUMN_NAME; +END +OUTPUT +select COLUMN_NAME from information_schema.`columns` where table_schema = 'test' order by COLUMN_NAME asc +END +INPUT +select @@GLOBAL.relay_log_info_repository into @save_relay_log_info_repository; +END +ERROR +syntax error at position 79 near 'save_relay_log_info_repository' +END +INPUT +select SUBSTR('abcdefg',-1,-1) FROM DUAL; +END +OUTPUT +select substr('abcdefg', -1, -1) from dual +END +INPUT +select char_length(_utf16 0xD800DC00), octet_length(_utf16 0xD800DC00); +END +ERROR +syntax error at position 37 near '0xD800DC00' +END +INPUT +select cast(10000002383263201056 as unsigned) mod 50 as result; +END +OUTPUT +select convert(10000002383263201056, unsigned) % 50 as result from dual +END +INPUT +select floor(conv(@my_uuidate,16,10)/@my_uuid_one_day) into @my_uuid_date; +END +ERROR +syntax error at position 74 near 'my_uuid_date' +END +INPUT +select a1,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1; +END +OUTPUT +select a1, max(c), min(c) from t3 where a2 = 'a' and b = 'b' group by a1 +END +INPUT +select st_crosses(ST_GeometryFromText('geometrycollection(multipoint(0 0, 1 0, 1 1, 0 1, 0 0))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 2 0, 2 1, 1 1, 1 0)))')); +END +OUTPUT +select st_crosses(ST_GeometryFromText('geometrycollection(multipoint(0 0, 1 0, 1 1, 0 1, 0 0))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 2 0, 2 1, 1 1, 1 0)))')) from dual +END +INPUT +select a1,a2,min(b),c from t2 where (a2 = 'a') and (c = 'a111') group by a1; +END +OUTPUT +select a1, a2, min(b), c from t2 where a2 = 'a' and c = 'a111' group by a1 +END +INPUT +select locate('HE','hello' collate ujis_bin); +END +OUTPUT +select locate('HE', 'hello' collate ujis_bin) from dual +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL NULL MINUTE_SECOND); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval null MINUTE_SECOND) from dual +END +INPUT +select timestampdiff(month,'2005-09-11','2004-09-11'); +END +OUTPUT +select timestampdiff(month, '2005-09-11', '2004-09-11') from dual +END +INPUT +select max(a3) from t1 where a2 is null; +END +OUTPUT +select max(a3) from t1 where a2 is null +END +INPUT +select CASE "b" when "a" then 1 when binary "B" then 2 WHEN "b" then "ok" END; +END +OUTPUT +select case 'b' when 'a' then 1 when binary 'B' then 2 when 'b' then 'ok' end from dual +END +INPUT +select id,concat(facility) from t1 group by id; +END +OUTPUT +select id, concat(facility) from t1 group by id +END +INPUT +select substring_index('the king of the the hill','the',2); +END +OUTPUT +select substring_index('the king of the the hill', 'the', 2) from dual +END +INPUT +select lpad('hello', 4294967295, '1'); +END +OUTPUT +select lpad('hello', 4294967295, '1') from dual +END +INPUT +select min(a) is null or null from t1; +END +OUTPUT +select min(a) is null or null from t1 +END +INPUT +select a, not(not(a)) from t1; +END +OUTPUT +select a, not not a from t1 +END +INPUT +select substring_index('aaaaaaaaa1','aaaa',1); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aaaa', 1) from dual +END +INPUT +select st_distance(ST_GeomFromText('geometrycollection(geometrycollection(),polygon((0 0,0 10,10 10,10 0,0 0)))'),ST_GeomFromText('linestring(0 0,10 10)')); +END +OUTPUT +select st_distance(ST_GeomFromText('geometrycollection(geometrycollection(),polygon((0 0,0 10,10 10,10 0,0 0)))'), ST_GeomFromText('linestring(0 0,10 10)')) from dual +END +INPUT +select day("1997-12-31 23:59:59.000001"); +END +OUTPUT +select day('1997-12-31 23:59:59.000001') from dual +END +INPUT +select @@session.thread_handling; +END +OUTPUT +select @@session.thread_handling from dual +END +INPUT +select convert(_koi8r'�' using utf8) < convert(_koi8r'�' using utf8); +END +ERROR +syntax error at position 27 near '�' +END +INPUT +select rpad('hello', -1, '1'); +END +OUTPUT +select rpad('hello', -1, '1') from dual +END +INPUT +select strcmp(localtimestamp(),concat(current_date()," ",current_time())); +END +OUTPUT +select strcmp(localtimestamp(), concat(current_date(), ' ', current_time())) from dual +END +INPUT +select "18383815659218730760" + 0; +END +OUTPUT +select '18383815659218730760' + 0 from dual +END +INPUT +select count(*) from t1 where id1 > 5; +END +OUTPUT +select count(*) from t1 where id1 > 5 +END +INPUT +select round(4, -4294967200), truncate(4, -4294967200); +END +OUTPUT +select round(4, -4294967200), truncate(4, -4294967200) from dual +END +INPUT +select date_sub("1998-01-01 00:00:00.000001",INTERVAL "1:1:1.000002" HOUR_MICROSECOND); +END +OUTPUT +select date_sub('1998-01-01 00:00:00.000001', interval '1:1:1.000002' HOUR_MICROSECOND) from dual +END +INPUT +select hex(soundex(_utf8 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB)); +END +OUTPUT +select hex(soundex(_utf8 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB)) from dual +END +INPUT +select a2 from t3 join (t1 join t2 using (a1)) on b=c1 join t4 using (c2); +END +OUTPUT +select a2 from t3 join (t1 join t2 using (a1)) on b = c1 join t4 using (c2) +END +INPUT +select s1 as after_delete_unicode_ci from t1 where s1 like 'ペテ%'; +END +OUTPUT +select s1 as after_delete_unicode_ci from t1 where s1 like 'ペテ%' +END +INPUT +select rpad('abcd',1,'ab'),lpad('abcd',1,'ab'); +END +OUTPUT +select rpad('abcd', 1, 'ab'), lpad('abcd', 1, 'ab') from dual +END +INPUT +select A.* from (t1 inner join (select from t2) as A on t1.ID = A.FID); +END +ERROR +syntax error at position 44 near 'from' +END +INPUT +select b.id, group_concat(b.name) from t1 a, t1 b group by b.id; +END +OUTPUT +select b.id, group_concat(b.`name`) from t1 as a, t1 as b group by b.id +END +INPUT +select 0 limit 0; +END +OUTPUT +select 0 from dual limit 0 +END +INPUT +select 1, ST_Within(ST_GeomFromText('LINESTRING(15 15, 16 16)'), ST_GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')); +END +OUTPUT +select 1, ST_Within(ST_GeomFromText('LINESTRING(15 15, 16 16)'), ST_GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')) from dual +END +INPUT +select count(distinct n) from t1; +END +OUTPUT +select count(distinct n) from t1 +END +INPUT +select concat('|', text1, '|') as c from t1 where text1='teststring' or text1 like 'teststring_%' order by c; +END +OUTPUT +select concat('|', text1, '|') as c from t1 where text1 = 'teststring' or text1 like 'teststring_%' order by c asc +END +INPUT +select table_name, column_name, privileges from information_schema.columns where table_schema = 'mysqltest' and table_name = 't1' order by table_name, column_name; +END +OUTPUT +select table_name, column_name, `privileges` from information_schema.`columns` where table_schema = 'mysqltest' and table_name = 't1' order by table_name asc, column_name asc +END +INPUT +select hex(ujis), hex(ucs2), hex(ujis2), name from t1 where ujis<>ujis2 order by ujis; +END +OUTPUT +select hex(ujis), hex(ucs2), hex(ujis2), `name` from t1 where ujis != ujis2 order by ujis asc +END +INPUT +select _koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A'; +END +ERROR +syntax error at position 25 near 'COLLATE' +END +INPUT +select '2007-01-01' + interval a day from t1; +END +OUTPUT +select '2007-01-01' + interval a day from t1 +END +INPUT +select count(*) from t2 right join t1 on (t1.id = t2.owner); +END +OUTPUT +select count(*) from t2 right join t1 on t1.id = t2.owner +END +INPUT +select rpad('hello', 4294967296, '1'); +END +OUTPUT +select rpad('hello', 4294967296, '1') from dual +END +INPUT +select t2.col2 from t2 group by t2.col1, t2.col2 having t1.col1 <= 10; +END +OUTPUT +select t2.col2 from t2 group by t2.col1, t2.col2 having t1.col1 <= 10 +END +INPUT +select from t1 where a like "test%"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 1+2/*hello*/+3; +END +OUTPUT +select 1 + 2 + 3 from dual +END +INPUT +select ceil(0.000000000000000009); +END +OUTPUT +select ceil(0.000000000000000009) from dual +END +INPUT +select rpad('abc', cast(5 as unsigned integer), 'x'); +END +OUTPUT +select rpad('abc', convert(5, unsigned), 'x') from dual +END +INPUT +select ~5, cast(~5 as signed); +END +OUTPUT +select ~5, convert(~5, signed) from dual +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL NULL SECOND); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval null SECOND) from dual +END +INPUT +select 1 from t1 group by 2; +END +OUTPUT +select 1 from t1 group by 2 +END +INPUT +select hex(convert(_eucjpms 0x8FABF841 using ucs2)); +END +ERROR +syntax error at position 39 near '0x8FABF841' +END +INPUT +select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121'); +END +OUTPUT +select count(distinct a1, a2, b, c) from t1 where a2 >= 'b' and b = 'a' and c = 'i121' +END +INPUT +select (select distinct 1 from t1 t1_inner group by t1_inner.a order by max(t1_outer.b)) from t1 t1_outer; +END +OUTPUT +select (select distinct 1 from t1 as t1_inner group by t1_inner.a order by max(t1_outer.b) asc) from t1 as t1_outer +END +INPUT +select index_length into @paked_keys_size from information_schema.tables where table_name='t1'; +END +ERROR +syntax error at position 42 near 'paked_keys_size' +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_croatian_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_croatian_ci +END +INPUT +select var_samp(e) as '0.5', var_pop(e) as '0.25' from bug22555; +END +OUTPUT +select var_samp(e) as `0.5`, var_pop(e) as `0.25` from bug22555 +END +INPUT +select Fld1, max(Fld2) as q from t1 group by Fld1 having q is not null; +END +OUTPUT +select Fld1, max(Fld2) as q from t1 group by Fld1 having q is not null +END +INPUT +select 'zвасяz' rlike '[[:<:]]вася[[:>:]]'; +END +OUTPUT +select 'zвасяz' regexp '[[:<:]]вася[[:>:]]' from dual +END +INPUT +select insert('hello', -1, -1, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select FIELD('b' COLLATE latin1_bin,'A','B'); +END +OUTPUT +select FIELD('b' collate latin1_bin, 'A', 'B') from dual +END +INPUT +select floor(cast(-2 as unsigned)), floor(18446744073709551614), floor(-2); +END +OUTPUT +select floor(convert(-2, unsigned)), floor(18446744073709551614), floor(-2) from dual +END +INPUT +select a.f1 as a, b.f3 as b, a.f1 > b.f3 as gt, a.f1 < b.f3 as lt, a.f1<=>b.f3 as eq from t1 a, t1 b; +END +OUTPUT +select a.f1 as a, b.f3 as b, a.f1 > b.f3 as gt, a.f1 < b.f3 as lt, a.f1 <=> b.f3 as eq from t1 as a, t1 as b +END +INPUT +select date_add('1996-02-29',Interval '1' year); +END +OUTPUT +select date_add('1996-02-29', interval '1' year) from dual +END +INPUT +select concat('|', text1, '|') from t1 where text1='teststring' or text1 >= 'teststring '; +END +OUTPUT +select concat('|', text1, '|') from t1 where text1 = 'teststring' or text1 >= 'teststring\t' +END +INPUT +select t1.*, t2.* from t1 left join t2 on t1.n = t2.n and t1.m = t2.m where t1.n = 1 order by t1.o,t1.m; +END +OUTPUT +select t1.*, t2.* from t1 left join t2 on t1.n = t2.n and t1.m = t2.m where t1.n = 1 order by t1.o asc, t1.m asc +END +INPUT +select CONNECTION_ID() into @thread_id; +END +ERROR +syntax error at position 39 near 'thread_id' +END +INPUT +select from information_schema.CHARACTER_SETS where CHARACTER_SET_NAME like 'latin1%' order by character_set_name; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select "Test 'go' command g" as "_"; +END +OUTPUT +select 'Test \'go\' command g' as _ from dual +END +INPUT +select group_concat(a) from t1 group by b; +END +OUTPUT +select group_concat(a) from t1 group by b +END +INPUT +select ST_astext(st_union( st_intersection( multipoint(point(-1,-1)), point(1,-1) ), st_difference( multipoint(point(-1,1)), point(-1,-1) ))); +END +OUTPUT +select ST_astext(st_union(st_intersection(multipoint(point(-1, -1)), point(1, -1)), st_difference(multipoint(point(-1, 1)), point(-1, -1)))) from dual +END +INPUT +select from t1, lateral (with qn as (select t1.a) select (select max(a) from qn)) as dt; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select referenced_table_schema, referenced_table_name from information_schema.key_column_usage where constraint_schema = 'db-1' and table_schema != 'PERFORMANCE_SCHEMA' order by referenced_table_schema, referenced_table_name; +END +OUTPUT +select referenced_table_schema, referenced_table_name from information_schema.key_column_usage where constraint_schema = 'db-1' and table_schema != 'PERFORMANCE_SCHEMA' order by referenced_table_schema asc, referenced_table_name asc +END +INPUT +select min(a1) from t1; +END +OUTPUT +select min(a1) from t1 +END +INPUT +select strcmp('ss','�'),strcmp('�','ss'),strcmp('�s','sss'),strcmp('�q','ssq'); +END +OUTPUT +select strcmp('ss', '�'), strcmp('�', 'ss'), strcmp('�s', 'sss'), strcmp('�q', 'ssq') from dual +END +INPUT +select count(s1) from t1 group by s1 having s1*0=0; +END +OUTPUT +select count(s1) from t1 group by s1 having s1 * 0 = 0 +END +INPUT +select visitor_id,max(ts) as mts from t1 group by visitor_id having mts < DATE_SUB(NOW(),INTERVAL 3 MONTH); +END +OUTPUT +select visitor_id, max(ts) as mts from t1 group by visitor_id having mts < DATE_SUB(NOW(), interval 3 MONTH) +END +INPUT +select f1, f2, if(f1, 40.0, 5.00) from t1 group by f1 order by f2; +END +OUTPUT +select f1, f2, if(f1, 40.0, 5.00) from t1 group by f1 order by f2 asc +END +INPUT +select var_samp(s) as '0.5', var_pop(s) as '0.25' from bug22555; +END +OUTPUT +select var_samp(s) as `0.5`, var_pop(s) as `0.25` from bug22555 +END +INPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name like 't%' and index_name = 'q' order by table_name; +END +OUTPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name like 't%' and index_name = 'q' order by table_name asc +END +INPUT +select export_set(5, name, upper(name)) from bug20536; +END +OUTPUT +select export_set(5, `name`, upper(`name`)) from bug20536 +END +INPUT +select convert(char(0xff,0x8f) using utf8); +END +OUTPUT +select convert(char(0xff, 0x8f) using utf8) from dual +END +INPUT +select count(*) from t1 where t = "aaa"; +END +OUTPUT +select count(*) from t1 where t = 'aaa' +END +INPUT +select hex(weight_string(cast(0xE0A1 as char))); +END +OUTPUT +select hex(weight_string(convert(0xE0A1, char))) from dual +END +INPUT +select col1 as count_col1,col2 from t1 as tmp1 group by col1,col2 having col2 = 'hello'; +END +OUTPUT +select col1 as count_col1, col2 from t1 as tmp1 group by col1, col2 having col2 = 'hello' +END +INPUT +select a1,a2,b,max(c) from t2 where b is NULL group by a1,a2; +END +OUTPUT +select a1, a2, b, max(c) from t2 where b is null group by a1, a2 +END +INPUT +select a as like_aaaaa from t1 where a like 'aaaaa%'; +END +OUTPUT +select a as like_aaaaa from t1 where a like 'aaaaa%' +END +INPUT +select distinct a from t1; +END +OUTPUT +select distinct a from t1 +END +INPUT +select from t1 where MATCH(a,b) AGAINST("+support +collections" IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(substr(_utf32 0x000000e4000000e500000068,2)); +END +ERROR +syntax error at position 52 near '0x000000e4000000e500000068' +END +INPUT +select /lib64/ user, host, db, command, state, info from information_schema.processlist where (info like "select get_lock%" OR user='event_scheduler') order by info; +END +ERROR +syntax error at position 9 +END +INPUT +select format(atan2(pi(), 0), 6); +END +OUTPUT +select format(atan2(pi(), 0), 6) from dual +END +INPUT +select from t1 natural left join t2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select MYSQLTEST.T1.* from MYSQLTEST.T1; +END +OUTPUT +select MYSQLTEST.T1.* from MYSQLTEST.T1 +END +INPUT +select hex(cast('a' as binary(2))); +END +OUTPUT +select hex(convert('a', binary(2))) from dual +END +INPUT +select group_concat(distinct a order by a) from t1; +END +OUTPUT +select group_concat(distinct a order by a asc) from t1 +END +INPUT +select t1a.a, t1b.a from t1 as t1a, t1 as t1b where t1a.a=t1b.a order by binary t1a.a, binary t1b.a; +END +OUTPUT +select t1a.a, t1b.a from t1 as t1a, t1 as t1b where t1a.a = t1b.a order by binary t1a.a asc, binary t1b.a asc +END +INPUT +select from information_schema.partitions where table_schema="test" and table_name="t4"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(group_concat(a)) from t1; +END +OUTPUT +select hex(group_concat(a)) from t1 +END +INPUT +select period_add(-9223372036854775808,29880); +END +OUTPUT +select period_add(-9223372036854775808, 29880) from dual +END +INPUT +select hex(char(0x01 using ucs2)); +END +ERROR +syntax error at position 27 near 'using' +END +INPUT +select from information_schema.columns where table_schema = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select distinct n1,n2 from t1; +END +OUTPUT +select distinct n1, n2 from t1 +END +INPUT +select ceil(0.09); +END +OUTPUT +select ceil(0.09) from dual +END +INPUT +select unix_timestamp(from_unixtime(2147483648)); +END +OUTPUT +select unix_timestamp(from_unixtime(2147483648)) from dual +END +INPUT +select from t2,t3 where MATCH (t2.inhalt,t3.inhalt) AGAINST ('foobar'); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select weekofyear("1997-11-30 23:59:59.000001"); +END +OUTPUT +select weekofyear('1997-11-30 23:59:59.000001') from dual +END +INPUT +select a from t2; +END +OUTPUT +select a from t2 +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_hungarian_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_hungarian_ci +END +INPUT +select from t1 where a like "%ss%"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(_utf8mb4 X'616263FF'); +END +OUTPUT +select hex(_utf8mb4 X'616263FF') from dual +END +INPUT +select concat(a,'.') from t1 where binary a='aaa'; +END +OUTPUT +select concat(a, '.') from t1 where binary a = 'aaa' +END +INPUT +select t1.a, dt.a from t1, lateral (select t1.a+t2.a as a from t2) dt; +END +ERROR +syntax error at position 37 +END +INPUT +select sum(qty) as sqty from t1 group by id having count(id) > 0; +END +OUTPUT +select sum(qty) as sqty from t1 group by id having count(id) > 0 +END +INPUT +select repeat('hello', -18446744073709551616); +END +OUTPUT +select repeat('hello', -18446744073709551616) from dual +END +INPUT +select concat("-",a,"-",b,"-") from t1; +END +OUTPUT +select concat('-', a, '-', b, '-') from t1 +END +INPUT +select hex(char(0x01 using utf32)); +END +ERROR +syntax error at position 27 near 'using' +END +INPUT +select str_to_date("2003-01-02 10:11:12.0012ABCD", "%Y-%m-%d %H:%i:%S.%f") as f1, addtime("-01:01:01.01 GGG", "-23:59:59.1") as f2, microsecond("1997-12-31 23:59:59.01XXXX") as f3; +END +OUTPUT +select str_to_date('2003-01-02 10:11:12.0012ABCD', '%Y-%m-%d %H:%i:%S.%f') as f1, addtime('-01:01:01.01 GGG', '-23:59:59.1') as f2, microsecond('1997-12-31 23:59:59.01XXXX') as f3 from dual +END +INPUT +select locate('lo','hello',4294967297); +END +OUTPUT +select locate('lo', 'hello', 4294967297) from dual +END +INPUT +select b+0 from t1 order by b; +END +OUTPUT +select b + 0 from t1 order by b asc +END +INPUT +select @category2_id:= 10002; +END +ERROR +syntax error at position 22 near ':' +END +INPUT +select CONVERT("2004-01-22 21:45:33",DATE); +END +OUTPUT +select convert('2004-01-22 21:45:33', DATE) from dual +END +INPUT +select a as gci1 from t1 where a like 'さしすせそかきくけこあいうえお%'; +END +OUTPUT +select a as gci1 from t1 where a like 'さしすせそかきくけこあいうえお%' +END +INPUT +select concat(concat(_latin1'->',f1),_latin1'<-') from t1; +END +OUTPUT +select concat(concat(_latin1 '->', f1), _latin1 '<-') from t1 +END +INPUT +select insert('hello', 1, -4294967296, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select from t1, t2 where t2.a=t1.a and t2.b + 1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select cast(min(df) as signed) from t1; +END +OUTPUT +select convert(min(df), signed) from t1 +END +INPUT +select _koi8r'a' LIKE _latin1'A'; +END +ERROR +syntax error at position 22 near 'LIKE' +END +INPUT +select from information_schema.schemata where schema_name = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select rpad('a',4,'1'),rpad('a',4,'12'),rpad('abcd',3,'12'), rpad(11, 10 , 22), rpad("ab", 10, 22); +END +OUTPUT +select rpad('a', 4, '1'), rpad('a', 4, '12'), rpad('abcd', 3, '12'), rpad(11, 10, 22), rpad('ab', 10, 22) from dual +END +INPUT +select degrees(pi()),radians(360); +END +OUTPUT +select degrees(pi()), radians(360) from dual +END +INPUT +select quote(ltrim(concat(' ', 'a'))); +END +OUTPUT +select quote(ltrim(concat(' ', 'a'))) from dual +END +INPUT +select insert('txs',2,null,'hi'),insert('txs',2,1,null); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select concat(a,'.') from t1 where a='a'; +END +OUTPUT +select concat(a, '.') from t1 where a = 'a' +END +INPUT +select locate('lo','hello',-18446744073709551617); +END +OUTPUT +select locate('lo', 'hello', -18446744073709551617) from dual +END +INPUT +select 1, ST_touches(t.geom, p.geom) from tbl_polygon t, tbl_polygon p where t.id = 'POLY1' and p.id = 'POLY2'; +END +OUTPUT +select 1, ST_touches(t.geom, p.geom) from tbl_polygon as t, tbl_polygon as p where t.id = 'POLY1' and p.id = 'POLY2' +END +INPUT +select from (select from t1 natural join t2) as t12 natural join (select from t3 natural join t4) as t34; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select event_name, event_definition, interval_value, interval_field from information_schema.events order by event_name; +END +OUTPUT +select event_name, event_definition, interval_value, interval_field from information_schema.events order by event_name asc +END +INPUT +select -1 | 1, -1 ^ 1, -1 & 1; +END +OUTPUT +select -1 | 1, -1 ^ 1, -1 & 1 from dual +END +INPUT +select i from t1 where i = 1 into k; +END +ERROR +syntax error at position 36 near 'k' +END +INPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name = 'tm' and index_name = 'p' order by table_name; +END +OUTPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name = 'tm' and index_name = 'p' order by table_name asc +END +INPUT +select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a' order by length(concat('*',v,'*',c,'*',t,'*')); +END +OUTPUT +select concat('*', v, '*', c, '*', t, '*') as qq from t1 where v = 'a' order by length(concat('*', v, '*', c, '*', t, '*')) asc +END +INPUT +select u.gender as gender, count(distinct u.id) as dist_count, (count(distinct u.id)/5*100) as percentage from t1 u, t2 l where l.user_id = u.id group by u.gender order by percentage; +END +OUTPUT +select u.gender as gender, count(distinct u.id) as dist_count, count(distinct u.id) / 5 * 100 as percentage from t1 as u, t2 as l where l.user_id = u.id group by u.gender order by percentage asc +END +INPUT +select host, length(authentication_string) from mysql.user where user like 'mysqltest_1'; +END +OUTPUT +select host, length(authentication_string) from mysql.`user` where `user` like 'mysqltest_1' +END +INPUT +select column_default from information_schema.columns where table_name= 't1'; +END +OUTPUT +select column_default from information_schema.`columns` where table_name = 't1' +END +INPUT +select from t1 where a like "abc%"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from (select from t1 union distinct select from t2 union all select from t3) X; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select @test_compress_string:='string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa '; +END +ERROR +syntax error at position 30 near ':' +END +INPUT +select length(quote(concat(char(0),"test"))); +END +OUTPUT +select length(quote(concat(char(0), 'test'))) from dual +END +INPUT +select grp,group_concat(null) from t1 group by grp; +END +OUTPUT +select grp, group_concat(null) from t1 group by grp +END +INPUT +select a1,a2,b,min(c),max(c) from t2 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t2 where (a1 >= 'c' or a2 < 'b') and b > 'a' group by a1, a2, b +END +INPUT +select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') group by a1; +END +OUTPUT +select a1, a2, b, max(c), min(c) from t2 where a2 = 'a' and b = 'b' group by a1 +END +INPUT +select right('hello', -4294967296); +END +OUTPUT +select right('hello', -4294967296) from dual +END +INPUT +select from information_schema.key_column_usage where TABLE_NAME= "vo"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where a='a' order by binary a; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select @@global.concurrent_insert; +END +OUTPUT +select @@global.concurrent_insert from dual +END +INPUT +select from t1 where MATCH(a,b) AGAINST ("only"); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select null % 0 as 'NULL'; +END +OUTPUT +select null % 0 as `NULL` from dual +END +INPUT +select f1 from t1 where makedate(2006,2) between date(f1) and date(f3); +END +OUTPUT +select f1 from t1 where makedate(2006, 2) between date(f1) and date(f3) +END +INPUT +select a1, max(c) from t1 where a1 in ('a','b','d') group by a1,a2,b; +END +OUTPUT +select a1, max(c) from t1 where a1 in ('a', 'b', 'd') group by a1, a2, b +END +INPUT +select from (select from t1 natural join t2) as t12 natural left join (select from t3 natural join t4) as t34; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select ST_astext(st_union(ST_GeomFromText('multipoint(2 2, 3 3)'), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))); +END +OUTPUT +select ST_astext(st_union(ST_GeomFromText('multipoint(2 2, 3 3)'), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))) from dual +END +INPUT +select from t3_trans; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select t1.a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using (a) left join t1 as t4 using (a) left join t1 as t5 using (a) left join t1 as t6 using (a) left join t1 as t7 using (a) left join t1 as t8 using (a) left join t1 as t9 using (a) left join t1 as t10 using (a) left join t1 as t11 using (a) left join t1 as t12 using (a) left join t1 as t13 using (a) left join t1 as t14 using (a) left join t1 as t15 using (a) left join t1 as t16 using (a) left join t1 as t17 using (a) left join t1 as t18 using (a) left join t1 as t19 using (a) left join t1 as t20 using (a) left join t1 as t21 using (a) left join t1 as t22 using (a) left join t1 as t23 using (a) left join t1 as t24 using (a) left join t1 as t25 using (a) left join t1 as t26 using (a) left join t1 as t27 using (a) left join t1 as t28 using (a) left join t1 as t29 using (a) left join t1 as t30 using (a) left join t1 as t31 using (a) left join t1 as t32 using (a) left join t1 as t33 using (a) left join t1 as t34 using (a) left join t1 as t35 using (a) left join t1 as t36 using (a) left join t1 as t37 using (a) left join t1 as t38 using (a) left join t1 as t39 using (a) left join t1 as t40 using (a) left join t1 as t41 using (a) left join t1 as t42 using (a) left join t1 as t43 using (a) left join t1 as t44 using (a) left join t1 as t45 using (a) left join t1 as t46 using (a) left join t1 as t47 using (a) left join t1 as t48 using (a) left join t1 as t49 using (a) left join t1 as t50 using (a) left join t1 as t51 using (a) left join t1 as t52 using (a) left join t1 as t53 using (a) left join t1 as t54 using (a) left join t1 as t55 using (a) left join t1 as t56 using (a) left join t1 as t57 using (a) left join t1 as t58 using (a) left join t1 as t59 using (a) left join t1 as t60 using (a) left join t1 as t61 using (a) left join t1 as t62 using (a) left join t1 as t63 using (a) left join t1 as t64 using (a) left join t1 as t65 using (a); +END +OUTPUT +select t1.a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using (a) left join t1 as t4 using (a) left join t1 as t5 using (a) left join t1 as t6 using (a) left join t1 as t7 using (a) left join t1 as t8 using (a) left join t1 as t9 using (a) left join t1 as t10 using (a) left join t1 as t11 using (a) left join t1 as t12 using (a) left join t1 as t13 using (a) left join t1 as t14 using (a) left join t1 as t15 using (a) left join t1 as t16 using (a) left join t1 as t17 using (a) left join t1 as t18 using (a) left join t1 as t19 using (a) left join t1 as t20 using (a) left join t1 as t21 using (a) left join t1 as t22 using (a) left join t1 as t23 using (a) left join t1 as t24 using (a) left join t1 as t25 using (a) left join t1 as t26 using (a) left join t1 as t27 using (a) left join t1 as t28 using (a) left join t1 as t29 using (a) left join t1 as t30 using (a) left join t1 as t31 using (a) left join t1 as t32 using (a) left join t1 as t33 using (a) left join t1 as t34 using (a) left join t1 as t35 using (a) left join t1 as t36 using (a) left join t1 as t37 using (a) left join t1 as t38 using (a) left join t1 as t39 using (a) left join t1 as t40 using (a) left join t1 as t41 using (a) left join t1 as t42 using (a) left join t1 as t43 using (a) left join t1 as t44 using (a) left join t1 as t45 using (a) left join t1 as t46 using (a) left join t1 as t47 using (a) left join t1 as t48 using (a) left join t1 as t49 using (a) left join t1 as t50 using (a) left join t1 as t51 using (a) left join t1 as t52 using (a) left join t1 as t53 using (a) left join t1 as t54 using (a) left join t1 as t55 using (a) left join t1 as t56 using (a) left join t1 as t57 using (a) left join t1 as t58 using (a) left join t1 as t59 using (a) left join t1 as t60 using (a) left join t1 as t61 using (a) left join t1 as t62 using (a) left join t1 as t63 using (a) left join t1 as t64 using (a) left join t1 as t65 using (a) +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL "10000 99:99:99" DAY_SECOND); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval '10000 99:99:99' DAY_SECOND) from dual +END +INPUT +select host,db,user from mysql.db where user like 'mysqltest_%' order by host,db,user; +END +OUTPUT +select host, db, `user` from mysql.db where `user` like 'mysqltest_%' order by host asc, db asc, `user` asc +END +INPUT +select grp,group_concat(c order by 2) from t1 group by grp; +END +OUTPUT +select grp, group_concat(c order by 2 asc) from t1 group by grp +END +INPUT +select time_format(19980131010015,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); +END +OUTPUT +select time_format(19980131010015, '%H|%I|%k|%l|%i|%p|%r|%S|%T') from dual +END +INPUT +select st_touches(ST_GeomFromText('polygon((0 0, 2 2, 0 4, 0 0))'), ST_GeomFromText('point(1 0)')); +END +OUTPUT +select st_touches(ST_GeomFromText('polygon((0 0, 2 2, 0 4, 0 0))'), ST_GeomFromText('point(1 0)')) from dual +END +INPUT +select distinct s1 from t1 order by s2,s1; +END +OUTPUT +select distinct s1 from t1 order by s2 asc, s1 asc +END +INPUT +select sum(col1) from t1 group by col_t1 having (select col_t1 from t2 where col_t1 = col_t2 order by col_t2 limit 1); +END +OUTPUT +select sum(col1) from t1 group by col_t1 having (select col_t1 from t2 where col_t1 = col_t2 order by col_t2 asc limit 1) +END +INPUT +select hex(substr(_utf16 0x00e400e5D800DC00,1)); +END +ERROR +syntax error at position 44 near '0x00e400e5D800DC00' +END +INPUT +select hex(right(_utf16 0xD800DC00D87FDFFF, 1)); +END +ERROR +syntax error at position 43 near '0xD800DC00D87FDFFF' +END +INPUT +select b x, (select group_concat(b) from t2) from t2; +END +OUTPUT +select b as x, (select group_concat(b) from t2) from t2 +END +INPUT +select (select f from lateral (select max(t1.a) as f) as dt) as g from t1; +END +ERROR +syntax error at position 32 +END +INPUT +select _latin1'1'=1; +END +OUTPUT +select _latin1 '1' = 1 from dual +END +INPUT +select a,t>0,c,i from t1; +END +OUTPUT +select a, t > 0, c, i from t1 +END +INPUT +select from t1 left join t2 on t1.b = t2.b order by t1.a; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select locate('HE','hello'); +END +OUTPUT +select locate('HE', 'hello') from dual +END +INPUT +select hex(cast(_ascii 0x7f as char(1) character set latin1)); +END +ERROR +syntax error at position 28 near '0x7f' +END +INPUT +select hex(weight_string(_utf16 0xD800DC00)); +END +ERROR +syntax error at position 43 near '0xD800DC00' +END +INPUT +select week(20001231,2),week(20001231,3); +END +OUTPUT +select week(20001231, 2), week(20001231, 3) from dual +END +INPUT +select count(a) as b from t1 where a=0 having b >=0; +END +OUTPUT +select count(a) as b from t1 where a = 0 having b >= 0 +END +INPUT +select count(*) from t1 where v like 'a %'; +END +OUTPUT +select count(*) from t1 where v like 'a %' +END +INPUT +select var_samp(e) as 'null', var_pop(e) as '0' from bug22555; +END +OUTPUT +select var_samp(e) as `null`, var_pop(e) as `0` from bug22555 +END +INPUT +select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3; +END +OUTPUT +select sum(a) as c from t1 where a > 0 order by c asc limit 3 +END +INPUT +select count(*) from t1 where a is null; +END +OUTPUT +select count(*) from t1 where a is null +END +INPUT +select from bug20691 order by i asc; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select insert('hello', 4294967295, 1, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select 'The cost of accessing t1 (dont care if it changes' '^'; +END +OUTPUT +select 'The cost of accessing t1 (dont care if it changes' as `^` from dual +END +INPUT +select from t1 natural left join t2 where (i is not null)=0; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t2 /bin /boot /cdrom /dev /etc /home /lib /lib32 /lib64 /libx32 /lost+found /media /mnt /opt /proc /root /run /sbin /snap /srv /swapfile /sys /tmp /usr /var must be (3,1), (4,4) */; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(distinct n1), count(distinct n2) from t1; +END +OUTPUT +select count(distinct n1), count(distinct n2) from t1 +END +INPUT +select elt(2,1),field(NULL,"a","b","c"),reverse(""); +END +OUTPUT +select elt(2, 1), field(null, 'a', 'b', 'c'), reverse('') from dual +END +INPUT +select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2 collate utf8_bin); +END +OUTPUT +select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2 collate utf8_bin) from dual +END +INPUT +select insert('hello', 1, -4294967295, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select hex(ucs2),hex(ujis),name from t1 order by name; +END +OUTPUT +select hex(ucs2), hex(ujis), `name` from t1 order by `name` asc +END +INPUT +select max(b) from t3 where a = 2; +END +OUTPUT +select max(b) from t3 where a = 2 +END +INPUT +select count(*), interval(qty,2,3,4,5,6,7,8) as category from t1 group by category; +END +ERROR +syntax error at position 48 near 'as' +END +INPUT +select SQL_BUFFER_RESULT from t1 order by 1, 2; +END +OUTPUT +select SQL_BUFFER_RESULT from t1 order by 1 asc, 2 asc +END +INPUT +select collation(convert('a',char(2) ascii)), collation(convert('a',char(2) ascii binary)); +END +ERROR +syntax error at position 89 near 'binary' +END +INPUT +select d as e from (select a as d, 2*a as two from t) dt; +END +OUTPUT +select d as e from (select a as d, 2 * a as two from t) as dt +END +INPUT +select hex(substr(_utf16 0x00e400e5D800DC00,-3)); +END +ERROR +syntax error at position 44 near '0x00e400e5D800DC00' +END +INPUT +select field(c1,'�'),field('�',c1) from t1; +END +OUTPUT +select field(c1, '�'), field('�', c1) from t1 +END +INPUT +select EVENT_NAME from information_schema.events where event_schema='test'; +END +OUTPUT +select EVENT_NAME from information_schema.events where event_schema = 'test' +END +INPUT +select abs(-10), sign(-5), sign(5), sign(0); +END +OUTPUT +select abs(-10), sign(-5), sign(5), sign(0) from dual +END +INPUT +select 5 from t1; +END +OUTPUT +select 5 from t1 +END +INPUT +select from t1 where not(not(not(a < 5) and not(a > 10))); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select min(f3),max(f3) from t1; +END +OUTPUT +select min(f3), max(f3) from t1 +END +INPUT +select _koi8r'����' as test; +END +ERROR +syntax error at position 31 near 'as' +END +INPUT +select t1.*, (select a from t2 where d > a) as 'x' from t1; +END +OUTPUT +select t1.*, (select a from t2 where d > a) as x from t1 +END +INPUT +select a1,a2,b,min(c),max(c) from t1 where (c > 'f123') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 where c > 'f123' group by a1, a2, b +END +INPUT +select t1.col1*10+t2.col1 from t1,t2 where t1.col1=t2.col1 group by t1.col1, t2.col1 having col1 = 2; +END +OUTPUT +select t1.col1 * 10 + t2.col1 from t1, t2 where t1.col1 = t2.col1 group by t1.col1, t2.col1 having col1 = 2 +END +INPUT +select a from t1; +END +OUTPUT +select a from t1 +END +INPUT +select replace(c1,'�','�'), replace('�',c1,'�') from t1; +END +OUTPUT +select replace(c1, '�', '�'), replace('�', c1, '�') from t1 +END +INPUT +select str_to_date( NULL, 1 ); +END +OUTPUT +select str_to_date(null, 1) from dual +END +INPUT +select DATE_ADD(20071108181000, INTERVAL 1 DAY); +END +OUTPUT +select DATE_ADD(20071108181000, interval 1 DAY) from dual +END +INPUT +select a as gci2 from t1 where a like 'あいうえおかきくけこさしすせそ'; +END +OUTPUT +select a as gci2 from t1 where a like 'あいうえおかきくけこさしすせそ' +END +INPUT +select extract(MICROSECOND FROM "1999-01-02 10:11:12.000123"); +END +ERROR +syntax error at position 32 near 'FROM' +END +INPUT +select table_name, column_name, data_type from information_schema.columns where table_schema not in ('performance_schema', 'sys') and data_type = 'datetime' and table_name COLLATE utf8_general_ci not like 'innodb_%' order by table_name, column_name; +END +OUTPUT +select table_name, column_name, data_type from information_schema.`columns` where table_schema not in ('performance_schema', 'sys') and data_type = 'datetime' and table_name collate utf8_general_ci not like 'innodb_%' order by table_name asc, column_name asc +END +INPUT +select hex(@utf81:= CONVERT(@ujis1 USING utf8)); +END +ERROR +syntax error at position 19 near ':' +END +INPUT +select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_bin); +END +ERROR +syntax error at position 43 near 'COLLATE' +END +INPUT +select max(7) from t2i join t1i; +END +OUTPUT +select max(7) from t2i join t1i +END +INPUT +select date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w"); +END +OUTPUT +select date_format('1997-01-02 03:04:05', '%M %W %D %Y %y %m %d %h %i %s %w') from dual +END +INPUT +select rpad('hello', 18446744073709551616, '1'); +END +OUTPUT +select rpad('hello', 18446744073709551616, '1') from dual +END +INPUT +select max(a3) from t1 where a2 = 0 and a3 between 'K' and 'Q'; +END +OUTPUT +select max(a3) from t1 where a2 = 0 and a3 between 'K' and 'Q' +END +INPUT +select locate('HE','hello' collate ujis_bin,2); +END +OUTPUT +select locate('HE', 'hello' collate ujis_bin, 2) from dual +END +INPUT +select hex(conv(convert('123' using utf32), -10, 16)); +END +OUTPUT +select hex(conv(convert('123' using utf32), -10, 16)) from dual +END +INPUT +select hex(weight_string(_utf16 0xD800DC01)); +END +ERROR +syntax error at position 43 near '0xD800DC01' +END +INPUT +select from (select *,substring(b,1),substring(b,-1),substring(b,-2),substring(b,-3),substring(b,-4),substring(b,-5) from t1) t; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select st_overlaps(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_overlaps(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select _latin1'B' between _latin1'a' collate latin1_bin and _latin1'c'; +END +OUTPUT +select _latin1 'B' between _latin1 'a' collate latin1_bin and _latin1 'c' from dual +END +INPUT +select st_overlaps(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_overlaps(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select locate('HE','hello' collate utf8mb4_bin); +END +OUTPUT +select locate('HE', 'hello' collate utf8mb4_bin) from dual +END +INPUT +select count(*) from t1 where match a against ('aaay*' in boolean mode); +END +ERROR +syntax error at position 38 near 'a' +END +INPUT +select a as like_ll from t1 where a like 'll%'; +END +OUTPUT +select a as like_ll from t1 where a like 'll%' +END +INPUT +select t1.* as 'with_alias', a from t1; +END +ERROR +syntax error at position 15 near 'as' +END +INPUT +select hex(convert(_ujis 0x8FABF841 using ucs2)); +END +ERROR +syntax error at position 36 near '0x8FABF841' +END +INPUT +select left('hello', 10); +END +OUTPUT +select left('hello', 10) from dual +END +INPUT +select date_sub("1998-01-01 00:00:00",INTERVAL 1 MONTH); +END +OUTPUT +select date_sub('1998-01-01 00:00:00', interval 1 MONTH) from dual +END +INPUT +select 1, ST_Intersects(ST_GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), ST_GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')); +END +OUTPUT +select 1, ST_Intersects(ST_GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), ST_GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')) from dual +END +INPUT +select concat("-",a,"-",b,"-") from t1 where a="hello"; +END +OUTPUT +select concat('-', a, '-', b, '-') from t1 where a = 'hello' +END +INPUT +select 'a a' > 'a', 'a ' < 'a'; +END +OUTPUT +select 'a a' > 'a', 'a \t' < 'a' from dual +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_swedish_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_swedish_ci +END +INPUT +select release_lock('ee_22830'); +END +OUTPUT +select release_lock('ee_22830') from dual +END +INPUT +select distinct b from t1 where (a2 >= 'b') and (b = 'a'); +END +OUTPUT +select distinct b from t1 where a2 >= 'b' and b = 'a' +END +INPUT +select t1.*,t2.* from t1 inner join t2 on (t1.a=t2.a); +END +OUTPUT +select t1.*, t2.* from t1 join t2 on t1.a = t2.a +END +INPUT +select from T1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select st_a, swt1a, st_b, swt1b from t1 where st_a=1 and swt1a=1 and st_b=1 and swt1b=1 and swt1b=1 limit 5; +END +OUTPUT +select st_a, swt1a, st_b, swt1b from t1 where st_a = 1 and swt1a = 1 and st_b = 1 and swt1b = 1 and swt1b = 1 limit 5 +END +INPUT +select hex(cast(0x20000000000000 as decimal(30,0)) + 1); +END +OUTPUT +select hex(convert(0x20000000000000, decimal(30, 0)) + 1) from dual +END +INPUT +select count(*) from t1 left join t2 on (t1.id = t2.owner); +END +OUTPUT +select count(*) from t1 left join t2 on t1.id = t2.owner +END +INPUT +select tt.field100 from t1 join (select from t1) tt where t1.field100=tt.field100 limit 1; +END +ERROR +syntax error at position 45 near 'from' +END +INPUT +select cast(repeat('1',20) as signed); +END +OUTPUT +select convert(repeat('1', 20), signed) from dual +END +INPUT +select a,b from t1 order by upper(a),b; +END +OUTPUT +select a, b from t1 order by upper(a) asc, b asc +END +INPUT +select n from t1; +END +OUTPUT +select n from t1 +END +INPUT +select count(facility) from t1; +END +OUTPUT +select count(facility) from t1 +END +INPUT +select insert('hello', 1, -18446744073709551615, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select value,description,bug_id from t2 left join t1 on t2.program=t1.product and t2.value=t1.component where program="AAAAA"; +END +OUTPUT +select value, description, bug_id from t2 left join t1 on t2.program = t1.product and t2.value = t1.component where program = 'AAAAA' +END +INPUT +select "foo" = "foo " collate latin1_test; +END +OUTPUT +select 'foo' = 'foo ' collate latin1_test from dual +END +INPUT +select 'a' union select concat('a', -4.5); +END +OUTPUT +(select 'a' from dual) union (select concat('a', -4.5) from dual) +END +INPUT +select date,format,TIME(str_to_date(date, format)) as time from t1; +END +OUTPUT +select `date`, `format`, TIME(str_to_date(`date`, `format`)) as `time` from t1 +END +INPUT +select from v4; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select table_name from information_schema.views where table_schema='test' order by table_name; +END +OUTPUT +select table_name from information_schema.views where table_schema = 'test' order by table_name asc +END +INPUT +select row('A','b','c') = row('a' COLLATE latin1_bin,'b','c'); +END +OUTPUT +select row('A', 'b', 'c') = row('a' collate latin1_bin, 'b', 'c') from dual +END +INPUT +select min(if(y -x > 5,y,NULL)), max(if(y - x > 5,y,NULL)) from t1; +END +OUTPUT +select min(if(y - x > 5, y, null)), max(if(y - x > 5, y, null)) from t1 +END +INPUT +select a as bin1 from t1 where a like 'さしすせそかきくけこあいうえお%'; +END +OUTPUT +select a as bin1 from t1 where a like 'さしすせそかきくけこあいうえお%' +END +INPUT +select distinct t3.a,e from t3, t1 order by t3.b; +END +OUTPUT +select distinct t3.a, e from t3, t1 order by t3.b asc +END +INPUT +select from t1 where MATCH(a,b) AGAINST("support +collections" IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select @ujis1 = CONVERT(@utf81 USING ujis); +END +OUTPUT +select @ujis1 = convert(@utf81 using ujis) from dual +END +INPUT +select X.a from t1 AS X group by X.b having (X.a = 1); +END +OUTPUT +select X.a from t1 as X group by X.b having X.a = 1 +END +INPUT +select month("2001-02-00"),year("2001-00-00"); +END +OUTPUT +select month('2001-02-00'), year('2001-00-00') from dual +END +INPUT +select fld3,companynr from t2 where companynr = 58 order by fld3; +END +OUTPUT +select fld3, companynr from t2 where companynr = 58 order by fld3 asc +END +INPUT +select hex(char(196)); +END +OUTPUT +select hex(char(196)) from dual +END +INPUT +select count(*) from t2; +END +OUTPUT +select count(*) from t2 +END +INPUT +select from (t1 natural join t2) natural left join (t3 natural join t4) where b + 1 = y or b + 10 = y group by b,c,a,y having min(b) < max(y) order by a, y; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select cast(min(ifl) as decimal(5,2)) from t3; +END +OUTPUT +select convert(min(ifl), decimal(5, 2)) from t3 +END +INPUT +select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12; +END +OUTPUT +select count(*) as total, left(c, 10) as reg from t1 group by reg order by reg desc limit 0, 12 +END +INPUT +select group_concat(distinct b order by b) from t1 group by a; +END +OUTPUT +select group_concat(distinct b order by b asc) from t1 group by a +END +INPUT +select group_concat(c1 order by hex(c1) SEPARATOR '') from t1 group by c1; +END +OUTPUT +select group_concat(c1 order by hex(c1) asc separator '') from t1 group by c1 +END +INPUT +select group_concat(sum(c)) from t1 group by grp; +END +OUTPUT +select group_concat(sum(c)) from t1 group by grp +END +INPUT +select st_astext(st_buffer(point(-5,0),8772, st_buffer_strategy( 'point_circle',1024*1024*1024))) as result; +END +OUTPUT +select st_astext(st_buffer(point(-5, 0), 8772, st_buffer_strategy('point_circle', 1024 * 1024 * 1024))) as result from dual +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_vietnamese_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_vietnamese_ci +END +INPUT +select group_concat(c order by (select c from t2 where t2.a=t1.a limit 1)) as grp from t1; +END +OUTPUT +select group_concat(c order by (select c from t2 where t2.a = t1.a limit 1) asc) as grp from t1 +END +INPUT +select from t1 where text1='teststring' or text1 > 'teststring '; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select var_samp(o) as 'null', var_pop(o) as '0' from bug22555; +END +OUTPUT +select var_samp(o) as `null`, var_pop(o) as `0` from bug22555 +END +INPUT +select insert("aa",100,1,"b"),insert("aa",1,3,"b"),left("aa",-1),substring("a",1,2); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select "Test delimiter //" as " "; +END +OUTPUT +select 'Test delimiter //' as ` ` from dual +END +INPUT +select 100, st_area(t.geom) from tbl_polygon t where t.id like 'POLY%'; +END +OUTPUT +select 100, st_area(t.geom) from tbl_polygon as t where t.id like 'POLY%' +END +INPUT +select a1,a2,b, max(c) from t1 where a1 >= 'c' or a1 < 'b' group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c) from t1 where a1 >= 'c' or a1 < 'b' group by a1, a2, b +END +INPUT +select t1.col1 from t1 where t1.col2 in (select t2.col2 from t2 group by t2.col1, t2.col2 having col_t1 <= 10) having col_t1 <= 20; +END +OUTPUT +select t1.col1 from t1 where t1.col2 in (select t2.col2 from t2 group by t2.col1, t2.col2 having col_t1 <= 10) having col_t1 <= 20 +END +INPUT +select -9223372036854775808 mod 9223372036854775810 as result; +END +OUTPUT +select -9223372036854775808 % 9223372036854775810 as result from dual +END +INPUT +select str_to_date("2003-04-05 g", "%Y-%m-%d") as f1, str_to_date("2003-04-05 10:11:12.101010234567", "%Y-%m-%d %H:%i:%S.%f") as f2; +END +OUTPUT +select str_to_date('2003-04-05 g', '%Y-%m-%d') as f1, str_to_date('2003-04-05 10:11:12.101010234567', '%Y-%m-%d %H:%i:%S.%f') as f2 from dual +END +INPUT +select from t1 where 1 xor 1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select d, two from v; +END +OUTPUT +select d, two from v +END +INPUT +select hex(Db) from mysql.db where Db='��'; +END +OUTPUT +select hex(Db) from mysql.db where Db = '��' +END +INPUT +select @a:=FROM_UNIXTIME(1); +END +ERROR +syntax error at position 11 near ':' +END +INPUT +select sleep(2); +END +OUTPUT +select sleep(2) from dual +END +INPUT +select f1 from t1 where f1 like 'a%'; +END +OUTPUT +select f1 from t1 where f1 like 'a%' +END +INPUT +select hex(CONVERT(@utf82 USING sjis)); +END +OUTPUT +select hex(convert(@utf82 using sjis)) from dual +END +INPUT +select date_add(datetime, INTERVAL 1 YEAR) from t1; +END +OUTPUT +select date_add(`datetime`, interval 1 YEAR) from t1 +END +INPUT +select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by t1.a; +END +OUTPUT +select group_concat(t1.b, t2.c) from t1 left join t2 using (a) group by t1.a +END +INPUT +select hex(conv(convert('123' using utf32), 10, 16)); +END +OUTPUT +select hex(conv(convert('123' using utf32), 10, 16)) from dual +END +INPUT +select left('hello', -1); +END +OUTPUT +select left('hello', -1) from dual +END +INPUT +select 1 | NULL,1 & NULL,1+NULL,1-NULL; +END +OUTPUT +select 1 | null, 1 & null, 1 + null, 1 - null from dual +END +INPUT +select table_type from information_schema.tables where table_name="v1"; +END +OUTPUT +select table_type from information_schema.`tables` where table_name = 'v1' +END +INPUT +select _latin1'a' regexp _latin1'A' collate latin1_bin; +END +OUTPUT +select _latin1 'a' regexp _latin1 'A' collate latin1_bin from dual +END +INPUT +select _latin1'B' between _latin2'a' and _latin1'b'; +END +ERROR +syntax error at position 37 near 'a' +END +INPUT +select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b; +END +OUTPUT +select distinct a1, a2, b, c from t1 where a2 >= 'b' and b = 'a' and c = 'i121' group by a1, a2, b +END +INPUT +select distinct from test; +END +ERROR +syntax error at position 21 near 'from' +END +INPUT +select 1 from t1 where 1 < some (select cast(a as datetime) from t1); +END +ERROR +syntax error at position 40 near 'select' +END +INPUT +select hex(a) from t1 where a like 'A_' order by a; +END +OUTPUT +select hex(a) from t1 where a like 'A_' order by a asc +END +INPUT +select length(_utf8mb4 0xD0B1), bit_length(_utf8mb4 0xD0B1), char_length(_utf8mb4 0xD0B1); +END +OUTPUT +select length(_utf8mb4 0xD0B1), bit_length(_utf8mb4 0xD0B1), char_length(_utf8mb4 0xD0B1) from dual +END +INPUT +select QN.a from (select 1 as a) as QN; +END +OUTPUT +select QN.a from (select 1 as a from dual) as QN +END +INPUT +select from t1 natural join t2 where t1.c > t2.a; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select length(last_day("1997-12-1")); +END +OUTPUT +select length(last_day('1997-12-1')) from dual +END +INPUT +select get_lock('bug27638', 60); +END +OUTPUT +select get_lock('bug27638', 60) from dual +END +INPUT +select 0xa1a2a1a3 like concat(_binary'%',0xa2a1,_binary'%'); +END +OUTPUT +select 0xa1a2a1a3 like concat(_binary '%', 0xa2a1, _binary '%') from dual +END +INPUT +select coercibility(col1), collation(col1) from v1; +END +OUTPUT +select coercibility(col1), collation(col1) from v1 +END +INPUT +select grp,group_concat(distinct c order by c desc) from t1 group by grp; +END +OUTPUT +select grp, group_concat(distinct c order by c desc) from t1 group by grp +END +INPUT +select abs(-2) -2; +END +OUTPUT +select abs(-2) - 2 from dual +END +INPUT +select substring_index('the king of the the null','the',null); +END +OUTPUT +select substring_index('the king of the the null', 'the', null) from dual +END +INPUT +select cast('9223372036854775809' as signed); +END +OUTPUT +select convert('9223372036854775809', signed) from dual +END +INPUT +select min(a1) from t1 where a1 >= 'KKK'; +END +OUTPUT +select min(a1) from t1 where a1 >= 'KKK' +END +INPUT +select 'hello',"'hello'",'""hello""','''h''e''l''l''o''',"hel""lo",'hel'lo'; +END +ERROR +syntax error at position 77 near ';' +END +INPUT +select unix_timestamp('2038-01-20 01:00:00'); +END +OUTPUT +select unix_timestamp('2038-01-20 01:00:00') from dual +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_estonian_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_estonian_ci +END +INPUT +select substring('hello', 1, 4294967297); +END +OUTPUT +select substr('hello', 1, 4294967297) from dual +END +INPUT +select date_sub("0199-01-01 00:00:01",INTERVAL 2 SECOND); +END +OUTPUT +select date_sub('0199-01-01 00:00:01', interval 2 SECOND) from dual +END +INPUT +select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring '; +END +OUTPUT +select concat('|', text1, '|') from t1 where text1 = 'teststring' or text1 > 'teststring\t' +END +INPUT +select 'aaa','aa''a',"aa""a"; +END +OUTPUT +select 'aaa', 'aa\'a', 'aa\"a' from dual +END +INPUT +select cast('18446744073709551615' as signed); +END +OUTPUT +select convert('18446744073709551615', signed) from dual +END +INPUT +select left(concat(a,version()),1) from t1; +END +OUTPUT +select left(concat(a, version()), 1) from t1 +END +INPUT +select 10 % 7, 10 mod 7, 10 div 3; +END +OUTPUT +select 10 % 7, 10 % 7, 10 div 3 from dual +END +INPUT +select monthname(date) from t1 inner join t2 on t1.id = t2.id; +END +OUTPUT +select monthname(`date`) from t1 join t2 on t1.id = t2.id +END +INPUT +select space(-4294967296); +END +OUTPUT +select space(-4294967296) from dual +END +INPUT +select 'a' regexp 'A' collate latin1_general_cs; +END +OUTPUT +select 'a' regexp 'A' collate latin1_general_cs from dual +END +INPUT +select grp,group_concat(c order by c) from t1 group by grp; +END +OUTPUT +select grp, group_concat(c order by c asc) from t1 group by grp +END +INPUT +select count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c'); +END +OUTPUT +select count(distinct a1, a2, b) from t1 where a1 > 'a' and a2 > 'a' and b = 'c' +END +INPUT +select last_day('0000-00-00'); +END +OUTPUT +select last_day('0000-00-00') from dual +END +INPUT +select substring('hello', 1, -4294967297); +END +OUTPUT +select substr('hello', 1, -4294967297) from dual +END +INPUT +select c, v2.table_name from v1 right join information_schema.TABLES v2 on (v1.c=v2.table_name) where v1.c rlike "t[1-5]{1}$" order by c; +END +OUTPUT +select c, v2.table_name from v1 right join information_schema.`TABLES` as v2 on v1.c = v2.table_name where v1.c regexp 't[1-5]{1}$' order by c asc +END +INPUT +select t1.i,t2.i,t3.i from t2 right join t3 on (t2.i=t3.i),t1 order by t1.i,t2.i,t3.i; +END +OUTPUT +select t1.i, t2.i, t3.i from t2 right join t3 on t2.i = t3.i, t1 order by t1.i asc, t2.i asc, t3.i asc +END +INPUT +select get_lock('bug27638', 1); +END +OUTPUT +select get_lock('bug27638', 1) from dual +END +INPUT +select from t1 where str like 'aa%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select t1.name, t2.name, t2.id, t2.owner, t3.id from t1 left join t2 on (t1.id = t2.owner) right join t1 as t3 on t3.id=t2.owner; +END +OUTPUT +select t1.`name`, t2.`name`, t2.id, t2.owner, t3.id from t1 left join t2 on t1.id = t2.owner right join t1 as t3 on t3.id = t2.owner +END +INPUT +select distinct t1.a,sec_to_time(sum(time_to_sec(t))) from t1 left join t2 on (t1.b=t2.a) group by t1.a,t2.b; +END +OUTPUT +select distinct t1.a, sec_to_time(sum(time_to_sec(t))) from t1 left join t2 on t1.b = t2.a group by t1.a, t2.b +END +INPUT +select grp, sum(a)+count(a)+avg(a)+std(a)+variance(a)+bit_or(a)+bit_and(a)+min(a)+max(a)+min(c)+max(c) as sum from t1 group by grp; +END +OUTPUT +select grp, sum(a) + count(a) + avg(a) + std(a) + variance(a) + bit_or(a) + bit_and(a) + min(a) + max(a) + min(c) + max(c) as sum from t1 group by grp +END +INPUT +select -9223372036854775808 1 as result; +END +ERROR +syntax error at position 30 near '1' +END +INPUT +select distinct nullif(a,b) as c from t1 z order by z.c; +END +OUTPUT +select distinct nullif(a, b) as c from t1 as z order by z.c asc +END +INPUT +select locate('lo','hello',18446744073709551616); +END +OUTPUT +select locate('lo', 'hello', 18446744073709551616) from dual +END +INPUT +select from t1 natural left join t2 where (i is not null) is not null; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select date_sub("1998-01-01 00:00:00",INTERVAL "1:1" MINUTE_SECOND); +END +OUTPUT +select date_sub('1998-01-01 00:00:00', interval '1:1' MINUTE_SECOND) from dual +END +INPUT +select count(distinct s,t) from t1; +END +OUTPUT +select count(distinct s, t) from t1 +END +INPUT +select truncate(15000111000111000155,-1); +END +OUTPUT +select truncate(15000111000111000155, -1) from dual +END +INPUT +select t1.*,t2.* from t1 natural left outer join t2; +END +OUTPUT +select t1.*, t2.* from t1 natural left join t2 +END +INPUT +select from t1 ignore index (primary) where tt like 'AA%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select substring_index('aaaaaaaaa1','aa',-2); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aa', -2) from dual +END +INPUT +select d, two from (select a as d, 2*a as two from t) dt; +END +OUTPUT +select d, two from (select a as d, 2 * a as two from t) as dt +END +INPUT +select t1.name, t2.name, t2.id,t3.id from t1 right join t2 on (t1.id = t2.owner) right join t1 as t3 on t3.id=t2.owner; +END +OUTPUT +select t1.`name`, t2.`name`, t2.id, t3.id from t1 right join t2 on t1.id = t2.owner right join t1 as t3 on t3.id = t2.owner +END +INPUT +select count(*) from t1 where a = 'aaaxxx'; +END +OUTPUT +select count(*) from t1 where a = 'aaaxxx' +END +INPUT +select from mysqldump_myDB.v1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select Aaa.col1 from t1Aa as AaA; +END +OUTPUT +select Aaa.col1 from t1Aa as AaA +END +INPUT +select date_sub("50-01-01 00:00:01",INTERVAL 2 SECOND); +END +OUTPUT +select date_sub('50-01-01 00:00:01', interval 2 SECOND) from dual +END +INPUT +select from `information_schema`.`REFERENTIAL_CONSTRAINTS` where `TABLE_NAME` = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select (1.175494351E-37 div 1.7976931348623157E+308); +END +OUTPUT +select 1.175494351E-37 div 1.7976931348623157E+308 from dual +END +INPUT +select distinct a from t1 group by b,a having a > 2 order by a desc; +END +OUTPUT +select distinct a from t1 group by b, a having a > 2 order by a desc +END +INPUT +select cast(18446744073709551615 as unsigned); +END +OUTPUT +select convert(18446744073709551615, unsigned) from dual +END +INPUT +select var_samp(e) as 'null', var_pop(e) as 'null' from bug22555; +END +OUTPUT +select var_samp(e) as `null`, var_pop(e) as `null` from bug22555 +END +INPUT +select from (select 1) as a; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(char(0x41 using ucs2)); +END +ERROR +syntax error at position 27 near 'using' +END +INPUT +select insert('hello', 1, -1, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select i from t1 where i = 1 into j; +END +ERROR +syntax error at position 36 near 'j' +END +INPUT +select c from t2; +END +OUTPUT +select c from t2 +END +INPUT +select @keyword1_id:= 10201; +END +ERROR +syntax error at position 21 near ':' +END +INPUT +select min(a) is null from t1; +END +OUTPUT +select min(a) is null from t1 +END +INPUT +select @stamp2:=f2 from t1; +END +ERROR +syntax error at position 16 near ':' +END +INPUT +select last_day('2005-00-00'); +END +OUTPUT +select last_day('2005-00-00') from dual +END +INPUT +select count(*) from t1 where v between 'a' and 'a '; +END +OUTPUT +select count(*) from t1 where v between 'a' and 'a ' +END +INPUT +select export_set(3, _latin1'foo', _utf8'bar', ',', 4); +END +OUTPUT +select export_set(3, _latin1 'foo', _utf8 'bar', ',', 4) from dual +END +INPUT +select a,hex(a) from t1; +END +OUTPUT +select a, hex(a) from t1 +END +INPUT +select grp, sum(a),count(a),avg(a),std(a),variance(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1 group by grp; +END +OUTPUT +select grp, sum(a), count(a), avg(a), std(a), variance(a), bit_or(a), bit_and(a), min(a), max(a), min(c), max(c) from t1 group by grp +END +INPUT +select count(*) from t1 where a = 'aaazzz'; +END +OUTPUT +select count(*) from t1 where a = 'aaazzz' +END +INPUT +select substring('hello', -18446744073709551617, 1); +END +OUTPUT +select substr('hello', -18446744073709551617, 1) from dual +END +INPUT +select char(0xff,0x8f using utf8); +END +ERROR +syntax error at position 28 near 'using' +END +INPUT +select TRUE,FALSE,NULL; +END +OUTPUT +select true, false, null from dual +END +INPUT +select from t1 where a=4; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 -14,13 -8),(-5 -3,8 7),(-6 18,17 -11,-12 19,19 5),(16 11,9 -5),(17 -5,5 10),(-4 17,6 4),(-12 15,17 13,-18 11,15 10),(7 0,2 -16,-18 13,-6 4),(-17 -6,-6 -7,1 4,-18 0)),GEOMETRYCOLLECTION(MULTIPOINT(0 14,-9 -11),MULTILINESTRING((-11 -2,17 -14),(18 -12,18 -8),(-13 -16,9 16,9 -10,-7 20),(-14 -5,10 -9,4 1,17 -8),(-9 -4,-2 -12,9 -13,-5 4),(15 17,13 20))),MULTIPOINT(16 1,-9 -17,-16 6,-17 3),POINT(-18 13))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(7 0),MULTILINESTRING((-13 -18,-16 0),(17 11,-1 11,-18 -19,-4 -18),(-8 -8,-15 -13,3 -18,6 8)),LINESTRING(5 16,0 -9,-6 4,-15 17),MULTIPOINT(-9 -5,5 15,12 -11,12 11))'))) as result; +END +OUTPUT +select ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 -14,13 -8),(-5 -3,8 7),(-6 18,17 -11,-12 19,19 5),(16 11,9 -5),(17 -5,5 10),(-4 17,6 4),(-12 15,17 13,-18 11,15 10),(7 0,2 -16,-18 13,-6 4),(-17 -6,-6 -7,1 4,-18 0)),GEOMETRYCOLLECTION(MULTIPOINT(0 14,-9 -11),MULTILINESTRING((-11 -2,17 -14),(18 -12,18 -8),(-13 -16,9 16,9 -10,-7 20),(-14 -5,10 -9,4 1,17 -8),(-9 -4,-2 -12,9 -13,-5 4),(15 17,13 20))),MULTIPOINT(16 1,-9 -17,-16 6,-17 3),POINT(-18 13))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(7 0),MULTILINESTRING((-13 -18,-16 0),(17 11,-1 11,-18 -19,-4 -18),(-8 -8,-15 -13,3 -18,6 8)),LINESTRING(5 16,0 -9,-6 4,-15 17),MULTIPOINT(-9 -5,5 15,12 -11,12 11))'))) as result from dual +END +INPUT +select count(distinct vs) from t1; +END +OUTPUT +select count(distinct vs) from t1 +END +INPUT +select timestampdiff(SQL_TSI_DAY, '2001-02-01', '2001-05-01') as a; +END +OUTPUT +select timestampdiff(SQL_TSI_DAY, '2001-02-01', '2001-05-01') as a from dual +END +INPUT +select elt(1,c1,'�'),elt(1,'�',c1) from t1; +END +OUTPUT +select elt(1, c1, '�'), elt(1, '�', c1) from t1 +END +INPUT +select POSITION(_latin1'B' COLLATE latin1_bin IN _latin1'abcd'); +END +ERROR +syntax error at position 57 near '_latin1' +END +INPUT +select from v2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select group_concat(distinct a, c order by a) from t1; +END +OUTPUT +select group_concat(distinct a, c order by a asc) from t1 +END +INPUT +select !0,NOT 0=1,!(0=0),1 AND 1,1 && 0,0 OR 1,1 || NULL, 1=1 or 1=1 and 1=0; +END +OUTPUT +select !0, not 0 = 1, !(0 = 0), 1 and 1, 1 and 0, 0 or 1, 1 or null, 1 = 1 or 1 = 1 and 1 = 0 from dual +END +INPUT +select from t1 left join t2 on (t1.i=t2.i); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select C.a, c.a from t1 c, t2 C; +END +OUTPUT +select C.a, c.a from t1 as c, t2 as C +END +INPUT +select _koi8r'a' = _koi8r'A' COLLATE koi8r_bin; +END +ERROR +syntax error at position 19 +END +INPUT +select count(*) into n from t1; +END +ERROR +syntax error at position 23 near 'n' +END +INPUT +select time("1997-12-31 25:59:59.000001"); +END +OUTPUT +select time('1997-12-31 25:59:59.000001') from dual +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_danish_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_danish_ci +END +INPUT +select char(0xd1,0x8f using utf8); +END +ERROR +syntax error at position 28 near 'using' +END +INPUT +select distinct b from t2 where (a2 >= 'b') and (b = 'a'); +END +OUTPUT +select distinct b from t2 where a2 >= 'b' and b = 'a' +END +INPUT +select c1 from t1 where c1 between '�' and '�'; +END +OUTPUT +select c1 from t1 where c1 between '�' and '�' +END +INPUT +select count(b) from t1 where b >= 2; +END +OUTPUT +select count(b) from t1 where b >= 2 +END +INPUT +select LENGTH(RANDOM_BYTES(1024))=1024; +END +OUTPUT +select LENGTH(RANDOM_BYTES(1024)) = 1024 from dual +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_slovak_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_slovak_ci +END +INPUT +select concat("1","2")|0,concat("1",".5")+0.0; +END +OUTPUT +select concat('1', '2') | 0, concat('1', '.5') + 0.0 from dual +END +INPUT +select concat(ord(min(b)),ord(max(b))),min(b),max(b) from t1 group by a1,a2; +END +OUTPUT +select concat(ord(min(b)), ord(max(b))), min(b), max(b) from t1 group by a1, a2 +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_unicode_520_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_unicode_520_ci +END +INPUT +select from t3 join (t1 join t2 using (a1)) on b=c1 join t4 using (c2); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select extract(HOUR_MICROSECOND FROM "1999-01-02 10:11:12.000123"); +END +ERROR +syntax error at position 37 near 'FROM' +END +INPUT +select st_touches(ST_GeomFromText('polygon((0 0, 2 2, 0 4, 0 0))'), ST_GeomFromText('polygon((1 1.2, 1 0, 2 0, 1 1.2))')); +END +OUTPUT +select st_touches(ST_GeomFromText('polygon((0 0, 2 2, 0 4, 0 0))'), ST_GeomFromText('polygon((1 1.2, 1 0, 2 0, 1 1.2))')) from dual +END +INPUT +select ifnull(NULL, _utf8mb4'string'); +END +OUTPUT +select ifnull(null, _utf8mb4 'string') from dual +END +INPUT +select database() = _utf8"test"; +END +OUTPUT +select database() = _utf8 'test' from dual +END +INPUT +select collation(char(123)), collation(char(123 using binary)); +END +ERROR +syntax error at position 54 near 'using' +END +INPUT +select c cy from t1 where c='y'; +END +OUTPUT +select c as cy from t1 where c = 'y' +END +INPUT +select from t1 where xxx REGEXP '^this is some text: to test - out.reg exp [[(][0-9]+[/][0-9]+[])][ ]*$'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select collation(repeat(_latin2'a',10)), coercibility(repeat(_latin2'a',10)); +END +OUTPUT +select collation(repeat(_latin2 as a, 10)), coercibility(repeat(_latin2 as a, 10)) from dual +END +INPUT +select find_in_set(json_unquote(json_set('{}','$','')),1); +END +OUTPUT +select find_in_set(json_unquote(json_set('{}', '$', '')), 1) from dual +END +INPUT +select col1 as count_col1,col2 as group_col2 from t1 as tmp1 group by col1,col2 having group_col2 = 'hello'; +END +OUTPUT +select col1 as count_col1, col2 as group_col2 from t1 as tmp1 group by col1, col2 having group_col2 = 'hello' +END +INPUT +select a as like_a from t1 where a like 'a%'; +END +OUTPUT +select a as like_a from t1 where a like 'a%' +END +INPUT +select from t1 where a = '4828532208463511553'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select char_length('abcd'), octet_length('abcd'); +END +OUTPUT +select char_length('abcd'), octet_length('abcd') from dual +END +INPUT +select hex(convert(char(2557 using latin1) using utf8mb4)); +END +ERROR +syntax error at position 35 near 'using' +END +INPUT +select 0x961838f6fc3c7f9ec17b5d900410d8aa like '%-113%'; +END +OUTPUT +select 0x961838f6fc3c7f9ec17b5d900410d8aa like '%-113%' from dual +END +INPUT +select @keyword2_id:= 10202; +END +ERROR +syntax error at position 21 near ':' +END +INPUT +select week(20001231), week(20001231,6); +END +OUTPUT +select week(20001231), week(20001231, 6) from dual +END +INPUT +select mbrtouches(ST_GeomFromText("linestring(1 0, 2 0)"), ST_GeomFromText("polygon((0 0, 3 0, 3 3, 0 3, 0 0))")); +END +OUTPUT +select mbrtouches(ST_GeomFromText('linestring(1 0, 2 0)'), ST_GeomFromText('polygon((0 0, 3 0, 3 3, 0 3, 0 0))')) from dual +END +INPUT +select count(*) from information_schema.events where event_schema = database() and event_name = 'event_35981' and on_completion = 'NOT PRESERVE'; +END +OUTPUT +select count(*) from information_schema.events where event_schema = database() and event_name = 'event_35981' and on_completion = 'NOT PRESERVE' +END +INPUT +select hex(substr(_utf16 0x00e400e50068,-1)); +END +ERROR +syntax error at position 40 near '0x00e400e50068' +END +INPUT +select substr('hello',null,2),substr('hello',2,null),substr(null,1,2); +END +OUTPUT +select substr('hello', null, 2), substr('hello', 2, null), substr(null, 1, 2) from dual +END +INPUT +select t1.a1, t1.a2, t2.a1, t2.a2 from t1 left outer join t2 on t1.a1=10; +END +OUTPUT +select t1.a1, t1.a2, t2.a1, t2.a2 from t1 left join t2 on t1.a1 = 10 +END +INPUT +select benchmark(@bench_count, pi()); +END +OUTPUT +select benchmark(@bench_count, pi()) from dual +END +INPUT +select a as like_aa from t1 where a like 'aa%'; +END +OUTPUT +select a as like_aa from t1 where a like 'aa%' +END +INPUT +select -9223372036854775808 0 as result; +END +ERROR +syntax error at position 30 near '0' +END +INPUT +select userid,count(*) from t1 group by userid order by userid desc; +END +OUTPUT +select userid, count(*) from t1 group by userid order by userid desc +END +INPUT +select std(s1/s2) from bug22555 group by i order by i; +END +OUTPUT +select std(s1 / s2) from bug22555 group by i order by i asc +END +INPUT +select table_name from information_schema.TABLES where table_schema like "test%" order by table_name; +END +OUTPUT +select table_name from information_schema.`TABLES` where table_schema like 'test%' order by table_name asc +END +INPUT +select min(a1), max(a1) from t1 where a4 = 0.080; +END +OUTPUT +select min(a1), max(a1) from t1 where a4 = 0.080 +END +INPUT +select format(NULL, 2); +END +OUTPUT +select format(null, 2) from dual +END +INPUT +select count(distinct b) from t1 where (a2 >= 'b') and (b = 'a'); +END +OUTPUT +select count(distinct b) from t1 where a2 >= 'b' and b = 'a' +END +INPUT +select yearweek("0000-00-00"),yearweek(d),yearweek(dt),yearweek(t),yearweek(c) from t1; +END +OUTPUT +select yearweek('0000-00-00'), yearweek(d), yearweek(dt), yearweek(t), yearweek(c) from t1 +END +INPUT +select f2 from t1 where time(f2) between cast("12:1:2" as time) and cast("12:2:2" as time); +END +OUTPUT +select f2 from t1 where time(f2) between convert('12:1:2', time) and convert('12:2:2', time) +END +INPUT +select a1,a2,b, max(c) from t2 where (c < 'a0') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c) from t2 where c < 'a0' group by a1, a2, b +END +INPUT +select host,db,user,table_name,column_name from mysql.columns_priv where user like 'mysqltest_%' order by host,db,user,table_name,column_name; +END +OUTPUT +select host, db, `user`, table_name, column_name from mysql.columns_priv where `user` like 'mysqltest_%' order by host asc, db asc, `user` asc, table_name asc, column_name asc +END +INPUT +select from renamed_slow_log; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 2 or 3; +END +OUTPUT +select 2 or 3 from dual +END +INPUT +select from t1 where a not between 1 and 2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select pow(cast(-2 as unsigned), 5), pow(18446744073709551614, 5), pow(-2, 5); +END +OUTPUT +select pow(convert(-2, unsigned), 5), pow(18446744073709551614, 5), pow(-2, 5) from dual +END +INPUT +select date_add(last_day("1997-12-1"), INTERVAL 1 DAY); +END +OUTPUT +select date_add(last_day('1997-12-1'), interval 1 DAY) from dual +END +INPUT +select concat(':',trim(BOTH 'ab' FROM 'ababmyabab'),':',trim(BOTH '*' FROM '***sql'),':'); +END +ERROR +syntax error at position 38 near 'FROM' +END +INPUT +select date_add(date,INTERVAL 1 YEAR) from t1; +END +OUTPUT +select date_add(`date`, interval 1 YEAR) from t1 +END +INPUT +select v,count(t) from t1 group by v order by v limit 10; +END +OUTPUT +select v, count(t) from t1 group by v order by v asc limit 10 +END +INPUT +select a1,a2,b,min(c),max(c) from t2 where (c > 'b1') or (c <= 'g1') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t2 where c > 'b1' or c <= 'g1' group by a1, a2, b +END +INPUT +select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on t2.b=t3.a; +END +OUTPUT +select t2.b, ifnull(t2.b, 'this is null') from t1 as t2 left join t1 as t3 on t2.b = t3.a +END +INPUT +select from (select @arg00) aaa; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select concat("*",name,"*") from t2 order by 1; +END +OUTPUT +select concat('*', `name`, '*') from t2 order by 1 asc +END +INPUT +select concat('|', text1, '|') from t1 where text1='teststring'; +END +OUTPUT +select concat('|', text1, '|') from t1 where text1 = 'teststring' +END +INPUT +select mbrtouches(ST_GeomFromText("point(2 4)"), ST_GeomFromText("linestring(2 0, 2 4)")); +END +OUTPUT +select mbrtouches(ST_GeomFromText('point(2 4)'), ST_GeomFromText('linestring(2 0, 2 4)')) from dual +END +INPUT +select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b; +END +OUTPUT +select distinct a1, a2, b, c from t2 where a2 >= 'b' and b = 'a' and c = 'i121' group by a1, a2, b +END +INPUT +select d as e, two as f from (select a as d, 2*a as two from t) dt; +END +OUTPUT +select d as e, two as f from (select a as d, 2 * a as two from t) as dt +END +INPUT +select max(a) from t1m; +END +OUTPUT +select max(a) from t1m +END +INPUT +select timediff("1997-12-31 23:59:59.000001","23:59:59.000001"); +END +OUTPUT +select timediff('1997-12-31 23:59:59.000001', '23:59:59.000001') from dual +END +INPUT +select timestampdiff(year,'2004-02-28','2005-02-28'); +END +OUTPUT +select timestampdiff(year, '2004-02-28', '2005-02-28') from dual +END +INPUT +select substring('hello', 18446744073709551615, 18446744073709551615); +END +OUTPUT +select substr('hello', 18446744073709551615, 18446744073709551615) from dual +END +INPUT +select substring_index('aaaaaaaaa1','a',1); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'a', 1) from dual +END +INPUT +select grp,group_concat(d order by a desc) from t1 group by grp; +END +OUTPUT +select grp, group_concat(d order by a desc) from t1 group by grp +END +INPUT +select t1.*,t2.*,t3.a from t1 left join t2 on (t1.a=t2.a) left join t1 as t3 on (t2.a=t3.a); +END +OUTPUT +select t1.*, t2.*, t3.a from t1 left join t2 on t1.a = t2.a left join t1 as t3 on t2.a = t3.a +END +INPUT +select ln(-1); +END +OUTPUT +select ln(-1) from dual +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_swedish_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_swedish_ci +END +INPUT +select count(distinct a),count(distinct grp) from t1; +END +OUTPUT +select count(distinct a), count(distinct grp) from t1 +END +INPUT +select least(1,2,3) | greatest(16,32,8), least(5,4)*1,greatest(-1.0,1.0)*1,least(3,2,1)*1.0,greatest(1,1.1,1.0),least("10",9),greatest("A","B","0"); +END +OUTPUT +select least(1, 2, 3) | greatest(16, 32, 8), least(5, 4) * 1, greatest(-1.0, 1.0) * 1, least(3, 2, 1) * 1.0, greatest(1, 1.1, 1.0), least('10', 9), greatest('A', 'B', '0') from dual +END +INPUT +select count(*) from t17583; +END +OUTPUT +select count(*) from t17583 +END +INPUT +select MYSQLTEST.T1.* from T1; +END +OUTPUT +select MYSQLTEST.T1.* from T1 +END +INPUT +select t1.a,sec_to_time(sum(time_to_sec(t))) from t1 left join t2 on (t1.b=t2.a) group by t1.a,t2.b; +END +OUTPUT +select t1.a, sec_to_time(sum(time_to_sec(t))) from t1 left join t2 on t1.b = t2.a group by t1.a, t2.b +END +INPUT +select @@global.have_profiling; +END +OUTPUT +select @@global.have_profiling from dual +END +INPUT +select /lib32/ /libx32/ user, host, db, command, state, info from information_schema.processlist where (info like "select get_lock%" OR user='event_scheduler') order by info; +END +ERROR +syntax error at position 9 +END +INPUT +select from t3 order by 1,2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select rpad('hello', -18446744073709551616, '1'); +END +OUTPUT +select rpad('hello', -18446744073709551616, '1') from dual +END +INPUT +select "at" as col1, "c" as col2; +END +OUTPUT +select 'at' as col1, 'c' as col2 from dual +END +INPUT +select min(`col002`) from t1 union select `col002` from t1; +END +OUTPUT +(select min(col002) from t1) union (select col002 from t1) +END +INPUT +select from t1,t1 as t2 where t1.x=t2.y; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select date,format,cast(str_to_date(date, format) as datetime) as datetime from t1; +END +OUTPUT +select `date`, `format`, convert(str_to_date(`date`, `format`), datetime) as `datetime` from t1 +END +INPUT +select rpad('hello', -18446744073709551615, '1'); +END +OUTPUT +select rpad('hello', -18446744073709551615, '1') from dual +END +INPUT +select from t1 where MATCH a,b AGAINST ('"now support"' IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL "10000:99:99" HOUR_SECOND); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval '10000:99:99' HOUR_SECOND) from dual +END +INPUT +select count(*) from t1 where t='a '; +END +OUTPUT +select count(*) from t1 where t = 'a ' +END +INPUT +select rpad('hello', -4294967295, '1'); +END +OUTPUT +select rpad('hello', -4294967295, '1') from dual +END +INPUT +select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_general_ci; +END +ERROR +syntax error at position 22 near 'LIKE' +END +INPUT +select soundex(_utf8mb4 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB); +END +OUTPUT +select soundex(_utf8mb4 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB) from dual +END +INPUT +select round(cast(-2 as unsigned), 1), round(18446744073709551614, 1), round(-2, 1); +END +OUTPUT +select round(convert(-2, unsigned), 1), round(18446744073709551614, 1), round(-2, 1) from dual +END +INPUT +select from t3 where a > 10 and a < 20; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where a like "%a%"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a1,a2,b,min(c),max(c) from t1 where a1 >= 'b' group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 where a1 >= 'b' group by a1, a2, b +END +INPUT +select null mod null as 'NULL'; +END +OUTPUT +select null % null as `NULL` from dual +END +INPUT +select count(*) from information_schema.events where event_schema = database() and event_name = 'event_35981' and on_completion = 'PRESERVE'; +END +OUTPUT +select count(*) from information_schema.events where event_schema = database() and event_name = 'event_35981' and on_completion = 'PRESERVE' +END +INPUT +select locate('he','hello',-2); +END +OUTPUT +select locate('he', 'hello', -2) from dual +END +INPUT +select st_within( multipoint(point(4,2),point(-6,-8)), polygon( linestring(point(13,0),point(13,0)), linestring(point(2,4), point(2,4)) )); +END +OUTPUT +select st_within(multipoint(point(4, 2), point(-6, -8)), polygon(linestring(point(13, 0), point(13, 0)), linestring(point(2, 4), point(2, 4)))) from dual +END +INPUT +select lpad('hello', -18446744073709551615, '1'); +END +OUTPUT +select lpad('hello', -18446744073709551615, '1') from dual +END +INPUT +select event_schema, event_name, definer, event_definition from information_schema.events where event_name='white_space'; +END +OUTPUT +select event_schema, event_name, `definer`, event_definition from information_schema.events where event_name = 'white_space' +END +INPUT +select CASE "c" when "a" then 1 when "b" then 2 END; +END +OUTPUT +select case 'c' when 'a' then 1 when 'b' then 2 end from dual +END +INPUT +select grp,group_concat(c order by 1) from t1 group by grp; +END +OUTPUT +select grp, group_concat(c order by 1 asc) from t1 group by grp +END +INPUT +select substring_index('the king of the the hill',' ',-3); +END +OUTPUT +select substring_index('the king of the the hill', ' ', -3) from dual +END +INPUT +select 1 as xml; +END +OUTPUT +select 1 as xml from dual +END +INPUT +select "h"; +END +OUTPUT +select 'h' from dual +END +INPUT +select count(id1) from t1 where id2 = 10; +END +OUTPUT +select count(id1) from t1 where id2 = 10 +END +INPUT +select char(123 using binary); +END +ERROR +syntax error at position 22 near 'using' +END +INPUT +select char_length(left(@a:='тест',5)), length(@a), @a; +END +ERROR +syntax error at position 28 near ':' +END +INPUT +select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b) where coercibility(t2.a) = 5 order by t1.a,t2.a; +END +OUTPUT +select t1.*, t2.* from t1 left join t2 on t1.b = t2.b where coercibility(t2.a) = 5 order by t1.a asc, t2.a asc +END +INPUT +select from (t4 natural join t5) natural right join t1 where t4.y > 7; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select (ST_asWKT(ST_geomfromwkb((0x000000000140240000000000004024000000000000)))); +END +OUTPUT +select ST_asWKT(ST_geomfromwkb(0x000000000140240000000000004024000000000000)) from dual +END +INPUT +select collation(export_set(255,_latin2'y',_latin2'n',_latin2' ')), coercibility(export_set(255,_latin2'y',_latin2'n',_latin2' ')); +END +OUTPUT +select collation(export_set(255, _latin2 as y, _latin2 as n, _latin2 as ` `)), coercibility(export_set(255, _latin2 as y, _latin2 as n, _latin2 as ` `)) from dual +END +INPUT +select hex(substr(_utf32 0x000000e4000000e500000068,-2)); +END +ERROR +syntax error at position 52 near '0x000000e4000000e500000068' +END +INPUT +select f1,'' from t1 union select f1,'' from t1; +END +OUTPUT +(select f1, '' from t1) union (select f1, '' from t1) +END +INPUT +select ST_astext(g) from t1 where ST_Intersects(ST_GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'), g); +END +OUTPUT +select ST_astext(g) from t1 where ST_Intersects(ST_GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'), g) +END +INPUT +select t1.f1,t.* from t1, t1 t group by 1; +END +OUTPUT +select t1.f1, t.* from t1, t1 as t group by 1 +END +INPUT +select from t1 where not(a < 10); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where firstname='john' and firstname like binary 'John'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select charset(charset(_utf8'a')), charset(collation(_utf8'a')); +END +OUTPUT +select charset(charset(_utf8 'a')), charset(collation(_utf8 'a')) from dual +END +INPUT +select from `information_schema`.`key_column_usage` where `TABLE_NAME` = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select user() like "%@%"; +END +OUTPUT +select user() like '%@%' from dual +END +INPUT +select timestampadd(WEEK, 1, date) from t1; +END +OUTPUT +select timestampadd(WEEK, 1, `date`) from t1 +END +INPUT +select log2(-1); +END +OUTPUT +select log2(-1) from dual +END +INPUT +select from t1 c, t2 C; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select charset(database()); +END +OUTPUT +select charset(database()) from dual +END +INPUT +select from t1 left join t2 on b1 = a1 left join t3 on c1 = a1 and b1 is null; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select round(18446744073709551614, -1), truncate(18446744073709551614, -1); +END +OUTPUT +select round(18446744073709551614, -1), truncate(18446744073709551614, -1) from dual +END +INPUT +select sha1('abc'); +END +OUTPUT +select sha1('abc') from dual +END +INPUT +select std(s1/s2) from bug22555 where i=2 group by i; +END +OUTPUT +select std(s1 / s2) from bug22555 where i = 2 group by i +END +INPUT +select s1 as before_delete_general_ci from t1 where s1 like 'ペテ%'; +END +OUTPUT +select s1 as before_delete_general_ci from t1 where s1 like 'ペテ%' +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL "10000:1" MINUTE_SECOND); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval '10000:1' MINUTE_SECOND) from dual +END +INPUT +select unix_timestamp('2038-02-10 01:00:00'); +END +OUTPUT +select unix_timestamp('2038-02-10 01:00:00') from dual +END +INPUT +select t2.fld3 FROM t2 where fld3 = 'honeysuckle'; +END +OUTPUT +select t2.fld3 from t2 where fld3 = 'honeysuckle' +END +INPUT +select host,user,length(authentication_string) from mysql.user where user like 'mysqltest_%' order by host,user,authentication_string; +END +OUTPUT +select host, `user`, length(authentication_string) from mysql.`user` where `user` like 'mysqltest_%' order by host asc, `user` asc, authentication_string asc +END +INPUT +select S.ID as xID, S.ID1 as xID1 from t1 as S left join t1 as yS on S.ID1 between yS.ID1 and yS.ID2; +END +OUTPUT +select S.ID as xID, S.ID1 as xID1 from t1 as S left join t1 as yS on S.ID1 between yS.ID1 and yS.ID2 +END +INPUT +select insert('hello', 4294967296, 1, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id; +END +OUTPUT +select one.id, elt(two.val, 'one', 'two') from t1 as one, t2 as two where two.id = one.id +END +INPUT +select concat_ws(', ','monty','was here','again'); +END +OUTPUT +select concat_ws(', ', 'monty', 'was here', 'again') from dual +END +INPUT +select rpad('STRING', 20, CONCAT('p','a','d') ); +END +OUTPUT +select rpad('STRING', 20, CONCAT('p', 'a', 'd')) from dual +END +INPUT +select 'hello' 'monty'; +END +OUTPUT +select 'hello' as monty from dual +END +INPUT +select collation(bin(130)), coercibility(bin(130)); +END +OUTPUT +select collation(bin(130)), coercibility(bin(130)) from dual +END +INPUT +select locate(null,'hello',null),locate('he',null,null); +END +OUTPUT +select locate(null, 'hello', null), locate('he', null, null) from dual +END +INPUT +select MBRwithin(b, b) IS NULL, MBRcontains(b, b) IS NULL, MBRoverlaps(b, b) IS NULL, MBRequals(b, b) IS NULL, MBRdisjoint(b, b) IS NULL, ST_touches(b, b) IS NULL, MBRintersects(b, b) IS NULL, ST_crosses(b, b) IS NULL from t1; +END +OUTPUT +select MBRwithin(b, b) is null, MBRcontains(b, b) is null, MBRoverlaps(b, b) is null, MBRequals(b, b) is null, MBRdisjoint(b, b) is null, ST_touches(b, b) is null, MBRintersects(b, b) is null, ST_crosses(b, b) is null from t1 +END +INPUT +select from mysqltest.t1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select grp,group_concat(a order by d+c-ascii(c),a) from t1 group by grp; +END +OUTPUT +select grp, group_concat(a order by d + c - ascii(c) asc, a asc) from t1 group by grp +END +INPUT +select from t1 where MATCH(a,b) AGAINST ("collections") UNION ALL select from t1 where MATCH(a,b) AGAINST ("indexes"); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 0, ST_Within(ST_GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), ST_GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')); +END +OUTPUT +select 0, ST_Within(ST_GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), ST_GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')) from dual +END +INPUT +select c cz from t1 where c='z'; +END +OUTPUT +select c as cz from t1 where c = 'z' +END +INPUT +select group_concat(c) from t1; +END +OUTPUT +select group_concat(c) from t1 +END +INPUT +select 1e8 min(df) from t1; +END +ERROR +syntax error at position 16 +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_icelandic_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_icelandic_ci +END +INPUT +select i from t1 where b=repeat(_utf8 'b',310); +END +OUTPUT +select i from t1 where b = repeat(_utf8 'b', 310) +END +INPUT +select from t1 where not(not(a)); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select bar from t1 having instr(group_concat(bar order by concat(bar,bar) desc), "test2,test1") > 0; +END +OUTPUT +select bar from t1 having instr(group_concat(bar order by concat(bar, bar) desc), 'test2,test1') > 0 +END +INPUT +select ifnull(NULL, _utf8'string'); +END +OUTPUT +select ifnull(null, _utf8 'string') from dual +END +INPUT +select hex(_utf8 B'001111111111'); +END +OUTPUT +select hex(_utf8 B'001111111111') from dual +END +INPUT +select right('hello', -18446744073709551615); +END +OUTPUT +select right('hello', -18446744073709551615) from dual +END +INPUT +select 1 where 'b%a' like '%%a' escape '%'; +END +OUTPUT +select 1 from dual where 'b%a' like '%%a' escape '%' +END +INPUT +select 0 mod null as 'NULL'; +END +OUTPUT +select 0 % null as `NULL` from dual +END +INPUT +select count(*) from t4; +END +OUTPUT +select count(*) from t4 +END +INPUT +select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12); +END +OUTPUT +select @@group_concat_max_len, length(@x), char_length(@x), right(@x, 12), right(HEX(@x), 12) from dual +END +INPUT +select a, MAX(b), MAKE_SET(MAX(b), 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h') from t1 group by a; +END +OUTPUT +select a, MAX(b), MAKE_SET(MAX(b), 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h') from t1 group by a +END +INPUT +select lpad(c1,3,'�'), lpad('�',3,c1) from t1; +END +OUTPUT +select lpad(c1, 3, '�'), lpad('�', 3, c1) from t1 +END +INPUT +select "1997-12-31 23:59:59" + INTERVAL 1 SECOND; +END +OUTPUT +select '1997-12-31 23:59:59' + interval 1 SECOND from dual +END +INPUT +select from t2 where b="world"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*) from mysql.host; +END +OUTPUT +select count(*) from mysql.host +END +INPUT +select length(unhex(md5("abrakadabra"))); +END +OUTPUT +select length(unhex(md5('abrakadabra'))) from dual +END +INPUT +select yearweek("2000-01-06",1) as '2000', yearweek("2001-01-06",1) as '2001', yearweek("2002-01-06",1) as '2002',yearweek("2003-01-06",1) as '2003', yearweek("2004-01-06",1) as '2004', yearweek("2005-01-06",1) as '2005', yearweek("2006-01-06",1) as '2006'; +END +OUTPUT +select yearweek('2000-01-06', 1) as `2000`, yearweek('2001-01-06', 1) as `2001`, yearweek('2002-01-06', 1) as `2002`, yearweek('2003-01-06', 1) as `2003`, yearweek('2004-01-06', 1) as `2004`, yearweek('2005-01-06', 1) as `2005`, yearweek('2006-01-06', 1) as `2006` from dual +END +INPUT +select quarter("0000-00-00"),quarter(d),quarter(dt),quarter(t),quarter(c) from t1; +END +OUTPUT +select quarter('0000-00-00'), quarter(d), quarter(dt), quarter(t), quarter(c) from t1 +END +INPUT +select makedate('0003',1); +END +OUTPUT +select makedate('0003', 1) from dual +END +INPUT +select f1 from t1 where f1 between cast("2006-1-1" as date) and cast("2006.1.1" as date); +END +OUTPUT +select f1 from t1 where f1 between convert('2006-1-1', date) and convert('2006.1.1', date) +END +INPUT +select lpad('STRING', 20, CONCAT('p','a','d') ); +END +OUTPUT +select lpad('STRING', 20, CONCAT('p', 'a', 'd')) from dual +END +INPUT +select hex(substr(_ucs2 0x00e400e50068,1)); +END +ERROR +syntax error at position 39 near '0x00e400e50068' +END +INPUT +select conv(-29223372036854775809, -10, 16) as conv_signed, conv(-29223372036854775809, 10, 16) as conv_unsigned; +END +OUTPUT +select conv(-29223372036854775809, -10, 16) as conv_signed, conv(-29223372036854775809, 10, 16) as conv_unsigned from dual +END +INPUT +select host,db,user from mysql.db where user = 'mysqltest_1' order by host,db,user; +END +OUTPUT +select host, db, `user` from mysql.db where `user` = 'mysqltest_1' order by host asc, db asc, `user` asc +END +INPUT +select a1,a2,b, max(c) from t2 where (c > 'f123') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c) from t2 where c > 'f123' group by a1, a2, b +END +INPUT +select insert('hello', 4294967296, 4294967296, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select aes_decrypt(NULL,"a"); +END +OUTPUT +select aes_decrypt(null, 'a') from dual +END +INPUT +select a from t1 where a in (with cte as (select t1.a) select /*+ no_semijoin() node_modules/ a from cte); +END +ERROR +syntax error at position 34 near 'with' +END +INPUT +select from v1a; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select @@optimizer_switch; +END +OUTPUT +select @@optimizer_switch from dual +END +INPUT +select a.text, b.id, b.betreff from t2 a inner join t3 b on a.id = b.forum inner join t1 c on b.id = c.thread where match(b.betreff) against ('+abc' in boolean mode) union select a.text, b.id, b.betreff from t2 a inner join t3 b on a.id = b.forum inner join t1 c on b.id = c.thread where match(c.beitrag) against ('+abc' in boolean mode) order by match(b.betreff) against ('+abc' in boolean mode) desc; +END +OUTPUT +(select a.`text`, b.id, b.betreff from t2 as a join t3 as b on a.id = b.forum join t1 as c on b.id = c.thread where match(b.betreff) against ('+abc' in boolean mode)) union (select a.`text`, b.id, b.betreff from t2 as a join t3 as b on a.id = b.forum join t1 as c on b.id = c.thread where match(c.beitrag) against ('+abc' in boolean mode)) order by match(b.betreff) against ('+abc' in boolean mode) desc +END +INPUT +select sql_big_result trim(v),count(c) from t1 group by v order by v limit 10; +END +ERROR +syntax error at position 28 +END +INPUT +select 1, min(a) from t1m where a=99; +END +OUTPUT +select 1, min(a) from t1m where a = 99 +END +INPUT +select char(196 using utf8mb4); +END +ERROR +syntax error at position 22 near 'using' +END +INPUT +select trim(null from 'kate') as "must_be_null"; +END +ERROR +syntax error at position 22 near 'from' +END +INPUT +select domain from t1 where concat('@', trim(leading '.' from concat('.', domain))) = '@hello.de'; +END +ERROR +syntax error at position 62 near 'from' +END +INPUT +select @topic4_id:= 10104; +END +ERROR +syntax error at position 19 near ':' +END +INPUT +select 10E+0+'a'; +END +OUTPUT +select 10E+0 + 'a' from dual +END +INPUT +select SQL_BIG_RESULT bit_and(col), bit_or(col) from t1 group by col; +END +ERROR +syntax error at position 31 +END +INPUT +select 3; +END +OUTPUT +select 3 from dual +END +INPUT +select from (select group_concat('c') from DUAL) t; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select NAME_CONST('_id',1234) as id; +END +OUTPUT +select NAME_CONST('_id', 1234) as id from dual +END +INPUT +select -1.49 or -1.49,0.6 or 0.6; +END +OUTPUT +select -1.49 or -1.49, 0.6 or 0.6 from dual +END +INPUT +select distinct b from t1 order by 1; +END +OUTPUT +select distinct b from t1 order by 1 asc +END +INPUT +select (12 mod 0) <=> null as '1'; +END +OUTPUT +select 12 % 0 <=> null as `1` from dual +END +INPUT +select from t1 where a=if(b<10,_ucs2 0x0061,_ucs2 0x0062); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select ST_astext(st_symdifference(ST_GeomFromText('multipoint(2 2, 3 3)'), ST_GeomFromText('multipoint(2 2, 3 3)'))); +END +OUTPUT +select ST_astext(st_symdifference(ST_GeomFromText('multipoint(2 2, 3 3)'), ST_GeomFromText('multipoint(2 2, 3 3)'))) from dual +END +INPUT +select t2.fld3 FROM t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +END +OUTPUT +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3 asc +END +INPUT +select date_add(date,INTERVAL "1 1:1:1" DAY_SECOND) from t1; +END +OUTPUT +select date_add(`date`, interval '1 1:1:1' DAY_SECOND) from t1 +END +INPUT +select column_name from information_schema.columns where table_name='t1' order by column_name; +END +OUTPUT +select column_name from information_schema.`columns` where table_name = 't1' order by column_name asc +END +INPUT +select from t1 where t1="ABC"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from v3b; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select group_concat(distinct s1 order by s2) from t1 where s2 < 4; +END +OUTPUT +select group_concat(distinct s1 order by s2 asc) from t1 where s2 < 4 +END +INPUT +select collation(replace(_latin2'abcd',_latin2'b',_latin2'B')), coercibility(replace(_latin2'abcd',_latin2'b',_latin2'B')); +END +OUTPUT +select collation(replace(_latin2 as abcd, _latin2 as b, _latin2 as B)), coercibility(replace(_latin2 as abcd, _latin2 as b, _latin2 as B)) from dual +END +INPUT +select space(-4294967295); +END +OUTPUT +select space(-4294967295) from dual +END +INPUT +select from t3 where a=1 order by b limit 2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from (select group_concat(a) from t1) t2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select left('hello', -18446744073709551617); +END +OUTPUT +select left('hello', -18446744073709551617) from dual +END +INPUT +select from t1 where match(d, e) against ('+aword +bword' in boolean mode); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select right('hello', 4294967295); +END +OUTPUT +select right('hello', 4294967295) from dual +END +INPUT +select a != b from t1; +END +OUTPUT +select a != b from t1 +END +INPUT +select hex(s1), s1 from t1; +END +OUTPUT +select hex(s1), s1 from t1 +END +INPUT +select f1 from t1 where f1 between CAST("2006-1-1" as date) and CAST(20060101 as date); +END +OUTPUT +select f1 from t1 where f1 between convert('2006-1-1', date) and convert(20060101, date) +END +INPUT +select character_maximum_length, character_octet_length from information_schema.columns where table_name='t1'; +END +OUTPUT +select character_maximum_length, character_octet_length from information_schema.`columns` where table_name = 't1' +END +INPUT +select soundex(_utf8mb4 0xD091D092D093); +END +OUTPUT +select soundex(_utf8mb4 0xD091D092D093) from dual +END +INPUT +select hex(convert(_gbk 0xA14041 using ucs2)); +END +ERROR +syntax error at position 33 near '0xA14041' +END +INPUT +select rpad(i, 7, ' ') as t from t1; +END +OUTPUT +select rpad(i, 7, ' ') as t from t1 +END +INPUT +select from t1 where not(a <= 10); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select LAST_DAY('2007-12-06 08:59:19.05') - INTERVAL 1 SECOND; +END +OUTPUT +select LAST_DAY('2007-12-06 08:59:19.05') - interval 1 SECOND from dual +END +INPUT +select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t2.a=t3.a); +END +OUTPUT +select t1.*, t2.*, t3.a from t1 left join t2 on t3.a = t2.a left join t1 as t3 on t2.a = t3.a +END +INPUT +select from t1 order by text1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a as bin2 from t1 where a like 'あいうえおかきくけこさしすせそ'; +END +OUTPUT +select a as bin2 from t1 where a like 'あいうえおかきくけこさしすせそ' +END +INPUT +select ST_Crosses(ST_GeomFromText('MULTIPOINT(0 0,3 3)'),ST_GeomFromText('LINESTRING(1 1,10 10)')) as result; +END +OUTPUT +select ST_Crosses(ST_GeomFromText('MULTIPOINT(0 0,3 3)'), ST_GeomFromText('LINESTRING(1 1,10 10)')) as result from dual +END +INPUT +select 7; +END +OUTPUT +select 7 from dual +END +INPUT +select from information_schema.table_names; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from information_schema.COLLATIONS where COLLATION_NAME like 'latin1%' order by collation_name; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 'a ' = 'a ', 'a ' < 'a ', 'a ' > 'a '; +END +OUTPUT +select 'a ' = 'a\t', 'a ' < 'a\t', 'a ' > 'a\t' from dual +END +INPUT +select from t1 where b=1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_vietnamese_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_vietnamese_ci +END +INPUT +select 'A' like 'a' collate ujis_bin; +END +OUTPUT +select 'A' like 'a' collate ujis_bin from dual +END +INPUT +select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1 join t2 on t1.a=t2.c order by d; +END +OUTPUT +select t1.a, case t1.a when 0 then 0 else t1.b end as d from t1 join t2 on t1.a = t2.c order by d asc +END +INPUT +select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b) where collation(t2.a) = _utf8'binary' order by t1.a,t2.a; +END +OUTPUT +select t1.*, t2.* from t1 left join t2 on t1.b = t2.b where collation(t2.a) = _utf8 'binary' order by t1.a asc, t2.a asc +END +INPUT +select from t1 where i = 2; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*) from t1 group by branch having branch<>'mumbai' order by id desc,branch desc limit 100; +END +OUTPUT +select count(*) from t1 group by branch having branch != 'mumbai' order by id desc, branch desc limit 100 +END +INPUT +select (select d from t2 where d > a) as 'x', t1.* as 'with_alias' from t1; +END +ERROR +syntax error at position 54 near 'as' +END +INPUT +select count(*) from t1 where a = 1; +END +OUTPUT +select count(*) from t1 where a = 1 +END +INPUT +select collation(oct(130)), coercibility(oct(130)); +END +OUTPUT +select collation(oct(130)), coercibility(oct(130)) from dual +END +INPUT +select substring('hello', 4294967297, 1); +END +OUTPUT +select substr('hello', 4294967297, 1) from dual +END +INPUT +select ST_Intersects(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))')); +END +OUTPUT +select ST_Intersects(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))')) from dual +END +INPUT +select crc32("123"); +END +OUTPUT +select crc32('123') from dual +END +INPUT +select date_sub("1998-01-01 00:00:00",INTERVAL 1 YEAR); +END +OUTPUT +select date_sub('1998-01-01 00:00:00', interval 1 YEAR) from dual +END +INPUT +select substr(z.a,-1), z.a from t1 as y join t1 as z on y.a=z.a order by 1; +END +OUTPUT +select substr(z.a, -1), z.a from t1 as y join t1 as z on y.a = z.a order by 1 asc +END +INPUT +select timestampdiff(SQL_TSI_DAY, '1986-02-01', '1986-03-01') as a1, timestampdiff(SQL_TSI_DAY, '1900-02-01', '1900-03-01') as a2, timestampdiff(SQL_TSI_DAY, '1996-02-01', '1996-03-01') as a3, timestampdiff(SQL_TSI_DAY, '2000-02-01', '2000-03-01') as a4; +END +OUTPUT +select timestampdiff(SQL_TSI_DAY, '1986-02-01', '1986-03-01') as a1, timestampdiff(SQL_TSI_DAY, '1900-02-01', '1900-03-01') as a2, timestampdiff(SQL_TSI_DAY, '1996-02-01', '1996-03-01') as a3, timestampdiff(SQL_TSI_DAY, '2000-02-01', '2000-03-01') as a4 from dual +END +INPUT +select from information_schema.COLLATION_CHARACTER_SET_APPLICABILITY where COLLATION_NAME like 'latin1%' ORDER BY COLLATION_NAME; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select find_in_set('1','3,1,'); +END +OUTPUT +select find_in_set('1', '3,1,') from dual +END +INPUT +select lpad('abc', cast(5 as unsigned integer), 'x'); +END +OUTPUT +select lpad('abc', convert(5, unsigned), 'x') from dual +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL " -10000 99:99" DAY_MINUTE); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval ' -10000 99:99' DAY_MINUTE) from dual +END +INPUT +select insert('hello', 1, 18446744073709551617, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select format(d, 2) from t1; +END +OUTPUT +select format(d, 2) from t1 +END +INPUT +select t2.* from t2; +END +OUTPUT +select t2.* from t2 +END +INPUT +select 123456789012345678901234567890.123456789012345678901234567890 div 1 as x; +END +OUTPUT +select 123456789012345678901234567890.123456789012345678901234567890 div 1 as x from dual +END +INPUT +select 1 /*!999999 +1 */; +END +OUTPUT +select 1 from dual +END +INPUT +select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a'); +END +OUTPUT +select distinct a1, a2, b from t1 where a2 >= 'b' and b = 'a' +END +INPUT +select concat(a,if(b<10,_ucs2 0x0062,_ucs2 0x00C0)) from t1; +END +ERROR +syntax error at position 37 near '0x0062' +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_german2_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_german2_ci +END +INPUT +select cast(-19999999999999999999 as signed); +END +OUTPUT +select convert(-19999999999999999999, signed) from dual +END +INPUT +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +END +OUTPUT +select t2.fld3, companynr from t2 where companynr = 57 + 1 order by fld3 asc +END +INPUT +select from general_log where argument like '%general_log%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser10' and host='localhost'; +END +OUTPUT +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where `user` = 'mysqluser10' and host = 'localhost' +END +INPUT +select ST_astext(ST_symdifference(ST_GeomFromText('polygon((0 0, 1 0, 0 1, 0 0))'), ST_GeomFromText('polygon((0 0, 1 1, 0 2, 0 0))'))); +END +OUTPUT +select ST_astext(ST_symdifference(ST_GeomFromText('polygon((0 0, 1 0, 0 1, 0 0))'), ST_GeomFromText('polygon((0 0, 1 1, 0 2, 0 0))'))) from dual +END +INPUT +select ifnull(group_concat(concat(t1.id, ':', t1.name)), 'shortname') as 'without distinct: how it should be' from t1; +END +OUTPUT +select ifnull(group_concat(concat(t1.id, ':', t1.`name`)), 'shortname') as `without distinct: how it should be` from t1 +END +INPUT +select t1.a,t3.y from t1,(select a as y from t2 where b='c') as t3 where t1.a = t3.y; +END +OUTPUT +select t1.a, t3.y from t1, (select a as y from t2 where b = 'c') as t3 where t1.a = t3.y +END +INPUT +select 'Contains'; +END +OUTPUT +select 'Contains' from dual +END +INPUT +select t.table_name, group_concat(t.table_schema, '.', t.table_name), count(*) as num1 from information_schema.tables t inner join information_schema.columns c1 on t.table_schema = c1.table_schema AND t.table_name = c1.table_name where t.table_name not like 'ndb%' and t.table_schema = 'information_schema' and c1.ordinal_position = (select isnull(c2.column_type) - isnull(group_concat(c2.table_schema, '.', c2.table_name)) + count(*) as num from information_schema.columns c2 where c2.table_schema='information_schema' and (c2.column_type = 'varchar(7)' or c2.column_type = 'varchar(20)') group by c2.column_type order by num limit 1) and t.table_name not like 'INNODB_%' group by t.table_name order by num1, t.table_name COLLATE utf8_general_ci; +END +OUTPUT +select t.table_name, group_concat(t.table_schema, '.', t.table_name), count(*) as num1 from information_schema.`tables` as t join information_schema.`columns` as c1 on t.table_schema = c1.table_schema and t.table_name = c1.table_name where t.table_name not like 'ndb%' and t.table_schema = 'information_schema' and c1.ordinal_position = (select isnull(c2.column_type) - isnull(group_concat(c2.table_schema, '.', c2.table_name)) + count(*) as num from information_schema.`columns` as c2 where c2.table_schema = 'information_schema' and (c2.column_type = 'varchar(7)' or c2.column_type = 'varchar(20)') group by c2.column_type order by num asc limit 1) and t.table_name not like 'INNODB_%' group by t.table_name order by num1 asc, t.table_name collate utf8_general_ci asc +END +INPUT +select a1,a2,b, max(c) from t2 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c) from t2 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and a2 > 'a' group by a1, a2, b +END +INPUT +select space(-18446744073709551616); +END +OUTPUT +select space(-18446744073709551616) from dual +END +INPUT +select 'a ' = 'a' , 'a ' < 'a' , 'a ' > 'a'; +END +OUTPUT +select 'a\t' = 'a', 'a\t' < 'a', 'a\t' > 'a' from dual +END +INPUT +select greatest(1,_utf16'.',_utf8''); +END +OUTPUT +select greatest(1, _utf16 as `.`, _utf8 '') from dual +END +INPUT +select round(1e1,308), truncate(1e1, 308); +END +OUTPUT +select round(1e1, 308), truncate(1e1, 308) from dual +END +INPUT +select @a != @b; +END +OUTPUT +select @a != @b from dual +END +INPUT +select last_day("1997-12-1")+0.0; +END +OUTPUT +select last_day('1997-12-1') + 0.0 from dual +END +INPUT +select ST_AsText(ST_GeometryFromWKB(ST_AsWKB(GeometryCollection(POINT(0, 0), MULTIPOINT(point(0, 0), point(1, 1)), LINESTRING(point(0, 0),point(10, 10)), MULTILINESTRING(LINESTRING(point(1, 2), point(1, 3))), POLYGON(LineString(Point(10, 20), Point(1, 1), Point(2, 2), Point(10, 20))), MULTIPOLYGON(Polygon(LineString(Point(0, 0), Point(1, 0), Point(1, 1), Point(0, 0)))))))) as Result; +END +OUTPUT +select ST_AsText(ST_GeometryFromWKB(ST_AsWKB(GeometryCollection(POINT(0, 0), MULTIPOINT(point(0, 0), point(1, 1)), LINESTRING(point(0, 0), point(10, 10)), MULTILINESTRING(LINESTRING(point(1, 2), point(1, 3))), POLYGON(LineString(Point(10, 20), Point(1, 1), Point(2, 2), Point(10, 20))), MULTIPOLYGON(Polygon(LineString(Point(0, 0), Point(1, 0), Point(1, 1), Point(0, 0)))))))) as Result from dual +END +INPUT +select bar from t1 having group_concat(bar)=''; +END +OUTPUT +select bar from t1 having group_concat(bar) = '' +END +INPUT +select sql_big_result t2.id, avg(rating+0.0e0) from t2 group by t2.id; +END +ERROR +syntax error at position 26 +END +INPUT +select cast(NULL as signed); +END +OUTPUT +select convert(null, signed) from dual +END +INPUT +select collation(a) from t1; +END +OUTPUT +select collation(a) from t1 +END +INPUT +select "1998-01-01 00:00:00" - INTERVAL 1 SECOND; +END +OUTPUT +select '1998-01-01 00:00:00' - interval 1 SECOND from dual +END +INPUT +select sql_big_result distinct t1.a from t1,t2 order by t2.a; +END +ERROR +syntax error at position 31 near 'distinct' +END +INPUT +select reverse('abc'),reverse('abcd'); +END +OUTPUT +select reverse('abc'), reverse('abcd') from dual +END +INPUT +select datediff("1997-11-31 23:59:59.000001","1997-12-31"); +END +OUTPUT +select datediff('1997-11-31 23:59:59.000001', '1997-12-31') from dual +END +INPUT +select col1 as count_col1 from t1 as tmp1 group by col1 having count_col1 = 10; +END +OUTPUT +select col1 as count_col1 from t1 as tmp1 group by col1 having count_col1 = 10 +END +INPUT +select count(distinct s,n1,vs) from t1; +END +OUTPUT +select count(distinct s, n1, vs) from t1 +END +INPUT +select straight_join from t2 right join t1 on t2.a=t1.a; +END +ERROR +syntax error at position 26 near 'from' +END +INPUT +select 0x0000000001020003F03F40408484040ADDE40 like 0x256F3B38312A7725; +END +OUTPUT +select 0x0000000001020003F03F40408484040ADDE40 like 0x256F3B38312A7725 from dual +END +INPUT +select from performance_schema.global_variables where variable_name like 'event_scheduler'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(s1) from t1 where s1 = 0xfffd; +END +OUTPUT +select hex(s1) from t1 where s1 = 0xfffd +END +INPUT +select from `information_schema`.`STATISTICS` where `TABLE_NAME` = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select t1.i,t2.i,t3.i from t2 natural right join t3,t1 order by t1.i,t2.i,t3.i; +END +OUTPUT +select t1.i, t2.i, t3.i from t2 natural right join t3, t1 order by t1.i asc, t2.i asc, t3.i asc +END +INPUT +select max(a4) from t1; +END +OUTPUT +select max(a4) from t1 +END +INPUT +select truncate(1.5, -2147483649), truncate(1.5, 2147483648); +END +OUTPUT +select truncate(1.5, -2147483649), truncate(1.5, 2147483648) from dual +END +INPUT +select from t1 where not(NULL and a); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c'); +END +OUTPUT +select distinct a1, a2, b from t1 where a1 > 'a' and a2 > 'a' and b = 'c' +END +INPUT +select repeat('a', cast(2 as unsigned int)); +END +ERROR +syntax error at position 42 near 'int' +END +INPUT +select locate('he','hello',2); +END +OUTPUT +select locate('he', 'hello', 2) from dual +END +INPUT +select from `information_schema`.`TRIGGERS` where `EVENT_OBJECT_TABLE` = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select ST_Overlaps(ST_GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), ST_GeomFromText('POLYGON((10 10, 10 4, 4 4, 4 10, 10 10))')); +END +OUTPUT +select ST_Overlaps(ST_GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), ST_GeomFromText('POLYGON((10 10, 10 4, 4 4, 4 10, 10 10))')) from dual +END +INPUT +select spid,count(*) from t1 where spid between 1 and 2 group by spid order by spid desc; +END +OUTPUT +select spid, count(*) from t1 where spid between 1 and 2 group by spid order by spid desc +END +INPUT +select right('hello', 0); +END +OUTPUT +select right('hello', 0) from dual +END +INPUT +select space(-18446744073709551615); +END +OUTPUT +select space(-18446744073709551615) from dual +END +INPUT +select b.id, b.betreff from t3 b group by b.id+1 order by match(betreff) against ('+abc' in boolean mode) desc; +END +OUTPUT +select b.id, b.betreff from t3 as b group by b.id + 1 order by match(betreff) against ('+abc' in boolean mode) desc +END +INPUT +select space(18446744073709551617); +END +OUTPUT +select space(18446744073709551617) from dual +END +INPUT +select get_format(DATE, 'USA') as a; +END +OUTPUT +select get_format(`DATE`, 'USA') as a from dual +END +INPUT +select substring_index('aaaaaaaaa1','aaa',-2); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aaa', -2) from dual +END +INPUT +select p from t2; +END +OUTPUT +select p from t2 +END +INPUT +select X.a from t1 AS X group by X.b having (x.a = 1); +END +OUTPUT +select X.a from t1 as X group by X.b having x.a = 1 +END +INPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name like 't%' and index_name = 'k' order by table_name; +END +OUTPUT +select table_name, index_type from information_schema.statistics where table_schema = 'test' and table_name like 't%' and index_name = 'k' order by table_name asc +END +INPUT +select from t1 order by a; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where a like "ABC%"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t2_base; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1; +END +OUTPUT +select f1 from t1 where f2 != '0000-00-00 00:00:00' order by f1 asc +END +INPUT +select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10'):]]'; +END +OUTPUT +select 'васяz' regexp '[[:<:]]вася[[:>:]]' from dual +END +INPUT +select id, sum(qty) as sqty from t1 group by id having sqty>2; +END +OUTPUT +select id, sum(qty) as sqty from t1 group by id having sqty > 2 +END +INPUT +select ST_astext(ST_Intersection(ST_GeomFromText('LINESTRING(0 0, 50 45, 40 50)'), ST_GeomFromText('LINESTRING(50 5, 55 10, 0 45)'))); +END +OUTPUT +select ST_astext(ST_Intersection(ST_GeomFromText('LINESTRING(0 0, 50 45, 40 50)'), ST_GeomFromText('LINESTRING(50 5, 55 10, 0 45)'))) from dual +END +INPUT +select distinct ifnull(group_concat(concat(t1.id, ':', t1.name)), 'shortname') as 'with distinct: cutoff at length of shortname' from t1; +END +OUTPUT +select distinct ifnull(group_concat(concat(t1.id, ':', t1.`name`)), 'shortname') as `with distinct: cutoff at length of shortname` from t1 +END +INPUT +select charset(version()); +END +OUTPUT +select charset(version()) from dual +END +INPUT +select from t1 where xxx regexp('is a test of some long text to s'); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select char(53647 using utf8mb4); +END +ERROR +syntax error at position 24 near 'using' +END +INPUT +select right('hello', -18446744073709551617); +END +OUTPUT +select right('hello', -18446744073709551617) from dual +END +INPUT +select rpad('hello', -4294967297, '1'); +END +OUTPUT +select rpad('hello', -4294967297, '1') from dual +END +INPUT +select t2.* from (select from t1) as A inner join t2 on A.ID = t2.FID; +END +ERROR +syntax error at position 30 near 'from' +END +INPUT +select col1 as count_col1,col2 from t1 as tmp1 group by col1,col2 having col1 = 10; +END +OUTPUT +select col1 as count_col1, col2 from t1 as tmp1 group by col1, col2 having col1 = 10 +END +INPUT +select col_t1, sum(col1) from t1 group by col_t1 having col_t1 > 10 and exists (select sum(t2.col1) from t2 group by t2.col2 having t2.col2 > 'b'); +END +OUTPUT +select col_t1, sum(col1) from t1 group by col_t1 having col_t1 > 10 and exists (select sum(t2.col1) from t2 group by t2.col2 having t2.col2 > 'b') +END +INPUT +select from t1,t2 natural left join t3 order by t1.i,t2.i,t3.i; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from (t1 natural join t2) join (t3 natural join t4) on t1.b = t3.b; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by a; +END +OUTPUT +select group_concat(t1.b, t2.c) from t1 join t2 using (a) group by a +END +INPUT +select T1.a from MYSQLTEST.T1; +END +OUTPUT +select T1.a from MYSQLTEST.T1 +END +INPUT +select uncompress(a) from t1; +END +OUTPUT +select uncompress(a) from t1 +END +INPUT +select from t1 where word between CAST(0xDF AS CHAR) and CAST(0xDF AS CHAR); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_unicode_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_unicode_ci +END +INPUT +select -(-(9223372036854775808)); +END +OUTPUT +select 9223372036854775808 from dual +END +INPUT +select format(col2,7) from t1; +END +OUTPUT +select format(col2, 7) from t1 +END +INPUT +select max(t1.connection) into connection from t1; +END +ERROR +syntax error at position 42 near 'connection' +END +INPUT +select hex(_utf32 X'44'); +END +ERROR +syntax error at position 24 near '44' +END +INPUT +select a from t1 where a in (1,3); +END +OUTPUT +select a from t1 where a in (1, 3) +END +INPUT +select 1ea10.1a20,1e+ 1e+10 from 1ea10; +END +ERROR +syntax error at position 10 near '1e' +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL 1 DAY); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval 1 DAY) from dual +END +INPUT +select host,db,user,table_name,column_name from mysql.columns_priv where user = 'mysqltest_1' order by host,db,user,table_name,column_name; +END +OUTPUT +select host, db, `user`, table_name, column_name from mysql.columns_priv where `user` = 'mysqltest_1' order by host asc, db asc, `user` asc, table_name asc, column_name asc +END +INPUT +select week("2000-01-06",1) as '2000', week("2001-01-06",1) as '2001', week("2002-01-06",1) as '2002',week("2003-01-06",1) as '2003', week("2004-01-06",1) as '2004', week("2005-01-06",1) as '2005', week("2006-01-06",1) as '2006'; +END +OUTPUT +select week('2000-01-06', 1) as `2000`, week('2001-01-06', 1) as `2001`, week('2002-01-06', 1) as `2002`, week('2003-01-06', 1) as `2003`, week('2004-01-06', 1) as `2004`, week('2005-01-06', 1) as `2005`, week('2006-01-06', 1) as `2006` from dual +END +INPUT +select week(20000106,0) as '0', week(20000106,1) as '1', week(20000106,2) as '2', week(20000106,3) as '3', week(20000106,4) as '4', week(20000106,5) as '5', week(20000106,6) as '6', week(20000106,7) as '7'; +END +OUTPUT +select week(20000106, 0) as `0`, week(20000106, 1) as `1`, week(20000106, 2) as `2`, week(20000106, 3) as `3`, week(20000106, 4) as `4`, week(20000106, 5) as `5`, week(20000106, 6) as `6`, week(20000106, 7) as `7` from dual +END +INPUT +select b from t1 having binary b like ''; +END +OUTPUT +select b from t1 having binary b like '' +END +INPUT +select from t5 natural join ((t1 natural join t2) cross join (t3 natural join t4)); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 1/*!2*/; +END +OUTPUT +select 1 from dual +END +INPUT +select a, t1.* as 'with_alias', b from t1; +END +ERROR +syntax error at position 18 near 'as' +END +INPUT +select char(0xd1,0x8f using utf8mb4); +END +ERROR +syntax error at position 28 near 'using' +END +INPUT +select quote(1/0), quote('Z'); +END +OUTPUT +select quote(1 / 0), quote('Z') from dual +END +INPUT +select left('hello', 4294967295); +END +OUTPUT +select left('hello', 4294967295) from dual +END +INPUT +select count(*) from t1 where v like 'a%'; +END +OUTPUT +select count(*) from t1 where v like 'a%' +END +INPUT +select from_unixtime(2147483648); +END +OUTPUT +select from_unixtime(2147483648) from dual +END +INPUT +select month("0000-00-00"),month(d),month(dt),month(t),month(c) from t1; +END +OUTPUT +select month('0000-00-00'), month(d), month(dt), month(t), month(c) from t1 +END +INPUT +select substring(f1,4,1), substring(f1,-4,1) from t2; +END +OUTPUT +select substr(f1, 4, 1), substr(f1, -4, 1) from t2 +END +INPUT +select FROM t1; +END +ERROR +syntax error at position 12 near 'FROM' +END +INPUT +select case a when 1 then "one" when 2 then "two" else "nothing" end as fcase, count(*) from t1 group by fcase; +END +OUTPUT +select case a when 1 then 'one' when 2 then 'two' else 'nothing' end as fcase, count(*) from t1 group by fcase +END +INPUT +select distinct t from t1; +END +OUTPUT +select distinct t from t1 +END +INPUT +select col1 as count_col1 from t1 as tmp1 group by count_col1 having count_col1 = 10; +END +OUTPUT +select col1 as count_col1 from t1 as tmp1 group by count_col1 having count_col1 = 10 +END +INPUT +select s.*, '*', m.*, (s.match_1_h - m.home) UUX from (t2 s left join t1 m on m.match_id = 1) order by UUX desc; +END +OUTPUT +select s.*, '*', m.*, s.match_1_h - m.home as UUX from (t2 as s left join t1 as m on m.match_id = 1) order by UUX desc +END +INPUT +select collation(concat(_latin2'a',_latin2'b')), coercibility(concat(_latin2'a',_latin2'b')); +END +OUTPUT +select collation(concat(_latin2 as a, _latin2 as b)), coercibility(concat(_latin2 as a, _latin2 as b)) from dual +END +INPUT +select grp,group_concat(a,c) from t1 group by grp; +END +OUTPUT +select grp, group_concat(a, c) from t1 group by grp +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL "-100 1" YEAR_MONTH); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval '-100 1' YEAR_MONTH) from dual +END +INPUT +select hex(weight_string('a' as char(0))); +END +ERROR +syntax error at position 38 +END +INPUT +select cast(5 as unsigned) -6.0; +END +OUTPUT +select convert(5, unsigned) - 6.0 from dual +END +INPUT +select from t1 where a like "�%"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select sql_big_result t2.id, avg(rating) from t2 group by t2.id; +END +ERROR +syntax error at position 26 +END +INPUT +select ST_Astext(ST_Envelope(ST_MPointFromWKB(ST_AsWKB(MultiPoint(Point('0', '-0'),Point('-0', '0'), Point('0', '0')))))) as result; +END +OUTPUT +select ST_Astext(ST_Envelope(ST_MPointFromWKB(ST_AsWKB(MultiPoint(Point('0', '-0'), Point('-0', '0'), Point('0', '0')))))) as result from dual +END +INPUT +select date_add("9999-12-31 23:59:59",INTERVAL 1 SECOND); +END +OUTPUT +select date_add('9999-12-31 23:59:59', interval 1 SECOND) from dual +END +INPUT +select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b; +END +OUTPUT +select distinct a1, a2, b from t1 where a2 >= 'b' and b = 'a' group by a1, a2, b +END +INPUT +select hex(char(0x0102 using ucs2)); +END +ERROR +syntax error at position 29 near 'using' +END +INPUT +select f1 from t1 where makedate(2006,1) between date(f1) and date(f3); +END +OUTPUT +select f1 from t1 where makedate(2006, 1) between date(f1) and date(f3) +END +INPUT +select addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002"); +END +OUTPUT +select addtime('1997-12-31 23:59:59.999999', '1 1:1:1.000002') from dual +END +INPUT +select min(7) from DUAL; +END +OUTPUT +select min(7) from dual +END +INPUT +select from (t1 natural left join t2) natural left join (t3 natural left join t4); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(distinct x.id_aams) from (select from (select t1.id_aams, t2.* from t1 left join t2 on t2.code_id='G0000000012' and t1.id_aams=t2.id_game where t1.id_aams=1715000360 order by t2.id desc ) as g group by g.id_aams having g.id is null ) as x; +END +ERROR +syntax error at position 51 near 'from' +END +INPUT +select from t1 natural join (t2 natural join (t3 natural join t4)); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select c c2 from t1 where c='2'; +END +OUTPUT +select c as c2 from t1 where c = '2' +END +INPUT +select from t1 where not(a > 10); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where word like CAST(0xDF as CHAR); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from information_schema.schema_privileges where grantee like '%user%' and table_schema !='performance_schema' order by grantee; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where MATCH(a,b) AGAINST ("indexes" WITH QUERY EXPANSION); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10'),time('00:00:00'); +END +OUTPUT +select timediff('2008-09-29 20:10:10', '2008-09-30 20:10:10'), time('00:00:00') from dual +END +INPUT +select from information_schema.TABLE_PRIVILEGES where grantee like '%mysqltest_1%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select max(a3) from t1 where a3 = 'MIN' and a2 = 2; +END +OUTPUT +select max(a3) from t1 where a3 = 'MIN' and a2 = 2 +END +INPUT +select a from (select 1 as a) as b; +END +OUTPUT +select a from (select 1 as a from dual) as b +END +INPUT +select lpad(i, 7, ' ') as t from t1; +END +OUTPUT +select lpad(i, 7, ' ') as t from t1 +END +INPUT +select distinct 1 from t1,t3 where t1.a=t3.a; +END +OUTPUT +select distinct 1 from t1, t3 where t1.a = t3.a +END +INPUT +select from t1 where a=b; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select strcmp("a",NULL),(1 10 group by a; +END +OUTPUT +select a, c, sum(a) from t1 where a > 10 group by a +END +INPUT +select ST_astext(g) from t1 where ST_Within(g, ST_GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))')); +END +OUTPUT +select ST_astext(g) from t1 where ST_Within(g, ST_GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))')) +END +INPUT +select table_name, is_updatable from information_schema.views where table_schema != 'sys' order by table_name; +END +OUTPUT +select table_name, is_updatable from information_schema.views where table_schema != 'sys' order by table_name asc +END +INPUT +select events.binlog from events; +END +OUTPUT +select events.binlog from events +END +INPUT +select (case 1/0 when "a" then "true" END) | 0; +END +OUTPUT +select case 1 / 0 when 'a' then 'true' end | 0 from dual +END +INPUT +select _latin2'B' in (_latin1'a',_latin1'b'); +END +ERROR +syntax error at position 21 near 'in' +END +INPUT +select soundex(_utf8 0xD091D092D093); +END +OUTPUT +select soundex(_utf8 0xD091D092D093) from dual +END +INPUT +select sum(a) from t1 where a > 10; +END +OUTPUT +select sum(a) from t1 where a > 10 +END +INPUT +select from information_schema.partitions where table_schema="test" and table_name="t2"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a b, b c from t1 as t2; +END +OUTPUT +select a as b, b as c from t1 as t2 +END +INPUT +select from t1 where MATCH(a,b) AGAINST ("collections"); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select (CASE "two" when "one" then "1" WHEN "two" then "2" END) | 0; +END +OUTPUT +select case 'two' when 'one' then '1' when 'two' then '2' end | 0 from dual +END +INPUT +select uncompress(""); +END +OUTPUT +select uncompress('') from dual +END +INPUT +select a1,a2,b, max(c) from t1 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c) from t1 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1, a2, b +END +INPUT +select from t1, t2 where t1.value64= 9223372036854775807 and t2.value64=9223372036854775807; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where firstname='john' and firstname = binary 'john'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f"); +END +OUTPUT +select str_to_date('2003-01-02 10:11:12.0012', '%Y-%m-%d %H:%i:%S.%f') from dual +END +INPUT +select 1 from t1 order by t1.b; +END +OUTPUT +select 1 from t1 order by t1.b asc +END +INPUT +select hex(weight_string(cast('aa' as binary(3)))); +END +OUTPUT +select hex(weight_string(convert('aa', binary(3)))) from dual +END +INPUT +select group_concat(distinct f1) from t1; +END +OUTPUT +select group_concat(distinct f1) from t1 +END +INPUT +select from information_schema.column_privileges order by grantee; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select NULL AND 0, 0 and NULL; +END +OUTPUT +select null and 0, 0 and null from dual +END +INPUT +select substring('hello', 18446744073709551616, 18446744073709551616); +END +OUTPUT +select substr('hello', 18446744073709551616, 18446744073709551616) from dual +END +INPUT +select st_intersects(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_intersects(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select count(*), min(7), max(7) from t1m, t2i; +END +OUTPUT +select count(*), min(7), max(7) from t1m, t2i +END +INPUT +select user, QUOTE(host) from mysql.user where user="mysqltest_8"; +END +OUTPUT +select `user`, QUOTE(host) from mysql.`user` where `user` = 'mysqltest_8' +END +INPUT +select a1, min(a2), max(a2) from t1 group by a1; +END +OUTPUT +select a1, min(a2), max(a2) from t1 group by a1 +END +INPUT +select from t1 where firstname='john' and binary 'john' = firstname; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select -(9223372036854775808); +END +OUTPUT +select -9223372036854775808 from dual +END +INPUT +select hex(weight_string(_utf32 0x10001 collate utf32_unicode_ci)); +END +ERROR +syntax error at position 40 near '0x10001' +END +INPUT +select distinct b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b; +END +OUTPUT +select distinct b from t2 where a2 >= 'b' and b = 'a' group by a1, a2, b +END +INPUT +select from information_schema.user_privileges order by grantee; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select t1.*,t2.* from t1 JOIN t2 where t1.a=t2.a; +END +OUTPUT +select t1.*, t2.* from t1 join t2 where t1.a = t2.a +END +INPUT +select grp,group_concat(distinct c order by c desc separator ",") from t1 group by grp; +END +OUTPUT +select grp, group_concat(distinct c order by c desc separator ',') from t1 group by grp +END +INPUT +select extract(YEAR_MONTH FROM "1999-01-02"); +END +ERROR +syntax error at position 31 near 'FROM' +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_estonian_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_estonian_ci +END +INPUT +select ST_GeomFromText('linestring(-2 -2, 12 7)') into @l; +END +ERROR +syntax error at position 58 near 'l' +END +INPUT +select RANDOM_BYTES(1025); +END +OUTPUT +select RANDOM_BYTES(1025) from dual +END +INPUT +select inet_aton("0.255.255.255.255"); +END +OUTPUT +select inet_aton('0.255.255.255.255') from dual +END +INPUT +select concat_ws(',','',NULL,'a'); +END +OUTPUT +select concat_ws(',', '', null, 'a') from dual +END +INPUT +select insert('hello', -18446744073709551615, -18446744073709551615, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select s1,hex(s1),char_length(s1),octet_length(s1) from t1; +END +OUTPUT +select s1, hex(s1), char_length(s1), octet_length(s1) from t1 +END +INPUT +select a1,a2,b,min(c),max(c) from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and a2 > 'a' group by a1, a2, b +END +INPUT +select st_astext(st_makeenvelope(st_geomfromtext('point(0 0)'), st_geomfromtext('point(2 2)'))); +END +OUTPUT +select st_astext(st_makeenvelope(st_geomfromtext('point(0 0)'), st_geomfromtext('point(2 2)'))) from dual +END +INPUT +select a1,a2,b,min(c),max(c) from t1 where (a2 >= 'b') and (b = 'a') and (c > 'b111') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 where a2 >= 'b' and b = 'a' and c > 'b111' group by a1, a2, b +END +INPUT +select grp,group_concat("(",a,":",c,")") from t1 group by grp; +END +OUTPUT +select grp, group_concat('(', a, ':', c, ')') from t1 group by grp +END +INPUT +select makedate(9999,366); +END +OUTPUT +select makedate(9999, 366) from dual +END +INPUT +select from information_schema.engines WHERE ENGINE="MyISAM"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select cast(concat('184467440','73709551615') as unsigned); +END +OUTPUT +select convert(concat('184467440', '73709551615'), unsigned) from dual +END +INPUT +select +9999999999999999999,-9999999999999999999; +END +OUTPUT +select 9999999999999999999, -9999999999999999999 from dual +END +INPUT +select collation(right(_latin2'a',1)), coercibility(right(_latin2'a',1)); +END +OUTPUT +select collation(right(_latin2 as a, 1)), coercibility(right(_latin2 as a, 1)) from dual +END +INPUT +select ST_GeomFromText('linestring(6 2, 12 1)') into @l; +END +ERROR +syntax error at position 56 near 'l' +END +INPUT +select hex(substr(_utf16 0x00e400e5D800DC00,-2)); +END +ERROR +syntax error at position 44 near '0x00e400e5D800DC00' +END +INPUT +select 0xbc24421ce6194ab5c260e80af647ae58fdbfca18a19dc8411424 like '%-106%'; +END +OUTPUT +select 0xbc24421ce6194ab5c260e80af647ae58fdbfca18a19dc8411424 like '%-106%' from dual +END +INPUT +select repeat(_utf8'+',3) as h union select NULL; +END +OUTPUT +(select repeat(_utf8 '+', 3) as h from dual) union (select null from dual) +END +INPUT +select fld1,fld3 FROM t2 where fld1 like "25050%"; +END +OUTPUT +select fld1, fld3 from t2 where fld1 like '25050%' +END +INPUT +select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +END +OUTPUT +select `SQL_BIG_RESULT` as a, count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a +END +INPUT +select lpad('hello', 18446744073709551617, '1'); +END +OUTPUT +select lpad('hello', 18446744073709551617, '1') from dual +END +INPUT +select from t1 where MATCH a,b AGAINST ('+collections -supp* -foobar*' IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select date_sub("0200-01-01 00:00:01",INTERVAL 1 SECOND); +END +OUTPUT +select date_sub('0200-01-01 00:00:01', interval 1 SECOND) from dual +END +INPUT +select repeat('monty',5),concat('*',space(5),'*'); +END +OUTPUT +select repeat('monty', 5), concat('*', space(5), '*') from dual +END +INPUT +select a1,a2,b,min(c) from t2 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c < 'h112') or (c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122')) group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c) from t2 where (a1 > 'a' or a1 < '9') and (a2 >= 'b' and a2 < 'z') and b = 'a' and (c < 'h112' or c = 'j121' or c > 'k121' and c < 'm122' or c > 'o122') group by a1, a2, b +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_latvian_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_latvian_ci +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_czech_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_czech_ci +END +INPUT +select "Test default delimiter; +END +ERROR +syntax error at position 32 near 'Test default delimiter;' +END +INPUT +select from t1 where match a against ("te*" in boolean mode)+0; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select sql_buffer_result max(f1)+1 from t1; +END +ERROR +syntax error at position 30 +END +INPUT +select t1Aa.col1 from t1aA,t2Aa where t1Aa.col1 = t2aA.col1; +END +OUTPUT +select t1Aa.col1 from t1aA, t2Aa where t1Aa.col1 = t2aA.col1 +END +INPUT +select sum(col1) from t1 group by col_t1 having col_t1 in (select sum(t2.col1) from t2 group by t2.col2, t2.col1 having t2.col1 = col_t1); +END +OUTPUT +select sum(col1) from t1 group by col_t1 having col_t1 in (select sum(t2.col1) from t2 group by t2.col2, t2.col1 having t2.col1 = col_t1) +END +INPUT +select hex(char(195)); +END +OUTPUT +select hex(char(195)) from dual +END +INPUT +select hex(substr(_utf16 0x00e400e50068,2)); +END +ERROR +syntax error at position 40 near '0x00e400e50068' +END +INPUT +select 1, min(1) from t1m where 1=99; +END +OUTPUT +select 1, min(1) from t1m where 1 = 99 +END +INPUT +select ST_Overlaps(ST_GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), ST_GeomFromText('POLYGON((1 1, 1 4, 4 4, 4 1, 1 1))')); +END +OUTPUT +select ST_Overlaps(ST_GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), ST_GeomFromText('POLYGON((1 1, 1 4, 4 4, 4 1, 1 1))')) from dual +END +INPUT +select length(@test_compress_string); +END +OUTPUT +select length(@test_compress_string) from dual +END +INPUT +select st_astext(st_intersection(ST_GeometryFromText('geometrycollection(polygon((0 0, 2 0, 2 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 3 0, 3 1, 1 1, 1 0)))'))); +END +OUTPUT +select st_astext(st_intersection(ST_GeometryFromText('geometrycollection(polygon((0 0, 2 0, 2 1, 0 1, 0 0)))'), ST_GeometryFromText('geometrycollection(polygon((1 0, 3 0, 3 1, 1 1, 1 0)))'))) from dual +END +INPUT +select st_equals(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_equals(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select distinct *,if(1,'',f1) from t1; +END +OUTPUT +select distinct *, if(1, '', f1) from t1 +END +INPUT +select hex(_utf8 0x616263FF); +END +OUTPUT +select hex(_utf8 0x616263FF) from dual +END +INPUT +select avg(a) as x from t1 having x=2; +END +OUTPUT +select avg(a) as x from t1 having x = 2 +END +INPUT +select s1 from t1 where s1 > 'a' order by s1; +END +OUTPUT +select s1 from t1 where s1 > 'a' order by s1 asc +END +INPUT +select subtime("02:01:01.999999", "01:01:01.999999"); +END +OUTPUT +select subtime('02:01:01.999999', '01:01:01.999999') from dual +END +INPUT +select @@global.profiling_history_size; +END +OUTPUT +select @@global.profiling_history_size from dual +END +INPUT +select collation(trim(TRAILING _latin2' ' FROM _latin2'a')), coercibility(trim(TRAILING _latin2'a' FROM _latin2'a')); +END +ERROR +syntax error at position 42 near ' ' +END +INPUT +select left('hello', -4294967296); +END +OUTPUT +select left('hello', -4294967296) from dual +END +INPUT +select insert('hello', 1, 18446744073709551615, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select 1 /bin /boot /cdrom /dev /etc /home /lib /lib32 /lib64 /libx32 /lost+found /media /mnt /opt /proc /root /run /sbin /snap /srv /swapfile /sys /tmp /usr /var long multi line comment */; +END +ERROR +syntax error at position 174 near 'multi' +END +INPUT +select date_add(date,INTERVAL 1 MONTH) from t1; +END +OUTPUT +select date_add(`date`, interval 1 MONTH) from t1 +END +INPUT +select substring('hello', -18446744073709551615, 1); +END +OUTPUT +select substr('hello', -18446744073709551615, 1) from dual +END +INPUT +select substring('hello', 1, -4294967296); +END +OUTPUT +select substr('hello', 1, -4294967296) from dual +END +INPUT +select from t1 where word2=CAST(0xDF as CHAR); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where MATCH(a,b) AGAINST ("collections" WITH QUERY EXPANSION); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select user,db from information_schema.processlist; +END +OUTPUT +select `user`, db from information_schema.`processlist` +END +INPUT +select st_touches(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_touches(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select i, count(*), variance(s1/s2) from bug22555 group by i order by i; +END +OUTPUT +select i, count(*), variance(s1 / s2) from bug22555 group by i order by i asc +END +INPUT +select from mysqltest_db1.t_column_priv_only; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select maketime(10,11,12); +END +OUTPUT +select maketime(10, 11, 12) from dual +END +INPUT +select TRIM("foo" FROM "foo"), TRIM("foo" FROM "foook"), TRIM("foo" FROM "okfoo"); +END +ERROR +syntax error at position 23 near 'FROM' +END +INPUT +select var_samp(s) as 'null', var_pop(s) as '0' from bug22555; +END +OUTPUT +select var_samp(s) as `null`, var_pop(s) as `0` from bug22555 +END +INPUT +select version()>="3.23.29"; +END +OUTPUT +select version() >= '3.23.29' from dual +END +INPUT +select f1 from t1 union select f1 from t1; +END +OUTPUT +(select f1 from t1) union (select f1 from t1) +END +INPUT +select concat(':',trim(leading from ' left '),':',trim(trailing from ' right '),':'); +END +ERROR +syntax error at position 36 near 'from' +END +INPUT +select DATE_ADD('20071108', INTERVAL 1 DAY); +END +OUTPUT +select DATE_ADD('20071108', interval 1 DAY) from dual +END +INPUT +select locate(_ujis 0xa1a3,_ujis 0xa1a2a1a3); +END +ERROR +syntax error at position 27 near '0xa1a3' +END +INPUT +select char(195 using utf8); +END +ERROR +syntax error at position 22 near 'using' +END +INPUT +select a1,a2,b,min(c),max(c) from t2 where (c < 'a0') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t2 where c < 'a0' group by a1, a2, b +END +INPUT +select ST_NUMPOINTS(ST_EXTERIORRING(ST_buffer(geom,2))) from t1; +END +OUTPUT +select ST_NUMPOINTS(ST_EXTERIORRING(ST_buffer(geom, 2))) from t1 +END +INPUT +select 0=0,1>0,1>=1,1<0,1<=0,1!=0,strcmp("abc","abcd"),strcmp("b","a"),strcmp("a","a"); +END +OUTPUT +select 0 = 0, 1 > 0, 1 >= 1, 1 < 0, 1 <= 0, 1 != 0, strcmp('abc', 'abcd'), strcmp('b', 'a'), strcmp('a', 'a') from dual +END +INPUT +select i from t1 where i=1 into k; +END +ERROR +syntax error at position 34 near 'k' +END +INPUT +select s.*, '*', m.*, (s.match_1_h - m.home) UUX from t2 s straight_join t1 m where m.match_id = 1 order by UUX desc; +END +OUTPUT +select s.*, '*', m.*, s.match_1_h - m.home as UUX from t2 as s straight_join t1 as m where m.match_id = 1 order by UUX desc +END +INPUT +select t1.*,t2.* from t1 left join t2 using (a) where t1.a=t2.a; +END +OUTPUT +select t1.*, t2.* from t1 left join t2 using (a) where t1.a = t2.a +END +INPUT +select hex(weight_string('ab')); +END +OUTPUT +select hex(weight_string('ab')) from dual +END +INPUT +select year("0000-00-00"),year(d),year(dt),year(t),year(c) from t1; +END +OUTPUT +select year('0000-00-00'), year(d), year(dt), year(t), year(c) from t1 +END +INPUT +select a1,a2,b, max(c) from t2 where a1 >= 'c' or a1 < 'b' group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c) from t2 where a1 >= 'c' or a1 < 'b' group by a1, a2, b +END +INPUT +select distinct a2,a1,a2,a1 from t1; +END +OUTPUT +select distinct a2, a1, a2, a1 from t1 +END +INPUT +select from information_schema.KEY_COLUMN_USAGE where TABLE_SCHEMA= "test" order by TABLE_SCHEMA, TABLE_NAME, CONSTRAINT_NAME, COLUMN_NAME; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select left('hello', -4294967295); +END +OUTPUT +select left('hello', -4294967295) from dual +END +INPUT +select ST_astext(st_difference(ST_GeomFromText('polygon((0 0, 1 0, 0 1, 0 0))'), ST_GeomFromText('polygon((0 0, 0 1, 1 1, 1 0, 0 0))'))) as result; +END +OUTPUT +select ST_astext(st_difference(ST_GeomFromText('polygon((0 0, 1 0, 0 1, 0 0))'), ST_GeomFromText('polygon((0 0, 0 1, 1 1, 1 0, 0 0))'))) as result from dual +END +INPUT +select distinct a1,a2,b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b; +END +OUTPUT +select distinct a1, a2, b from t2 where a2 >= 'b' and b = 'a' group by a1, a2, b +END +INPUT +select left('abcd',2); +END +OUTPUT +select left('abcd', 2) from dual +END +INPUT +select min(t1.a5), max(t2.a3) from t1, t2; +END +OUTPUT +select min(t1.a5), max(t2.a3) from t1, t2 +END +INPUT +select from t1 where match a against ("+aaa10 +(bbb*)" in boolean mode); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 10.0+cast('a' as decimal); +END +OUTPUT +select 10.0 + convert('a', decimal) from dual +END +INPUT +select from t1 where f1='test' and (f2= sha("test") or f2= sha("TEST")); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select FIND_IN_SET(_latin1'B',_latin1'a,b,c,d'); +END +OUTPUT +select FIND_IN_SET(_latin1 'B', _latin1 'a,b,c,d') from dual +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_swedish_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_swedish_ci +END +INPUT +select t1.a, group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a)) as grp from t1 group by 1; +END +OUTPUT +select t1.a, group_concat(c order by (select mid(group_concat(c order by a asc), 1, 5) from t2 where t2.a = t1.a) asc) as grp from t1 group by 1 +END +INPUT +select hex(inet_aton('127')); +END +OUTPUT +select hex(inet_aton('127')) from dual +END +INPUT +select sec_to_time(time_to_sec('-838:59:59')); +END +OUTPUT +select sec_to_time(time_to_sec('-838:59:59')) from dual +END +INPUT +select from t1 where not(a = 10); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select TABLE_NAME,COLUMN_NAME,DATA_TYPE,DATETIME_PRECISION from information_schema.columns where TABLE_SCHEMA='mysqltest' order by table_name, column_name; +END +OUTPUT +select TABLE_NAME, COLUMN_NAME, DATA_TYPE, DATETIME_PRECISION from information_schema.`columns` where TABLE_SCHEMA = 'mysqltest' order by table_name asc, column_name asc +END +INPUT +select left('hello',2),right('hello',2),substring('hello',2,2),mid('hello',1,5); +END +OUTPUT +select left('hello', 2), right('hello', 2), substr('hello', 2, 2), mid('hello', 1, 5) from dual +END +INPUT +select date_add("1997-12-31",INTERVAL "1 1" YEAR_MONTH); +END +OUTPUT +select date_add('1997-12-31', interval '1 1' YEAR_MONTH) from dual +END +INPUT +select timestampdiff(month,'1999-09-11','2001-10-10'); +END +OUTPUT +select timestampdiff(month, '1999-09-11', '2001-10-10') from dual +END +INPUT +select hex(convert(s1 using latin1)) from t1; +END +OUTPUT +select hex(convert(s1 using latin1)) from t1 +END +INPUT +select 10+'10'; +END +OUTPUT +select 10 + '10' from dual +END +INPUT +select week(19950101),week(19950101,1); +END +OUTPUT +select week(19950101), week(19950101, 1) from dual +END +INPUT +select case _latin1'a' when _latin2'b' then 1 when _latin5'c' collate latin5_turkish_ci then 2 else 3 end; +END +ERROR +syntax error at position 39 near 'b' +END +INPUT +select point(b, b) IS NULL, linestring(b) IS NULL, polygon(b) IS NULL, multipoint(b) IS NULL, multilinestring(b) IS NULL, multipolygon(b) IS NULL, geometrycollection(b) IS NULL from t1; +END +OUTPUT +select point(b, b) is null, linestring(b) is null, polygon(b) is null, multipoint(b) is null, multilinestring(b) is null, multipolygon(b) is null, geometrycollection(b) is null from t1 +END +INPUT +select from information_schema.table_privileges where grantee like '%user%' and table_schema !='mysql' order by grantee; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select lpad('hello', -18446744073709551617, '1'); +END +OUTPUT +select lpad('hello', -18446744073709551617, '1') from dual +END +INPUT +select from t1 into outfile 'tmp1.txt' character set binary; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select t1.* from t t0 cross join (t t1 join t t2 on 100=(select count(*) from t t3 left join t t4 on t4.a>t3.a-t0.a)); +END +OUTPUT +select t1.* from t as t0 join (t as t1 join t as t2 on 100 = (select count(*) from t as t3 left join t as t4 on t4.a > t3.a - t0.a)) +END +INPUT +select release_lock("test_lock1"); +END +OUTPUT +select release_lock('test_lock1') from dual +END +INPUT +select trim(leading 'foo' from 'foo'); +END +ERROR +syntax error at position 31 near 'from' +END +INPUT +select distinct id, IFNULL(dsc, '-') from t1; +END +OUTPUT +select distinct id, IFNULL(dsc, '-') from t1 +END +INPUT +select from t1 left join t2 on (venue_id = entity_id and match(name) against('aberdeen')) where dt = '2003-05-23 19:30:00'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select col1,count(col1),sum(col1),avg(col1) from t1 group by col1; +END +OUTPUT +select col1, count(col1), sum(col1), avg(col1) from t1 group by col1 +END +INPUT +select from t1 where a=_latin1'����'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select conv("18383815659218730760",10,10) + 0; +END +OUTPUT +select conv('18383815659218730760', 10, 10) + 0 from dual +END +INPUT +select t1.a, t1.b, t2.c from t1 left join t2 on t1.a=t2.a and t1.b=t2.b and t2.c=3 where t1.a=1 and t2.c is null; +END +OUTPUT +select t1.a, t1.b, t2.c from t1 left join t2 on t1.a = t2.a and t1.b = t2.b and t2.c = 3 where t1.a = 1 and t2.c is null +END +INPUT +select 'вася ' rlike '[[:<:]]вася[[:>:]]'; +END +OUTPUT +select 'вася ' regexp '[[:<:]]вася[[:>:]]' from dual +END +INPUT +select group_concat(distinct s1) from t1; +END +OUTPUT +select group_concat(distinct s1) from t1 +END +INPUT +select ST_Disjoint(ST_GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), ST_GeomFromText('POLYGON((10 10, 10 4, 4 4, 4 10, 10 10))')); +END +OUTPUT +select ST_Disjoint(ST_GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), ST_GeomFromText('POLYGON((10 10, 10 4, 4 4, 4 10, 10 10))')) from dual +END +INPUT +select insert(_ucs2 0x006100620063,10,2,_ucs2 0x006400650066); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select *, MATCH(a,b) AGAINST("support collections" IN BOOLEAN MODE) as x from t1; +END +OUTPUT +select *, match(a, b) against ('support collections' in boolean mode) as x from t1 +END +INPUT +select mysqltest.t1.* from MYSQLTEST.t1; +END +OUTPUT +select mysqltest.t1.* from MYSQLTEST.t1 +END +INPUT +select count(*) from t1 where match a against ('aaa*' in boolean mode); +END +ERROR +syntax error at position 38 near 'a' +END +INPUT +select from t1 where field < '2006-11-06 04:08:36.0'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 'A' like 'a' collate sjis_bin; +END +OUTPUT +select 'A' like 'a' collate sjis_bin from dual +END +INPUT +select strcmp(_koi8r'a' COLLATE koi8r_bin, _koi8r'A'); +END +ERROR +syntax error at position 32 near 'COLLATE' +END +INPUT +select case 1/0 when "a" then "true" else "false" END; +END +OUTPUT +select case 1 / 0 when 'a' then 'true' else 'false' end from dual +END +INPUT +select from t1 where soundex(a) = soundex('test'); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where word='ae'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where a=lpad('xxx',10,' '); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_croatian_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_croatian_ci +END +INPUT +select column_name from information_schema.columns where table_schema='test' and table_name='t2'; +END +OUTPUT +select column_name from information_schema.`columns` where table_schema = 'test' and table_name = 't2' +END +INPUT +select if(1,st,st) s from t1 order by s; +END +OUTPUT +select if(1, st, st) as s from t1 order by s asc +END +INPUT +select trim('xyz' from null) as "must_be_null"; +END +ERROR +syntax error at position 23 near 'from' +END +INPUT +select a.*, count(b.id) as c from t2 a left join t3 b on a.id=b.order_id group by a.id, a.description having (a.description is not null) and (c=0); +END +OUTPUT +select a.*, count(b.id) as c from t2 as a left join t3 as b on a.id = b.order_id group by a.id, a.description having a.description is not null and c = 0 +END +INPUT +select 'mood' sounds like 'mud'; +END +ERROR +syntax error at position 26 near 'like' +END +INPUT +select min(a1), max(a1) from t1 where a1 between 'A' and 'P'; +END +OUTPUT +select min(a1), max(a1) from t1 where a1 between 'A' and 'P' +END +INPUT +select elt(2,1),field(NULL,"a","b","c"); +END +OUTPUT +select elt(2, 1), field(null, 'a', 'b', 'c') from dual +END +INPUT +select charset(null), collation(null), coercibility(null); +END +OUTPUT +select charset(null), collation(null), coercibility(null) from dual +END +INPUT +select from t2 where MATCH inhalt AGAINST ('foobar'); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select st_within(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_within(st_union(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select collation(group_concat(a)) from t1; +END +OUTPUT +select collation(group_concat(a)) from t1 +END +INPUT +select release_lock("test_lock2"); +END +OUTPUT +select release_lock('test_lock2') from dual +END +INPUT +select from information_schema.table_privileges order by grantee; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select distinct char(a) from t1; +END +OUTPUT +select distinct char(a) from t1 +END +INPUT +select group_concat(distinct a, c) from t1; +END +OUTPUT +select group_concat(distinct a, c) from t1 +END +INPUT +select from t1 where a=869751 or a=736494; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select min(name),min(concat("*",name,"*")),max(name),max(concat("*",name,"*")) from t2; +END +OUTPUT +select min(`name`), min(concat('*', `name`, '*')), max(`name`), max(concat('*', `name`, '*')) from t2 +END +INPUT +select lower(a),lower(b) from t1; +END +OUTPUT +select lower(a), lower(b) from t1 +END +INPUT +select 'a' union select concat('a', -0); +END +OUTPUT +(select 'a' from dual) union (select concat('a', -0) from dual) +END +INPUT +select null sounds like null; +END +ERROR +syntax error at position 24 near 'like' +END +INPUT +select locate(_utf8mb4 0xD091, _utf8mb4 0xD0B0D0B1D0B2); +END +OUTPUT +select locate(_utf8mb4 0xD091, _utf8mb4 0xD0B0D0B1D0B2) from dual +END +INPUT +select st_equals(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_equals(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_union(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select cast(_latin1'ab' AS char) as c1, cast(_latin1'a ' AS char) as c2, cast(_latin1'abc' AS char(2)) as c3, cast(_latin1'a ' AS char(2)) as c4, hex(cast(_latin1'a' AS char(2))) as c5; +END +OUTPUT +select convert(_latin1 'ab', char) as c1, convert(_latin1 'a ', char) as c2, convert(_latin1 'abc', char(2)) as c3, convert(_latin1 'a ', char(2)) as c4, hex(convert(_latin1 'a', char(2))) as c5 from dual +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_danish_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_danish_ci +END +INPUT +select (ST_asWKT(ST_geomfromwkb((0x010100000000000000000024400000000000002440)))); +END +OUTPUT +select ST_asWKT(ST_geomfromwkb(0x010100000000000000000024400000000000002440)) from dual +END +INPUT +select right('hello', 18446744073709551617); +END +OUTPUT +select right('hello', 18446744073709551617) from dual +END +INPUT +select timestampdiff(year,'1999-09-11','2001-9-11'); +END +OUTPUT +select timestampdiff(year, '1999-09-11', '2001-9-11') from dual +END +INPUT +select Fld1, max(Fld2) from t1 group by Fld1 having variance(Fld2) is not null; +END +OUTPUT +select Fld1, max(Fld2) from t1 group by Fld1 having variance(Fld2) is not null +END +INPUT +select locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D091D0B2); +END +OUTPUT +select locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D091D0B2) from dual +END +INPUT +select strcmp(date_format(date_sub(localtimestamp(), interval 3 hour),"%T"), utc_time())=0; +END +OUTPUT +select strcmp(date_format(date_sub(localtimestamp(), interval 3 hour), '%T'), utc_time()) = 0 from dual +END +INPUT +select version()>=_latin1"3.23.29"; +END +OUTPUT +select version() >= _latin1 '3.23.29' from dual +END +INPUT +select hex(weight_string(_utf32 0x10000)); +END +ERROR +syntax error at position 40 near '0x10000' +END +INPUT +select a from t1 group by b; +END +OUTPUT +select a from t1 group by b +END +INPUT +select from t2 natural join t1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a, left(a,1) as b from t1; +END +OUTPUT +select a, left(a, 1) as b from t1 +END +INPUT +select v2a.* from v1a natural join v2a; +END +OUTPUT +select v2a.* from v1a natural join v2a +END +INPUT +select SQL_BUFFER_RESULT from t1 WHERE (SEQ = 1); +END +OUTPUT +select SQL_BUFFER_RESULT from t1 where SEQ = 1 +END +INPUT +select i, count(*), std(s1/s2) from bug22555 group by i order by i; +END +OUTPUT +select i, count(*), std(s1 / s2) from bug22555 group by i order by i asc +END +INPUT +select from v1 group by id limit 1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select concat('monty',' was here ','again'),length('hello'),char(ascii('h')),ord('h'); +END +OUTPUT +select concat('monty', ' was here ', 'again'), length('hello'), char(ascii('h')), ord('h') from dual +END +INPUT +select t1.*, t2.*, t3.*, t4.* from (t1 natural join t2) natural join (t3 natural join t4); +END +OUTPUT +select t1.*, t2.*, t3.*, t4.* from (t1 natural join t2) natural join (t3 natural join t4) +END +INPUT +select s1 as before_delete_bin from t1 where s1 like 'ペテ%'; +END +OUTPUT +select s1 as before_delete_bin from t1 where s1 like 'ペテ%' +END +INPUT +select from t1 where MATCH(a,b) AGAINST ("indexes" IN BOOLEAN MODE WITH QUERY EXPANSION); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 1 from (select 1 from test.t1) a; +END +OUTPUT +select 1 from (select 1 from test.t1) as a +END +INPUT +select from (t1 join t2 using (b)) natural join (t3 join t4 using (c)); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(char(1 using utf8)); +END +ERROR +syntax error at position 24 near 'using' +END +INPUT +select col1 as count_col1,col2 from t1 as tmp1 group by col1,col2 having count_col1 = 10; +END +OUTPUT +select col1 as count_col1, col2 from t1 as tmp1 group by col1, col2 having count_col1 = 10 +END +INPUT +select cast(_koi8r'����' as char character set cp1251); +END +ERROR +syntax error at position 33 near '����' +END +INPUT +select timestampdiff(month,'2005-09-11','2003-09-11'); +END +OUTPUT +select timestampdiff(month, '2005-09-11', '2003-09-11') from dual +END +INPUT +select from sakila.film_text where film_id = 984; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select cast(pow(2,63) as signed) as pp; +END +OUTPUT +select convert(pow(2, 63), signed) as pp from dual +END +INPUT +select concat(2,3); +END +OUTPUT +select concat(2, 3) from dual +END +INPUT +select from t1 where text1='teststring' or text1 like 'teststring_%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select date_format('1998-12-31','%x-%v'),date_format('1999-01-01','%x-%v'); +END +OUTPUT +select date_format('1998-12-31', '%x-%v'), date_format('1999-01-01', '%x-%v') from dual +END +INPUT +select find_in_set(f1,f1) as a from t1,(select find_in_set(f1,f1) as b from t1) a; +END +OUTPUT +select find_in_set(f1, f1) as a from t1, (select find_in_set(f1, f1) as b from t1) as a +END +INPUT +select group_concat(hex(c1) order by hex(c1)) from t1 group by c1; +END +OUTPUT +select group_concat(hex(c1) order by hex(c1) asc) from t1 group by c1 +END +INPUT +select mbrtouches(ST_GeomFromText("linestring(3 2, 4 2)"), ST_GeomFromText("polygon((0 0, 3 0, 3 3, 0 3, 0 0))")); +END +OUTPUT +select mbrtouches(ST_GeomFromText('linestring(3 2, 4 2)'), ST_GeomFromText('polygon((0 0, 3 0, 3 3, 0 3, 0 0))')) from dual +END +INPUT +select round(1.1e1, 4294967295), truncate(1.1e1, 4294967295); +END +OUTPUT +select round(1.1e1, 4294967295), truncate(1.1e1, 4294967295) from dual +END +INPUT +select from t1 where i = 3|||| show status like 'Slow_queries'|||| drop table t1|||| delimiter; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*) from t1 where match a against ('aaaxxx aaayyy aaazzz'); +END +ERROR +syntax error at position 38 near 'a' +END +INPUT +select a.f1 as a, b.f2 as b, a.f1 > b.f2 as gt, a.f1 < b.f2 as lt, a.f1<=>b.f2 as eq from t1 a, t1 b; +END +OUTPUT +select a.f1 as a, b.f2 as b, a.f1 > b.f2 as gt, a.f1 < b.f2 as lt, a.f1 <=> b.f2 as eq from t1 as a, t1 as b +END +INPUT +select FIND_IN_SET(_latin1'B',_latin2'a,b,c,d'); +END +OUTPUT +select FIND_IN_SET(_latin1 'B', _latin2 as `a,b,c,d`) from dual +END +INPUT +select date,format,concat(str_to_date(date, format),'') as con from t1; +END +OUTPUT +select `date`, `format`, concat(str_to_date(`date`, `format`), '') as con from t1 +END +INPUT +select hex(cast('a' as char(2) binary)); +END +ERROR +syntax error at position 38 near 'binary' +END +INPUT +select i, count(*), round(std(o1/o2), 16) from bug22555 group by i order by i; +END +OUTPUT +select i, count(*), round(std(o1 / o2), 16) from bug22555 group by i order by i asc +END +INPUT +select date_format("1997-01-02", concat("%M %W %D ","%Y %y %m %d %h %i %s %w")); +END +OUTPUT +select date_format('1997-01-02', concat('%M %W %D ', '%Y %y %m %d %h %i %s %w')) from dual +END +INPUT +select from t1 where a=concat(_koi8r'����'); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select id, sum(qty) as sqty from t1 group by id having sqty>2 and count(qty)>1; +END +OUTPUT +select id, sum(qty) as sqty from t1 group by id having sqty > 2 and count(qty) > 1 +END +INPUT +select if( @stamp1 = @stamp2, "correct", "wrong"); +END +OUTPUT +select if(@stamp1 = @stamp2, 'correct', 'wrong') from dual +END +INPUT +select distinct b from t3 group by a order by 1; +END +OUTPUT +select distinct b from t3 group by a order by 1 asc +END +INPUT +select 1, min(1) from t1m where a=99; +END +OUTPUT +select 1, min(1) from t1m where a = 99 +END +INPUT +select timestampdiff(month,'2004-09-11','2007-09-11'); +END +OUTPUT +select timestampdiff(month, '2004-09-11', '2007-09-11') from dual +END +INPUT +select min(7) from t2m join t1m; +END +OUTPUT +select min(7) from t2m join t1m +END +INPUT +select 'events_logs_tests' as outside_event; +END +OUTPUT +select 'events_logs_tests' as outside_event from dual +END +INPUT +select 1, max(1) from t1m where a=99; +END +OUTPUT +select 1, max(1) from t1m where a = 99 +END +INPUT +select timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002"); +END +OUTPUT +select timediff('1997-12-30 23:59:59.000001', '1997-12-31 23:59:59.000002') from dual +END +INPUT +select hex(convert(_eucjpms 0xA5FE41 using ucs2)); +END +ERROR +syntax error at position 37 near '0xA5FE41' +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_icelandic_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_icelandic_ci +END +INPUT +select hex(substr(_utf16 0x00e400e5D800DC00,-1)); +END +ERROR +syntax error at position 44 near '0x00e400e5D800DC00' +END +INPUT +select hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235)))); +END +OUTPUT +select hex(quote(concat(char(224), char(227), char(230), char(231), char(232), char(234), char(235)))) from dual +END +INPUT +select s1 as after_delete_general_ci from t1 where s1 like 'ペテ%'; +END +OUTPUT +select s1 as after_delete_general_ci from t1 where s1 like 'ペテ%' +END +INPUT +select ST_astext(ST_UNION(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)'))); +END +OUTPUT +select ST_astext(ST_UNION(ST_GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), ST_GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)'))) from dual +END +INPUT +select substring_index('.tcx.se','.',-2),substring_index('.tcx.se','.tcx',-1); +END +OUTPUT +select substring_index('.tcx.se', '.', -2), substring_index('.tcx.se', '.tcx', -1) from dual +END +INPUT +select a1,min(c),max(c) from t1 where a1 >= 'b' group by a1,a2,b; +END +OUTPUT +select a1, min(c), max(c) from t1 where a1 >= 'b' group by a1, a2, b +END +INPUT +select a1,a2,b,min(c),max(c) from t2 where (a1 >= 'c' or a2 < 'b') and (c > 'b111') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t2 where (a1 >= 'c' or a2 < 'b') and c > 'b111' group by a1, a2, b +END +INPUT +select extract(SECOND FROM "1999-01-02 10:11:12"); +END +ERROR +syntax error at position 27 near 'FROM' +END +INPUT +select id-5,facility from t1 order by "id-5"; +END +OUTPUT +select id - 5, facility from t1 order by 'id-5' asc +END +INPUT +select insert('hello', -18446744073709551617, 1, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select 'a' like 'a'; +END +OUTPUT +select 'a' like 'a' from dual +END +INPUT +select col1,sum(col1),max(col1),min(col1) from t1 group by col1; +END +OUTPUT +select col1, sum(col1), max(col1), min(col1) from t1 group by col1 +END +INPUT +select count(*) from t1 where match a against ('aaazzz'); +END +ERROR +syntax error at position 38 near 'a' +END +INPUT +select round(4, cast(-2 as unsigned)), round(4, 18446744073709551614), round(4, -2); +END +OUTPUT +select round(4, convert(-2, unsigned)), round(4, 18446744073709551614), round(4, -2) from dual +END +INPUT +select cast(sum(distinct df) as signed) from t1; +END +OUTPUT +select convert(sum(distinct df), signed) from t1 +END +INPUT +select @@optimizer_prune_level; +END +OUTPUT +select @@optimizer_prune_level from dual +END +INPUT +select count(*) from t1 where match a against ('aaaxxx aaayyy aaazzz' in boolean mode); +END +ERROR +syntax error at position 38 near 'a' +END +INPUT +select concat(c1, repeat('xx', 250)) as cc from t2 group by cc order by 1; +END +OUTPUT +select concat(c1, repeat('xx', 250)) as cc from t2 group by cc order by 1 asc +END +INPUT +select 1 and 2 between 2 and 10, 2 between 2 and 10 and 1; +END +OUTPUT +select 1 and 2 between 2 and 10, 2 between 2 and 10 and 1 from dual +END +INPUT +select count(distinct (f1+1)) from t1 group by f1 with rollup; +END +ERROR +syntax error at position 55 near 'with' +END +INPUT +select -9223372036854775808; +END +OUTPUT +select -9223372036854775808 from dual +END +INPUT +select 1 from (select 2) a order by 0; +END +OUTPUT +select 1 from (select 2 from dual) as a order by 0 asc +END +INPUT +select 0xac14aa84f000d276d66ed9 like '%-107%'; +END +OUTPUT +select 0xac14aa84f000d276d66ed9 like '%-107%' from dual +END +INPUT +select 12%NULL as 'NULL'; +END +OUTPUT +select 12 % null as `NULL` from dual +END +INPUT +select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 < 'SEA'; +END +OUTPUT +select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 < 'SEA' +END +INPUT +select from t1 where lower(b)='bbb'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (c > 'b111') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 where (a1 >= 'c' or a2 < 'b') and c > 'b111' group by a1, a2, b +END +INPUT +select (case 1/0 when "a" then "true" END) + 0.0; +END +OUTPUT +select case 1 / 0 when 'a' then 'true' end + 0.0 from dual +END +INPUT +select from t1 where a like 'c%'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where MATCH a,b AGAINST ('"Now sUPPort"' IN BOOLEAN MODE); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select sum(all a),count(all a),avg(all a),std(all a),variance(all a),bit_or(all a),bit_and(all a),min(all a),max(all a),min(all c),max(all c) from t1; +END +ERROR +syntax error at position 15 near 'all' +END +INPUT +select BIN(a) from t1; +END +OUTPUT +select BIN(a) from t1 +END +INPUT +select locate(c1,'�'), locate('�',c1) from t1; +END +OUTPUT +select locate(c1, '�'), locate('�', c1) from t1 +END +INPUT +select ST_astext(ST_PolyFromWKB(ST_AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(1, 0), Point(0, 0)))))); +END +OUTPUT +select ST_astext(ST_PolyFromWKB(ST_AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(1, 0), Point(0, 0)))))) from dual +END +INPUT +select count(*) from `load`; +END +OUTPUT +select count(*) from `load` +END +INPUT +select get_lock('test_bug16407', 60); +END +OUTPUT +select get_lock('test_bug16407', 60) from dual +END +INPUT +select date_add(date,INTERVAL "1" QUARTER) from t1; +END +OUTPUT +select date_add(`date`, interval '1' QUARTER) from t1 +END +INPUT +select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); +END +OUTPUT +select concat('<', user(), '>'), concat('<', current_user(), '>'), database() from dual +END +INPUT +select month("1997-01-02"),year("98-02-03"),dayofyear("1997-12-31"); +END +OUTPUT +select month('1997-01-02'), year('98-02-03'), dayofyear('1997-12-31') from dual +END +INPUT +select @topic5_id:= 10105; +END +ERROR +syntax error at position 19 near ':' +END +INPUT +select max(b) from t1 where a = 2; +END +OUTPUT +select max(b) from t1 where a = 2 +END +INPUT +select from t1 where length(s1)=1 and s1='oe'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select c,table_name from v1 left join information_schema.TABLES v2 on (v1.c=v2.table_name) where v1.c rlike "t[1-5]{1}$" order by c; +END +OUTPUT +select c, table_name from v1 left join information_schema.`TABLES` as v2 on v1.c = v2.table_name where v1.c regexp 't[1-5]{1}$' order by c asc +END +INPUT +select row_count(); +END +OUTPUT +select row_count() from dual +END +INPUT +select 1/*!000002*/; +END +ERROR +syntax error at position 20 near '2' +END +INPUT +select 1, min(a) from t1i where a=99; +END +OUTPUT +select 1, min(a) from t1i where a = 99 +END +INPUT +select 0 -9223372036854775808 as result; +END +OUTPUT +select 0 - 9223372036854775808 as result from dual +END +INPUT +select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd' COLLATE latin1_bin,2); +END +OUTPUT +select SUBSTRING_INDEX(_latin1 'abcdabcdabcd', _latin1 'd' collate latin1_bin, 2) from dual +END +INPUT +select insert('hello', 1, 4294967297, 'hi'); +END +ERROR +syntax error at position 14 near 'insert' +END +INPUT +select last_day('2005-00-01'); +END +OUTPUT +select last_day('2005-00-01') from dual +END +INPUT +select @ujis3 = CONVERT(@utf83 USING ujis); +END +OUTPUT +select @ujis3 = convert(@utf83 using ujis) from dual +END +INPUT +select 1+1,"a",count(*) from t1 where foo in (2); +END +OUTPUT +select 1 + 1, 'a', count(*) from t1 where foo in (2) +END +INPUT +select distinct a from t1 where a >= '1' order by a desc; +END +OUTPUT +select distinct a from t1 where a >= '1' order by a desc +END +INPUT +select char(53647 using utf8); +END +ERROR +syntax error at position 24 near 'using' +END +INPUT +select 'A' like 'a' collate utf8mb4_bin; +END +OUTPUT +select 'A' like 'a' collate utf8mb4_bin from dual +END +INPUT +select subtime("01:00:00.999999", "02:00:00.999998"); +END +OUTPUT +select subtime('01:00:00.999999', '02:00:00.999998') from dual +END +INPUT +select 1, ST_Intersects(ST_GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), ST_GeomFromText('POINT(10 10)')); +END +OUTPUT +select 1, ST_Intersects(ST_GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), ST_GeomFromText('POINT(10 10)')) from dual +END +INPUT +select week("0000-00-00"),week(d),week(dt),week(t),week(c) from t1; +END +OUTPUT +select week('0000-00-00'), week(d), week(dt), week(t), week(c) from t1 +END +INPUT +select ST_astext(st_difference(ST_GeomFromText('multipoint(2 2, 3 3)'), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))); +END +OUTPUT +select ST_astext(st_difference(ST_GeomFromText('multipoint(2 2, 3 3)'), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)')))) from dual +END +INPUT +select from v1b; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select command_type, argument from mysql.general_log where thread_id = @thread_id; +END +OUTPUT +select command_type, argument from mysql.general_log where thread_id = @thread_id +END +INPUT +select from t1 where a like binary "%�%"; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select a1,a2,b,min(c),max(c) from t1 where (c > 'b111') and (c <= 'g112') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 where c > 'b111' and c <= 'g112' group by a1, a2, b +END +INPUT +select date_sub("1998-01-01 00:00:00",INTERVAL 1 MINUTE); +END +OUTPUT +select date_sub('1998-01-01 00:00:00', interval 1 MINUTE) from dual +END +INPUT +select length(repeat("a",65500)),length(concat(repeat("a",32000),repeat("a",32000))),length(replace("aaaaa","a",concat(repeat("a",10000)))),length(insert(repeat("a",40000),1,30000,repeat("b",50000))); +END +ERROR +syntax error at position 154 near 'insert' +END +INPUT +select date_add(date,INTERVAL 1 HOUR) from t1; +END +OUTPUT +select date_add(`date`, interval 1 HOUR) from t1 +END +INPUT +select hex(weight_string(ch)) w, name from t1 order by concat(ch); +END +OUTPUT +select hex(weight_string(ch)) as w, `name` from t1 order by concat(ch) asc +END +INPUT +select 10+'a'; +END +OUTPUT +select 10 + 'a' from dual +END +INPUT +select cast(concat('184467440','73709551615') as signed); +END +OUTPUT +select convert(concat('184467440', '73709551615'), signed) from dual +END +INPUT +select from t3 left join (t2 outr2 join t2 outr join t1) on (outr.pk = t3.pk) and (t1.col_int_key = t3.pk) and isnull(t1.col_date_key) and (outr2.pk <> t3.pk); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_roman_ci; +END +OUTPUT +select group_concat(c1 order by c1 asc) from t1 group by c1 collate utf8_roman_ci +END +INPUT +select distinct s,n1,vs from t1; +END +OUTPUT +select distinct s, n1, vs from t1 +END +INPUT +select 1 from t1 where match(a) against ('water' in boolean mode) and b>='2008-08-01'; +END +OUTPUT +select 1 from t1 where match(a) against ('water' in boolean mode) and b >= '2008-08-01' +END +INPUT +select a1,a2,b,min(c),max(c) from t1 where (c between 'b111' and 'g112') or (c between 'd000' and 'i110') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 where c between 'b111' and 'g112' or c between 'd000' and 'i110' group by a1, a2, b +END +INPUT +select min(big),max(big),max(big)-1 from t1 group by a; +END +OUTPUT +select min(big), max(big), max(big) - 1 from t1 group by a +END +INPUT +select SCHEMA_NAME from information_schema.schemata where schema_name='имя_базы_в_кодировке_утф8_длиной_больше_чем_45'; +END +OUTPUT +select SCHEMA_NAME from information_schema.schemata where schema_name = 'имя_базы_в_кодировке_утф8_длиной_больше_чем_45' +END +INPUT +select char(0xd18f using utf8mb4); +END +ERROR +syntax error at position 25 near 'using' +END +INPUT +select st_within(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))); +END +OUTPUT +select st_within(st_intersection(ST_GeomFromText('point(1 1)'), ST_GeomFromText('multipoint(2 2, 3 3)')), st_intersection(ST_GeomFromText('point(0 0)'), ST_GeomFromText('point(1 1)'))) from dual +END +INPUT +select distinct a,c from t1 group by b,c,a having a > 2 order by a desc; +END +OUTPUT +select distinct a, c from t1 group by b, c, a having a > 2 order by a desc +END +INPUT +select count(*) from t1 where name='Matt'; +END +OUTPUT +select count(*) from t1 where `name` = 'Matt' +END +INPUT +select max(t2.a1), max(t1.a1) from t1, t2 where t2.a2=9; +END +OUTPUT +select max(t2.a1), max(t1.a1) from t1, t2 where t2.a2 = 9 +END +INPUT +select unix_timestamp('1969-12-01 19:00:01'); +END +OUTPUT +select unix_timestamp('1969-12-01 19:00:01') from dual +END +INPUT +select timestampdiff(month,'2004-09-11','2005-09-11'); +END +OUTPUT +select timestampdiff(month, '2004-09-11', '2005-09-11') from dual +END +INPUT +select "aba" regexp concat("^","a"); +END +OUTPUT +select 'aba' regexp concat('^', 'a') from dual +END +INPUT +select substring('hello', 1, 18446744073709551617); +END +OUTPUT +select substr('hello', 1, 18446744073709551617) from dual +END +INPUT +select ST_Intersects(ST_GeomFromText('LINESTRING(15 10,10 0)'),ST_GeomFromText('POINT(15 10)')) as result; +END +OUTPUT +select ST_Intersects(ST_GeomFromText('LINESTRING(15 10,10 0)'), ST_GeomFromText('POINT(15 10)')) as result from dual +END +INPUT +select date_add(date,INTERVAL 1 SECOND) from t1; +END +OUTPUT +select date_add(`date`, interval 1 SECOND) from t1 +END +INPUT +select from t1 order by i1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t5 /bin /boot /cdrom /dev /etc /home /lib /lib32 /lib64 /libx32 /lost+found /media /mnt /opt /proc /root /run /sbin /snap /srv /swapfile /sys /tmp /usr /var must be (1),(1) */; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select concat("-",a,"-",b,"-") from t1 ignore index (a) where a="hello "; +END +OUTPUT +select concat('-', a, '-', b, '-') from t1 ignore index (a) where a = 'hello ' +END +INPUT +select *, f1 = f2 from t1; +END +OUTPUT +select *, f1 = f2 from t1 +END +INPUT +select @x; +END +OUTPUT +select @x from dual +END +INPUT +select f1(1); +END +OUTPUT +select f1(1) from dual +END +INPUT +select from t1 where a > 5 and not(a > 10); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select _ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%'); +END +ERROR +syntax error at position 24 near '0xa1a2a1a3' +END +INPUT +select substring_index('aaaaaaaaa1','aa',2); +END +OUTPUT +select substring_index('aaaaaaaaa1', 'aa', 2) from dual +END +INPUT +select fld3 from t2 order by fld3 desc limit 10; +END +OUTPUT +select fld3 from t2 order by fld3 desc limit 10 +END +INPUT +select format(atan(-2, 2), 6); +END +OUTPUT +select format(atan(-2, 2), 6) from dual +END +INPUT +select hex(-29223372036854775809) as hex_signed, hex(cast(-29223372036854775809 as unsigned)) as hex_unsigned; +END +OUTPUT +select hex(-29223372036854775809) as hex_signed, hex(convert(-29223372036854775809, unsigned)) as hex_unsigned from dual +END +INPUT +select format(pi(), (1+1)); +END +OUTPUT +select format(pi(), 1 + 1) from dual +END +INPUT +select str_to_date(concat('15-01-2001',' 2:59:58.999'), concat('%d-%m-%Y',' ','%H:%i:%s.%f')); +END +OUTPUT +select str_to_date(concat('15-01-2001', ' 2:59:58.999'), concat('%d-%m-%Y', ' ', '%H:%i:%s.%f')) from dual +END +INPUT +select cast('18446744073709551615' as unsigned); +END +OUTPUT +select convert('18446744073709551615', unsigned) from dual +END +INPUT +select from t1 where s1 > 'd' and s1 = 'CH'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select benchmark(100, (select avg(a) from table_26093)); +END +OUTPUT +select benchmark(100, (select avg(a) from table_26093)) from dual +END +INPUT +select date(left(f1+0,8)) from t1 group by 1; +END +OUTPUT +select date(left(f1 + 0, 8)) from t1 group by 1 +END +INPUT +select @@GLOBAL.expire_logs_days into @save_expire_logs_days; +END +ERROR +syntax error at position 61 near 'save_expire_logs_days' +END +INPUT +select from t1 where a=if(b<10,_ucs2 0x0062,_ucs2 0x00C0); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select distinct left(name,1) as name from t1; +END +OUTPUT +select distinct left(`name`, 1) as `name` from t1 +END +INPUT +select @@character_set_filesystem; +END +OUTPUT +select @@character_set_filesystem from dual +END +INPUT +select ctime, hour(ctime) from t1; +END +OUTPUT +select ctime, hour(ctime) from t1 +END +INPUT +select from t1 order by (oct(a)); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select hex(char(0x010203 using utf32)); +END +ERROR +syntax error at position 31 near 'using' +END +INPUT +select ST_geometryfromtext(b) IS NULL, ST_geometryfromwkb(b) IS NULL, ST_astext(b) IS NULL, ST_aswkb(b) IS NULL, ST_geometrytype(b) IS NULL, ST_centroid(b) IS NULL, ST_envelope(b) IS NULL, ST_startpoint(b) IS NULL, ST_endpoint(b) IS NULL, ST_exteriorring(b) IS NULL, ST_pointn(b, 1) IS NULL, ST_geometryn(b, 1) IS NULL, ST_interiorringn(b, 1) IS NULL, multipoint(b) IS NULL, ST_isempty(b) IS NULL, ST_issimple(b) IS NULL, ST_isclosed(b) IS NULL, ST_dimension(b) IS NULL, ST_numgeometries(b) IS NULL, ST_numinteriorrings(b) IS NULL, ST_numpoints(b) IS NULL, ST_area(b) IS NULL, ST_length(b) IS NULL, ST_srid(b) IS NULL, ST_x(b) IS NULL, ST_y(b) IS NULL from t1; +END +OUTPUT +select ST_geometryfromtext(b) is null, ST_geometryfromwkb(b) is null, ST_astext(b) is null, ST_aswkb(b) is null, ST_geometrytype(b) is null, ST_centroid(b) is null, ST_envelope(b) is null, ST_startpoint(b) is null, ST_endpoint(b) is null, ST_exteriorring(b) is null, ST_pointn(b, 1) is null, ST_geometryn(b, 1) is null, ST_interiorringn(b, 1) is null, multipoint(b) is null, ST_isempty(b) is null, ST_issimple(b) is null, ST_isclosed(b) is null, ST_dimension(b) is null, ST_numgeometries(b) is null, ST_numinteriorrings(b) is null, ST_numpoints(b) is null, ST_area(b) is null, ST_length(b) is null, ST_srid(b) is null, ST_x(b) is null, ST_y(b) is null from t1 +END +INPUT +select inet6_ntoa(null),inet6_aton(null); +END +OUTPUT +select inet6_ntoa(null), inet6_aton(null) from dual +END +INPUT +select timestampdiff(SQL_TSI_MINUTE, '2001-02-01 12:59:59', '2001-05-01 12:58:59') as a; +END +OUTPUT +select timestampdiff(SQL_TSI_MINUTE, '2001-02-01 12:59:59', '2001-05-01 12:58:59') as a from dual +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL 100000 SECOND); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval 100000 SECOND) from dual +END +INPUT +select n,d,unix_timestamp(t) from t2; +END +OUTPUT +select n, d, unix_timestamp(t) from t2 +END +INPUT +select date_add('1998-01-30',Interval '2:1' year_month); +END +OUTPUT +select date_add('1998-01-30', interval '2:1' year_month) from dual +END +INPUT +select substring('abc', cast(2 as unsigned int)); +END +ERROR +syntax error at position 47 near 'int' +END +INPUT +select length(a) from t1; +END +OUTPUT +select length(a) from t1 +END +INPUT +select min(a) from t1 group by inet_ntoa(a); +END +OUTPUT +select min(a) from t1 group by inet_ntoa(a) +END +INPUT +select _latin1'B' between _latin1'a' and _latin2'b'; +END +OUTPUT +select _latin1 'B' between _latin1 'a' and _latin2 as b from dual +END +INPUT +select a1,a2,b, max(c) from t2 where (c < 'a0') or (c > 'b1') group by a1,a2,b; +END +OUTPUT +select a1, a2, b, max(c) from t2 where c < 'a0' or c > 'b1' group by a1, a2, b +END +INPUT +select count(*) from information_schema.events; +END +OUTPUT +select count(*) from information_schema.events +END +INPUT +select var_samp(s) as 'null', var_pop(s) as 'null' from bug22555; +END +OUTPUT +select var_samp(s) as `null`, var_pop(s) as `null` from bug22555 +END +INPUT +select get_format(TIME, 'internal') as a; +END +OUTPUT +select get_format(`TIME`, 'internal') as a from dual +END +INPUT +select repeat('hello', 4294967295); +END +OUTPUT +select repeat('hello', 4294967295) from dual +END +INPUT +select from t1 where word like binary 0xDF; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select count(*), min(7), max(7) from t2m, t1i; +END +OUTPUT +select count(*), min(7), max(7) from t2m, t1i +END +INPUT +select from t1 left join t2 on t1.a=t2.a where not (t2.a <=> t1.a); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select 'aa' like 'a%'; +END +OUTPUT +select 'aa' like 'a%' from dual +END +INPUT +select ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 -14,13 -8),(-5 -3,8 7),(-6 18,17 -11,-12 19,19 5),(16 11,9 -5),(17 -5,5 10),(-4 17,6 4),(-12 15,17 13,-18 11,15 10),(7 0,2 -16,-18 13,-6 4),(-17 -6,-6 -7,1 4,-18 0)),MULTILINESTRING((-11 -2,17 -14),(18 -12,18 -8),(-13 -16,9 16,9 -10,-7 20),(-14 -5,10 -9,4 1,17 -8),(-9 -4,-2 -12,9 -13,-5 4),(15 17,13 20)))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((-13 -18,-16 0),(17 11,-1 11,-18 -19,-4 -18),(-8 -8,-15 -13,3 -18,6 8)),LINESTRING(5 16,0 -9,-6 4,-15 17))'))) as result; +END +OUTPUT +select ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 -14,13 -8),(-5 -3,8 7),(-6 18,17 -11,-12 19,19 5),(16 11,9 -5),(17 -5,5 10),(-4 17,6 4),(-12 15,17 13,-18 11,15 10),(7 0,2 -16,-18 13,-6 4),(-17 -6,-6 -7,1 4,-18 0)),MULTILINESTRING((-11 -2,17 -14),(18 -12,18 -8),(-13 -16,9 16,9 -10,-7 20),(-14 -5,10 -9,4 1,17 -8),(-9 -4,-2 -12,9 -13,-5 4),(15 17,13 20)))'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((-13 -18,-16 0),(17 11,-1 11,-18 -19,-4 -18),(-8 -8,-15 -13,3 -18,6 8)),LINESTRING(5 16,0 -9,-6 4,-15 17))'))) as result from dual +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_esperanto_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf32_esperanto_ci +END +INPUT +select hex(29223372036854775809) as hex_signed, hex(cast(29223372036854775809 as unsigned)) as hex_unsigned; +END +OUTPUT +select hex(29223372036854775809) as hex_signed, hex(convert(29223372036854775809, unsigned)) as hex_unsigned from dual +END +INPUT +select object_id, ST_geometrytype(geo), ST_ISSIMPLE(GEO), ST_ASTEXT(ST_centroid(geo)) from t1 where object_id=85998; +END +OUTPUT +select object_id, ST_geometrytype(geo), ST_ISSIMPLE(GEO), ST_ASTEXT(ST_centroid(geo)) from t1 where object_id = 85998 +END +INPUT +select hex(cast(9007199254740994 as decimal(30,0))); +END +OUTPUT +select hex(convert(9007199254740994, decimal(30, 0))) from dual +END +INPUT +select 98 + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a'); +END +OUTPUT +select 98 + count(distinct a1, a2, b) from t1 where a1 > 'a' and a2 > 'a' +END +INPUT +select left('hello', 4294967297); +END +OUTPUT +select left('hello', 4294967297) from dual +END +INPUT +select count(*) from sakila.film_text; +END +OUTPUT +select count(*) from sakila.film_text +END +INPUT +select date_format("1997-12-31 23:59:59.000002", "%f"); +END +OUTPUT +select date_format('1997-12-31 23:59:59.000002', '%f') from dual +END +INPUT +select domain from t1 where concat('@', trim(leading '.' from concat('.', domain))) = '@test.de'; +END +ERROR +syntax error at position 62 near 'from' +END +INPUT +select from t1 natural left join (t4 natural join t5) where t4.y > 7; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select release_lock("test_lock2_1"); +END +OUTPUT +select release_lock('test_lock2_1') from dual +END +INPUT +select from t1 where misc > 5 and bool is null; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from (select from t3 natural join t4) as t34 natural right join (select from t1 natural join t2) as t12; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t7 where concat(s1 collate latin1_general_ci,s1 collate latin1_swedish_ci) = 'AA'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from (select from t1 union all select from t1) a; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select coalesce('�',c1), coalesce(null,c1) from t1; +END +OUTPUT +select coalesce('�', c1), coalesce(null, c1) from t1 +END +INPUT +select val, count(*) from t1 group by val; +END +OUTPUT +select val, count(*) from t1 group by val +END +INPUT +select aes_encrypt(NULL,"a"); +END +OUTPUT +select aes_encrypt(null, 'a') from dual +END +INPUT +select FIELD('B','A','B'); +END +OUTPUT +select FIELD('B', 'A', 'B') from dual +END +INPUT +select hex(@utf84:= CONVERT(@ujis4 USING utf8)); +END +ERROR +syntax error at position 19 near ':' +END +INPUT +select (select dt.a from (select 1 as a, t2.a as b from t2 having t1.a) dt where dt.b=t1.a) as subq from t1; +END +OUTPUT +select (select dt.a from (select 1 as a, t2.a as b from t2 having t1.a) as dt where dt.b = t1.a) as subq from t1 +END +INPUT +select hex(unhex("1")), hex(unhex("12")), hex(unhex("123")), hex(unhex("1234")), hex(unhex("12345")), hex(unhex("123456")); +END +OUTPUT +select hex(unhex('1')), hex(unhex('12')), hex(unhex('123')), hex(unhex('1234')), hex(unhex('12345')), hex(unhex('123456')) from dual +END +INPUT +select count(*) from t1; +END +OUTPUT +select count(*) from t1 +END +INPUT +select FROM t4 where fld3='bonfire'; +END +ERROR +syntax error at position 12 near 'FROM' +END +INPUT +select ST_AsText(a) from t1 where MBRContains(ST_GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a) and MBRContains(ST_GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a); +END +OUTPUT +select ST_AsText(a) from t1 where MBRContains(ST_GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a) and MBRContains(ST_GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a) +END +INPUT +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_spanish_ci; +END +OUTPUT +select group_concat(c1 order by binary c1 asc separator '') from t1 group by c1 collate utf16_spanish_ci +END +INPUT +select cast('1.2' as decimal(3,2)); +END +OUTPUT +select convert('1.2', decimal(3, 2)) from dual +END +INPUT +select concat(a,if(b>10,_ucs2 0x0061,_ucs2 0x0062)) from t1; +END +ERROR +syntax error at position 37 near '0x0061' +END +INPUT +select date_add("1997-12-31 23:59:59",INTERVAL 100000 MONTH); +END +OUTPUT +select date_add('1997-12-31 23:59:59', interval 100000 MONTH) from dual +END +INPUT +select from t2 order by name; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select RANDOM_BYTES(0); +END +OUTPUT +select RANDOM_BYTES(0) from dual +END +INPUT +select a1,a2,b,min(c),max(c) from t1 where a1 < 'd' group by a1,a2,b; +END +OUTPUT +select a1, a2, b, min(c), max(c) from t1 where a1 < 'd' group by a1, a2, b +END +INPUT +select t1.a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using (a) left join t1 as t4 using (a) left join t1 as t5 using (a) left join t1 as t6 using (a) left join t1 as t7 using (a) left join t1 as t8 using (a) left join t1 as t9 using (a) left join t1 as t10 using (a) left join t1 as t11 using (a) left join t1 as t12 using (a) left join t1 as t13 using (a) left join t1 as t14 using (a) left join t1 as t15 using (a) left join t1 as t16 using (a) left join t1 as t17 using (a) left join t1 as t18 using (a) left join t1 as t19 using (a) left join t1 as t20 using (a) left join t1 as t21 using (a) left join t1 as t22 using (a) left join t1 as t23 using (a) left join t1 as t24 using (a) left join t1 as t25 using (a) left join t1 as t26 using (a) left join t1 as t27 using (a) left join t1 as t28 using (a) left join t1 as t29 using (a) left join t1 as t30 using (a) left join t1 as t31 using (a); +END +OUTPUT +select t1.a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using (a) left join t1 as t4 using (a) left join t1 as t5 using (a) left join t1 as t6 using (a) left join t1 as t7 using (a) left join t1 as t8 using (a) left join t1 as t9 using (a) left join t1 as t10 using (a) left join t1 as t11 using (a) left join t1 as t12 using (a) left join t1 as t13 using (a) left join t1 as t14 using (a) left join t1 as t15 using (a) left join t1 as t16 using (a) left join t1 as t17 using (a) left join t1 as t18 using (a) left join t1 as t19 using (a) left join t1 as t20 using (a) left join t1 as t21 using (a) left join t1 as t22 using (a) left join t1 as t23 using (a) left join t1 as t24 using (a) left join t1 as t25 using (a) left join t1 as t26 using (a) left join t1 as t27 using (a) left join t1 as t28 using (a) left join t1 as t29 using (a) left join t1 as t30 using (a) left join t1 as t31 using (a) +END +INPUT +select t from t1 where t=0xD0B1D0B1212223D0B1D0B1D0B1D0B1; +END +OUTPUT +select t from t1 where t = 0xD0B1D0B1212223D0B1D0B1D0B1D0B1 +END +INPUT +select cast('18446744073709551616' as unsigned); +END +OUTPUT +select convert('18446744073709551616', unsigned) from dual +END +INPUT +select 5; +END +OUTPUT +select 5 from dual +END +INPUT +select from t1 where not(NULL or a); +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select log(-2,1); +END +OUTPUT +select log(-2, 1) from dual +END +INPUT +select least(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci); +END +ERROR +syntax error at position 54 near 'collate' +END +INPUT +select bar from t1 having instr(group_concat(bar), "test") > 0; +END +OUTPUT +select bar from t1 having instr(group_concat(bar), 'test') > 0 +END +INPUT +select substring_index('the king of the the hill',' the ',-1); +END +OUTPUT +select substring_index('the king of the the hill', ' the ', -1) from dual +END +INPUT +select from t6; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select from t1 where city = 'Durban '; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select max(t1.a1) from t1, t2; +END +OUTPUT +select max(t1.a1) from t1, t2 +END +INPUT +select count(a) from t1 where a = 100; +END +OUTPUT +select count(a) from t1 where a = 100 +END +INPUT +select hex(weight_string('S')); +END +OUTPUT +select hex(weight_string('S')) from dual +END +INPUT +select hex(cast(0x20000000000000 as decimal(30,0)) + 2); +END +OUTPUT +select hex(convert(0x20000000000000, decimal(30, 0)) + 2) from dual +END +INPUT +select f1 from t1 where cast("2006-1-1" as date) between date(f1) and date(f3); +END +OUTPUT +select f1 from t1 where convert('2006-1-1', date) between date(f1) and date(f3) +END +INPUT +select substring('hello', -4294967295, 1); +END +OUTPUT +select substr('hello', -4294967295, 1) from dual +END +INPUT +select from t1 where value <=> value; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select f3 from t1 where f3 between cast("2006-1-1 12:1:1" as datetime) and cast("2006-1-1 12:1:2" as datetime); +END +OUTPUT +select f3 from t1 where f3 between convert('2006-1-1 12:1:1', datetime) and convert('2006-1-1 12:1:2', datetime) +END +INPUT +select from t1 left join t2 on venue_id = entity_id where match(name) against('aberdeen') and dt = '2003-05-23 19:30:00'; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select concat('|', text1, '|') from t1 where text1='teststring '; +END +OUTPUT +select concat('|', text1, '|') from t1 where text1 = 'teststring ' +END +INPUT +select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv; +END +OUTPUT +select Host, Db, `User`, Table_name, Column_name, Column_priv from mysql.columns_priv +END +INPUT +select from t1 group by f1; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select tt.* from (select from t1) as tt order by 1, 2; +END +ERROR +syntax error at position 30 near 'from' +END +INPUT +select @@key_cache_block_size; +END +OUTPUT +select @@key_cache_block_size from dual +END +INPUT +select from `information_schema`.`PARTITIONS` where `TABLE_SCHEMA` = NULL; +END +ERROR +syntax error at position 12 near 'from' +END +INPUT +select space(18446744073709551615); +END +OUTPUT +select space(18446744073709551615) from dual +END +INPUT +select ST_astext(ST_envelope(ST_PolyFromWKB(ST_AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(1, 0), Point(0, 0))))))); +END +OUTPUT +select ST_astext(ST_envelope(ST_PolyFromWKB(ST_AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(1, 0), Point(0, 0))))))) from dual +END From cc41b1f3227f453f99dfa77341b34c5413d75db2 Mon Sep 17 00:00:00 2001 From: ritwizsinha Date: Thu, 16 Sep 2021 17:14:30 +0530 Subject: [PATCH 4/6] Corrected linting Signed-off-by: ritwizsinha --- go/vt/sqlparser/parse_test.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/go/vt/sqlparser/parse_test.go b/go/vt/sqlparser/parse_test.go index 7ac759104cb..93a39773641 100644 --- a/go/vt/sqlparser/parse_test.go +++ b/go/vt/sqlparser/parse_test.go @@ -3520,13 +3520,14 @@ func TestValidSelectCases(t *testing.T) { } type testCase struct { - file string - lineno int - input string - output string - errStr string - comments string + file string + lineno int + input string + output string + errStr string + comments string } + func escapeNewLines(in string) string { return strings.ReplaceAll(in, "\n", "\\n") } @@ -3549,7 +3550,7 @@ func testFile(t *testing.T, filename, tempDir string) { fail = true t.Errorf("File: %s, Line: %d\nDiff:\n%s\n[%s] \n[%s]", filename, tcase.lineno, cmp.Diff(tcase.errStr, err.Error()), tcase.errStr, err.Error()) } - } else { + } else { if err != nil { expected.WriteString(fmt.Sprintf("ERROR\n%s\nEND\n", escapeNewLines(err.Error()))) fail = true @@ -3588,7 +3589,7 @@ func iterateExecFile(name string) (testCaseIterator chan testCase) { r := bufio.NewReader(fd) lineno := 0 - for { + for { input, lineno, _ := parsePartial(r, []string{"INPUT"}, lineno, name) if input == "" && lineno == 0 { break @@ -3600,13 +3601,12 @@ func iterateExecFile(name string) (testCaseIterator chan testCase) { output = "" } testCaseIterator <- testCase{ - file: name, - lineno: lineno, - input: input, - comments: comments, - output: output, - errStr: errStr, - + file: name, + lineno: lineno, + input: input, + comments: comments, + output: output, + errStr: errStr, } comments = "" } From d6085c6bc9ede929c492f73040e329c81c545c0a Mon Sep 17 00:00:00 2001 From: ritwizsinha Date: Thu, 16 Sep 2021 17:19:12 +0530 Subject: [PATCH 5/6] corrected imports order Signed-off-by: ritwizsinha --- go/vt/sqlparser/parse_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/go/vt/sqlparser/parse_test.go b/go/vt/sqlparser/parse_test.go index 93a39773641..4563243da56 100644 --- a/go/vt/sqlparser/parse_test.go +++ b/go/vt/sqlparser/parse_test.go @@ -21,7 +21,6 @@ import ( "bytes" "compress/gzip" "fmt" - "github.com/google/go-cmp/cmp" "io" "io/ioutil" "math/rand" @@ -31,6 +30,8 @@ import ( "sync" "testing" + "github.com/google/go-cmp/cmp" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) From 7cb20f57f0f6def87c74738bc103d576689ce0b4 Mon Sep 17 00:00:00 2001 From: ritwizsinha Date: Thu, 16 Sep 2021 17:43:46 +0530 Subject: [PATCH 6/6] Remove useless print Signed-off-by: ritwizsinha --- go/vt/sqlparser/parse_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/go/vt/sqlparser/parse_test.go b/go/vt/sqlparser/parse_test.go index 4563243da56..adf32a1f5d6 100644 --- a/go/vt/sqlparser/parse_test.go +++ b/go/vt/sqlparser/parse_test.go @@ -3538,7 +3538,6 @@ func testFile(t *testing.T, filename, tempDir string) { fail := false expected := strings.Builder{} for tcase := range iterateExecFile(filename) { - fmt.Println(tcase) t.Run(fmt.Sprintf("%d : %s", tcase.lineno, tcase.comments), func(t *testing.T) { if tcase.output == "" && tcase.errStr == "" { tcase.output = tcase.input