https://bugs.documentfoundation.org/show_bug.cgi?id=155431

Julien Nabet <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #8 from Julien Nabet <[email protected]> ---
Lionel: when I remade the tests, I used HSQLDB and this database doesn't seem
to accept this syntax.
So I tested again with Mysql and with initial patch I had done or with this
one:
diff --git a/connectivity/source/parse/sqlbison.y
b/connectivity/source/parse/sqlbison.y
index 8263535dc82b..4ed7db24ac23 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -139,7 +139,7 @@ using namespace connectivity;
 %token <pParseNode> SQL_TOKEN_SCHEMA SQL_TOKEN_SELECT SQL_TOKEN_SET
SQL_TOKEN_SIZE SQL_TOKEN_SMALLINT SQL_TOKEN_SOME SQL_TOKEN_SQLCODE
SQL_TOKEN_SQLERROR SQL_TOKEN_SUM

 %token <pParseNode> SQL_TOKEN_TABLE SQL_TOKEN_TIME SQL_TOKEN_TIMESTAMP
SQL_TOKEN_TIMEZONE_HOUR SQL_TOKEN_TIMEZONE_MINUTE SQL_TOKEN_TO
SQL_TOKEN_TRAILING SQL_TOKEN_TRANSLATE SQL_TOKEN_TRIM SQL_TOKEN_TRUE
SQL_TOKEN_UNION
-%token <pParseNode> SQL_TOKEN_UNIQUE SQL_TOKEN_UNKNOWN SQL_TOKEN_UPDATE
SQL_TOKEN_UPPER SQL_TOKEN_USAGE SQL_TOKEN_USER SQL_TOKEN_USING SQL_TOKEN_VALUES
SQL_TOKEN_VIEW
+%token <pParseNode> SQL_TOKEN_UNIQUE SQL_TOKEN_UNKNOWN SQL_TOKEN_UNSIGNED
SQL_TOKEN_UPDATE SQL_TOKEN_UPPER SQL_TOKEN_USAGE SQL_TOKEN_USER SQL_TOKEN_USING
SQL_TOKEN_VALUES SQL_TOKEN_VIEW
 %token <pParseNode> SQL_TOKEN_WHERE SQL_TOKEN_WITH SQL_TOKEN_WORK
SQL_TOKEN_ZONE

 /* ODBC KEYWORDS */
@@ -2719,6 +2719,7 @@ cast_operand:
 cast_target:
                table_node
          | data_type
+          | SQL_TOKEN_UNSIGNED
        ;
 cast_spec:
          SQL_TOKEN_CAST '(' cast_operand SQL_TOKEN_AS cast_target ')'
diff --git a/connectivity/source/parse/sqlflex.l
b/connectivity/source/parse/sqlflex.l
index 34a4067ea21c..cd395cbe26bb 100644
--- a/connectivity/source/parse/sqlflex.l
+++ b/connectivity/source/parse/sqlflex.l
@@ -394,6 +394,7 @@ UNBOUNDED           {SQL_NEW_KEYWORD(SQL_TOKEN_UNBOUNDED); 
}
 UNION               {SQL_NEW_KEYWORD(SQL_TOKEN_UNION);  }
 UNIQUE              {SQL_NEW_KEYWORD(SQL_TOKEN_UNIQUE);  }
 UNKNOWN             {SQL_NEW_KEYWORD(SQL_TOKEN_UNKNOWN);  }
+UNSIGNED            {SQL_NEW_KEYWORD(SQL_TOKEN_UNSIGNED);  }
 UPDATE              {SQL_NEW_KEYWORD(SQL_TOKEN_UPDATE);  }
 UPPER               {SQL_NEW_KEYWORD(SQL_TOKEN_UPPER);  }
 USAGE               {SQL_NEW_KEYWORD(SQL_TOKEN_USAGE);  }

(notice SQL_TOKEN_UNSIGNED is now used in "cast_target" rule, I got the same
result in output:
2,20,

table "product_nr" contains
1,2
2,20
and its structure is:
int id (primary key),int product_nr

Then, thinking about tdf#118817 (WEEK, WEEKDAY, ... for EXTRACT), I tried with
"Create Query in SQL View..." and here it doesn't work indeed if I don't add
the token in "cast_target" rule.
I'll submit a new patch then.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to