"xxx");
}
/** Tests matching of built-in operator names. */
@Test public void testUnquotedBuiltInFunctionNames() {
final SqlTester mysql = tester
.withUnquotedCasing(Casing.UNCHANGED)
.withQuoting(Quoting.BACK_TICK)
.withCaseSensitive(false);
final SqlTester oracle = tester
.withUnquotedCasing(Casing.TO_UPPER)
.withCaseSensitive(true);
// Built-in functions are always case-insensitive.
oracle.checkQuery("select count(*), sum(deptno), floor(2.5) from dept");
oracle.checkQuery("select COUNT(*), FLOOR(2.5) from dept");
oracle.checkQuery("select cOuNt(*), FlOOr(2.5) from dept");
oracle.checkQuery("select cOuNt (*), FlOOr (2.5) from dept");
oracle.checkQuery("select current_time from dept");
oracle.checkQuery("select Current_Time from dept");
oracle.checkQuery("select CURRENT_TIME from dept");
mysql.checkQuery("select sum(deptno), floor(2.5) from dept");
mysql.checkQuery("select count(*), sum(deptno), floor(2.5) from dept");
mysql.checkQuery("select COUNT(*), FLOOR(2.5) from dept");
mysql.checkQuery("select cOuNt(*), FlOOr(2.5) from dept");
mysql.checkQuery("select cOuNt (*), FlOOr (2.5) from dept");
mysql.checkQuery("select current_time from dept");
mysql.checkQuery("select Current_Time from dept");
mysql.checkQuery("select CURRENT_TIME from dept");
// MySQL assumes that a quoted function name is not a built-in.
//
// mysql> select `sum`(`day`) from days;
// ERROR 1630 (42000): FUNCTION foodmart.sum does not exist. Check the
// 'Function Name Parsing and Resolution' section in the Reference Manual
// mysql> select `SUM`(`day`) from days;
// ERROR 1630 (42000): FUNCTION foodmart.SUM does not exist. Check the
// 'Function Name Parsing and Resolution' section in the Reference Manual
// mysql> select SUM(`day`) from days;
// +------------+
// | SUM(`day`) |
// +------------+
// | 28 |
// +------------+
// 1 row in set (0.00 sec)
//
// We do not follow MySQL in this regard. `count` is preserved in
// lower-case, and is matched case-insensitively because it is a built-in.
// So, the query succeeds.
oracle.checkQuery("select \"count\"(*) from dept");
mysql.checkQuery("select `count`(*) from dept");
}