Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4de26a8e
Commit
4de26a8e
authored
Sep 17, 2016
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-10343 Providing compatibility for basic SQL data types
Based on the patch by Dmitry Tolpeko.
parent
decc550f
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
167 additions
and
3 deletions
+167
-3
mysql-test/r/parser.result
mysql-test/r/parser.result
+9
-0
mysql-test/suite/compat/oracle/r/type_blob.result
mysql-test/suite/compat/oracle/r/type_blob.result
+8
-0
mysql-test/suite/compat/oracle/r/type_clob.result
mysql-test/suite/compat/oracle/r/type_clob.result
+15
-0
mysql-test/suite/compat/oracle/r/type_date.result
mysql-test/suite/compat/oracle/r/type_date.result
+8
-0
mysql-test/suite/compat/oracle/r/type_number.result
mysql-test/suite/compat/oracle/r/type_number.result
+7
-0
mysql-test/suite/compat/oracle/r/type_raw.result
mysql-test/suite/compat/oracle/r/type_raw.result
+15
-0
mysql-test/suite/compat/oracle/r/type_varchar2.result
mysql-test/suite/compat/oracle/r/type_varchar2.result
+15
-0
mysql-test/suite/compat/oracle/t/type_blob.test
mysql-test/suite/compat/oracle/t/type_blob.test
+4
-0
mysql-test/suite/compat/oracle/t/type_clob.test
mysql-test/suite/compat/oracle/t/type_clob.test
+10
-0
mysql-test/suite/compat/oracle/t/type_date.test
mysql-test/suite/compat/oracle/t/type_date.test
+4
-0
mysql-test/suite/compat/oracle/t/type_number.test
mysql-test/suite/compat/oracle/t/type_number.test
+5
-0
mysql-test/suite/compat/oracle/t/type_raw.test
mysql-test/suite/compat/oracle/t/type_raw.test
+10
-0
mysql-test/suite/compat/oracle/t/type_varchar2.test
mysql-test/suite/compat/oracle/t/type_varchar2.test
+10
-0
mysql-test/t/parser.test
mysql-test/t/parser.test
+12
-0
sql/lex.h
sql/lex.h
+3
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+6
-0
sql/sql_yacc_ora.yy
sql/sql_yacc_ora.yy
+26
-3
No files found.
mysql-test/r/parser.result
View file @
4de26a8e
...
...
@@ -1319,3 +1319,12 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
#
# MDEV-10343 Providing compatibility for basic SQL data types
#
CREATE TABLE clob (clob int);
DROP TABLE clob;
CREATE TABLE raw (raw int);
DROP TABLE raw;
CREATE TABLE varchar2 (varchar2 int);
DROP TABLE varchar2;
mysql-test/suite/compat/oracle/r/type_blob.result
0 → 100644
View file @
4de26a8e
SET sql_mode=ORACLE;
CREATE TABLE t1 (a BLOB);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"a" longblob DEFAULT NULL
)
DROP TABLE t1;
mysql-test/suite/compat/oracle/r/type_clob.result
0 → 100644
View file @
4de26a8e
SET sql_mode=ORACLE;
CREATE TABLE clob (clob INT);
SHOW CREATE TABLE clob;
Table Create Table
clob CREATE TABLE "clob" (
"clob" int(11) DEFAULT NULL
)
DROP TABLE clob;
CREATE TABLE t1 (a CLOB);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"a" longtext DEFAULT NULL
)
DROP TABLE t1;
mysql-test/suite/compat/oracle/r/type_date.result
0 → 100644
View file @
4de26a8e
SET sql_mode=ORACLE;
CREATE TABLE t1 (a DATE);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"a" datetime DEFAULT NULL
)
DROP TABLE t1;
mysql-test/suite/compat/oracle/r/type_number.result
View file @
4de26a8e
SET sql_mode=ORACLE;
CREATE TABLE t1 (a NUMBER);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"a" double DEFAULT NULL
)
DROP TABLE t1;
CREATE TABLE t1 (a NUMBER(10,2));
SHOW CREATE TABLE t1;
Table Create Table
...
...
mysql-test/suite/compat/oracle/r/type_raw.result
0 → 100644
View file @
4de26a8e
SET sql_mode=ORACLE;
CREATE TABLE raw (raw INT);
SHOW CREATE TABLE raw;
Table Create Table
raw CREATE TABLE "raw" (
"raw" int(11) DEFAULT NULL
)
DROP TABLE raw;
CREATE TABLE t1 (a RAW(10));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"a" varbinary(10) DEFAULT NULL
)
DROP TABLE t1;
mysql-test/suite/compat/oracle/r/type_varchar2.result
0 → 100644
View file @
4de26a8e
SET sql_mode=ORACLE;
CREATE TABLE varchar2 (varchar2 INT);
SHOW CREATE TABLE varchar2;
Table Create Table
varchar2 CREATE TABLE "varchar2" (
"varchar2" int(11) DEFAULT NULL
)
DROP TABLE varchar2;
CREATE TABLE t1 (a VARCHAR2(10));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"a" varchar(10) DEFAULT NULL
)
DROP TABLE t1;
mysql-test/suite/compat/oracle/t/type_blob.test
0 → 100644
View file @
4de26a8e
SET
sql_mode
=
ORACLE
;
CREATE
TABLE
t1
(
a
BLOB
);
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
mysql-test/suite/compat/oracle/t/type_clob.test
0 → 100644
View file @
4de26a8e
SET
sql_mode
=
ORACLE
;
# CLOB is not a reserved word even in sql_mode=ORACLE
CREATE
TABLE
clob
(
clob
INT
);
SHOW
CREATE
TABLE
clob
;
DROP
TABLE
clob
;
CREATE
TABLE
t1
(
a
CLOB
);
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
mysql-test/suite/compat/oracle/t/type_date.test
0 → 100644
View file @
4de26a8e
SET
sql_mode
=
ORACLE
;
CREATE
TABLE
t1
(
a
DATE
);
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
mysql-test/suite/compat/oracle/t/type_number.test
View file @
4de26a8e
SET
sql_mode
=
ORACLE
;
CREATE
TABLE
t1
(
a
NUMBER
);
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
NUMBER
(
10
,
2
));
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
mysql-test/suite/compat/oracle/t/type_raw.test
0 → 100644
View file @
4de26a8e
SET
sql_mode
=
ORACLE
;
# RAW is not a reserved word even in sql_mode=ORACLE
CREATE
TABLE
raw
(
raw
INT
);
SHOW
CREATE
TABLE
raw
;
DROP
TABLE
raw
;
CREATE
TABLE
t1
(
a
RAW
(
10
));
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
mysql-test/suite/compat/oracle/t/type_varchar2.test
0 → 100644
View file @
4de26a8e
SET
sql_mode
=
ORACLE
;
# VARCHAR2 is not a reserved word even in sql_mode=ORACLE
CREATE
TABLE
varchar2
(
varchar2
INT
);
SHOW
CREATE
TABLE
varchar2
;
DROP
TABLE
varchar2
;
CREATE
TABLE
t1
(
a
VARCHAR2
(
10
));
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
mysql-test/t/parser.test
View file @
4de26a8e
...
...
@@ -1337,3 +1337,15 @@ create function fs() returns serial return 1;
create
table
t1
(
id
serial
);
show
create
table
t1
;
drop
table
t1
;
--
echo
#
--
echo
# MDEV-10343 Providing compatibility for basic SQL data types
--
echo
#
CREATE
TABLE
clob
(
clob
int
);
DROP
TABLE
clob
;
CREATE
TABLE
raw
(
raw
int
);
DROP
TABLE
raw
;
CREATE
TABLE
varchar2
(
varchar2
int
);
DROP
TABLE
varchar2
;
sql/lex.h
View file @
4de26a8e
...
...
@@ -114,6 +114,7 @@ static SYMBOL symbols[] = {
{
"CIPHER"
,
SYM
(
CIPHER_SYM
)},
{
"CLASS_ORIGIN"
,
SYM
(
CLASS_ORIGIN_SYM
)},
{
"CLIENT"
,
SYM
(
CLIENT_SYM
)},
{
"CLOB"
,
SYM
(
CLOB
)},
{
"CLOSE"
,
SYM
(
CLOSE_SYM
)},
{
"COALESCE"
,
SYM
(
COALESCE
)},
{
"CODE"
,
SYM
(
CODE_SYM
)},
...
...
@@ -472,6 +473,7 @@ static SYMBOL symbols[] = {
{
"QUERY"
,
SYM
(
QUERY_SYM
)},
{
"QUICK"
,
SYM
(
QUICK
)},
{
"RANGE"
,
SYM
(
RANGE_SYM
)},
{
"RAW"
,
SYM
(
RAW
)},
{
"READ"
,
SYM
(
READ_SYM
)},
{
"READ_ONLY"
,
SYM
(
READ_ONLY_SYM
)},
{
"READ_WRITE"
,
SYM
(
READ_WRITE_SYM
)},
...
...
@@ -660,6 +662,7 @@ static SYMBOL symbols[] = {
{
"VARBINARY"
,
SYM
(
VARBINARY
)},
{
"VARCHAR"
,
SYM
(
VARCHAR
)},
{
"VARCHARACTER"
,
SYM
(
VARCHAR
)},
{
"VARCHAR2"
,
SYM
(
VARCHAR2
)},
{
"VARIABLES"
,
SYM
(
VARIABLES
)},
{
"VARYING"
,
SYM
(
VARYING
)},
{
"VIA"
,
SYM
(
VIA_SYM
)},
...
...
sql/sql_yacc.yy
View file @
4de26a8e
...
...
@@ -1050,6 +1050,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token CLASS_ORIGIN_SYM /* SQL-2003-N */
%token CLIENT_SYM
%token CLOSE_SYM /* SQL-2003-R */
%token CLOB /* SQL-2003-R */
%token COALESCE /* SQL-2003-N */
%token CODE_SYM
%token COLLATE_SYM /* SQL-2003-R */
...
...
@@ -1429,6 +1430,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token QUICK
%token RANGE_SYM /* SQL-2003-R */
%token RANK_SYM
%token RAW /* Oracle */
%token READS_SYM /* SQL-2003-R */
%token READ_ONLY_SYM
%token READ_SYM /* SQL-2003-N */
...
...
@@ -1621,6 +1623,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token VALUE_SYM /* SQL-2003-R */
%token VARBINARY
%token VARCHAR /* SQL-2003-R */
%token VARCHAR2 /* Oracle */
%token VARIABLES
%token VARIANCE_SYM
%token VARYING /* SQL-2003-R */
...
...
@@ -14591,6 +14594,7 @@ keyword_sp:
| CIPHER_SYM {}
| CLIENT_SYM {}
| CLASS_ORIGIN_SYM {}
| CLOB {}
| COALESCE {}
| CODE_SYM {}
| COLLATION_SYM {}
...
...
@@ -14777,6 +14781,7 @@ keyword_sp:
| QUARTER_SYM {}
| QUERY_SYM {}
| QUICK {}
| RAW {}
| READ_ONLY_SYM {}
| REBUILD_SYM {}
| RECOVER_SYM {}
...
...
@@ -14863,6 +14868,7 @@ keyword_sp:
| UNTIL_SYM {}
| USER_SYM {}
| USE_FRM {}
| VARCHAR2 {}
| VARIABLES {}
| VIEW_SYM {}
| VIRTUAL_SYM {}
...
...
sql/sql_yacc_ora.yy
View file @
4de26a8e
...
...
@@ -426,6 +426,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token CLASS_ORIGIN_SYM /* SQL-2003-N */
%token CLIENT_SYM
%token CLOSE_SYM /* SQL-2003-R */
%token CLOB /* SQL-2003-R */
%token COALESCE /* SQL-2003-N */
%token CODE_SYM
%token COLLATE_SYM /* SQL-2003-R */
...
...
@@ -805,6 +806,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token QUICK
%token RANGE_SYM /* SQL-2003-R */
%token RANK_SYM
%token RAW /* Oracle */
%token READS_SYM /* SQL-2003-R */
%token READ_ONLY_SYM
%token READ_SYM /* SQL-2003-N */
...
...
@@ -997,6 +999,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token VALUE_SYM /* SQL-2003-R */
%token VARBINARY
%token VARCHAR /* SQL-2003-R */
%token VARCHAR2 /* Oracle */
%token VARIABLES
%token VARIANCE_SYM
%token VARYING /* SQL-2003-R */
...
...
@@ -5680,6 +5683,10 @@ field_type:
{
$$.set(MYSQL_TYPE_VARCHAR, $2);
}
| VARCHAR2 field_length opt_binary
{
$$.set(MYSQL_TYPE_VARCHAR, $2);
}
| nvarchar field_length opt_bin_mod
{
$$.set(MYSQL_TYPE_VARCHAR, $2);
...
...
@@ -5690,6 +5697,11 @@ field_type:
Lex->charset=&my_charset_bin;
$$.set(MYSQL_TYPE_VARCHAR, $2);
}
| RAW field_length
{
Lex->charset= &my_charset_bin;
$$.set(MYSQL_TYPE_VARCHAR, $2);
}
| YEAR_SYM opt_field_length field_options
{
if ($2)
...
...
@@ -5709,7 +5721,8 @@ field_type:
$$.set(MYSQL_TYPE_YEAR, $2);
}
| DATE_SYM
{ $$.set(MYSQL_TYPE_DATE); }
{ $$.set(opt_mysql56_temporal_format ?
MYSQL_TYPE_DATETIME2 : MYSQL_TYPE_DATETIME, 0); }
| TIME_SYM opt_field_length
{ $$.set(opt_mysql56_temporal_format ?
MYSQL_TYPE_TIME2 : MYSQL_TYPE_TIME, $2); }
...
...
@@ -5741,7 +5754,7 @@ field_type:
| BLOB_SYM opt_field_length
{
Lex->charset=&my_charset_bin;
$$.set(MYSQL_TYPE_
BLOB, $2
);
$$.set(MYSQL_TYPE_
LONG_BLOB
);
}
| spatial_type float_options srid_option
{
...
...
@@ -5779,10 +5792,17 @@ field_type:
{ $$.set(MYSQL_TYPE_MEDIUM_BLOB); }
| LONGTEXT opt_binary
{ $$.set(MYSQL_TYPE_LONG_BLOB); }
| CLOB opt_binary
{ $$.set(MYSQL_TYPE_LONG_BLOB); }
| DECIMAL_SYM float_options field_options
{ $$.set(MYSQL_TYPE_NEWDECIMAL, $2);}
| NUMBER_SYM float_options field_options
{ $$.set(MYSQL_TYPE_NEWDECIMAL, $2);}
{
if ($2.length() != 0)
$$.set(MYSQL_TYPE_NEWDECIMAL, $2);
else
$$.set(MYSQL_TYPE_DOUBLE);
}
| NUMERIC_SYM float_options field_options
{ $$.set(MYSQL_TYPE_NEWDECIMAL, $2);}
| FIXED_SYM float_options field_options
...
...
@@ -13969,6 +13989,7 @@ keyword_sp:
| CIPHER_SYM {}
| CLIENT_SYM {}
| CLASS_ORIGIN_SYM {}
| CLOB {}
| COALESCE {}
| CODE_SYM {}
| COLLATION_SYM {}
...
...
@@ -14155,6 +14176,7 @@ keyword_sp:
| QUARTER_SYM {}
| QUERY_SYM {}
| QUICK {}
| RAW {}
| READ_ONLY_SYM {}
| REBUILD_SYM {}
| RECOVER_SYM {}
...
...
@@ -14241,6 +14263,7 @@ keyword_sp:
| UNTIL_SYM {}
| USER_SYM {}
| USE_FRM {}
| VARCHAR2 {}
| VARIABLES {}
| VIEW_SYM {}
| VIRTUAL_SYM {}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment