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
d168601e
Commit
d168601e
authored
Oct 03, 2019
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-20734 Allow reserved keywords as user defined type names
parent
54606df1
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1277 additions
and
673 deletions
+1277
-673
mysql-test/main/parser.result
mysql-test/main/parser.result
+13
-0
mysql-test/main/parser.test
mysql-test/main/parser.test
+18
-0
mysql-test/suite/compat/oracle/r/parser.result
mysql-test/suite/compat/oracle/r/parser.result
+13
-0
mysql-test/suite/compat/oracle/t/parser.test
mysql-test/suite/compat/oracle/t/parser.test
+18
-0
mysql-test/suite/funcs_1/r/storedproc.result
mysql-test/suite/funcs_1/r/storedproc.result
+9
-24
mysql-test/suite/funcs_1/t/storedproc.test
mysql-test/suite/funcs_1/t/storedproc.test
+9
-9
sql/sql_lex.cc
sql/sql_lex.cc
+27
-0
sql/sql_lex.h
sql/sql_lex.h
+6
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+582
-320
sql/sql_yacc_ora.yy
sql/sql_yacc_ora.yy
+582
-320
No files found.
mysql-test/main/parser.result
View file @
d168601e
...
...
@@ -1798,3 +1798,16 @@ ERROR HY000: Table 't2' was not locked with LOCK TABLES
SET STATEMENT max_statement_time=900 FOR unlock tables;
drop table t1, t2;
# End of 10.4 tests
#
# Start of 10.5 tests
#
#
# MDEV-20734 Allow reserved keywords as user defined type names
#
CREATE TABLE t1 (a DUAL);
ERROR HY000: Unknown data type: 'DUAL'
SELECT CAST(1 AS DUAL);
ERROR HY000: Unknown data type: 'DUAL'
#
# End of 10.5 tests
#
mysql-test/main/parser.test
View file @
d168601e
...
...
@@ -1566,3 +1566,21 @@ SET STATEMENT max_statement_time=900 FOR unlock tables;
drop
table
t1
,
t2
;
--
echo
# End of 10.4 tests
--
echo
#
--
echo
# Start of 10.5 tests
--
echo
#
--
echo
#
--
echo
# MDEV-20734 Allow reserved keywords as user defined type names
--
echo
#
--
error
ER_UNKNOWN_DATA_TYPE
CREATE
TABLE
t1
(
a
DUAL
);
--
error
ER_UNKNOWN_DATA_TYPE
SELECT
CAST
(
1
AS
DUAL
);
--
echo
#
--
echo
# End of 10.5 tests
--
echo
#
mysql-test/suite/compat/oracle/r/parser.result
View file @
d168601e
...
...
@@ -609,3 +609,16 @@ ERROR HY000: Unknown system variable 'role'
#
# End of 10.3 tests
#
#
# Start of 10.5 tests
#
#
# MDEV-20734 Allow reserved keywords as user defined type names
#
CREATE TABLE t1 (a DUAL);
ERROR HY000: Unknown data type: 'DUAL'
SELECT CAST(1 AS DUAL);
ERROR HY000: Unknown data type: 'DUAL'
#
# End of 10.5 tests
#
mysql-test/suite/compat/oracle/t/parser.test
View file @
d168601e
...
...
@@ -412,3 +412,21 @@ SELECT @@GLOBAL.role;
--
echo
#
--
echo
# End of 10.3 tests
--
echo
#
--
echo
#
--
echo
# Start of 10.5 tests
--
echo
#
--
echo
#
--
echo
# MDEV-20734 Allow reserved keywords as user defined type names
--
echo
#
--
error
ER_UNKNOWN_DATA_TYPE
CREATE
TABLE
t1
(
a
DUAL
);
--
error
ER_UNKNOWN_DATA_TYPE
SELECT
CAST
(
1
AS
DUAL
);
--
echo
#
--
echo
# End of 10.5 tests
--
echo
#
mysql-test/suite/funcs_1/r/storedproc.result
View file @
d168601e
No preview for this file type
mysql-test/suite/funcs_1/t/storedproc.test
View file @
d168601e
...
...
@@ -5954,7 +5954,7 @@ DROP PROCEDURE IF EXISTS sp6;
--
enable_warnings
delimiter
//;
--
error
ER_
PARSE_ERROR
--
error
ER_
UNKNOWN_DATA_TYPE
CREATE
PROCEDURE
sp6
(
)
BEGIN
declare
x
default
'0'
char
;
...
...
@@ -6021,7 +6021,7 @@ DROP PROCEDURE IF EXISTS sp6;
--
enable_warnings
delimiter
//;
--
error
ER_
PARSE_ERROR
--
error
ER_
UNKNOWN_DATA_TYPE
CREATE
PROCEDURE
sp6
(
)
BEGIN
declare
x
default
'a'
char
;
...
...
@@ -6117,7 +6117,7 @@ DROP PROCEDURE IF EXISTS sp6;
--
enable_warnings
delimiter
//;
--
error
ER_
PARSE_ERROR
--
error
ER_
UNKNOWN_DATA_TYPE
CREATE
PROCEDURE
sp6
(
)
BEGIN
declare
handler
continue
for
sqlstate
'02000'
set
@
x2
=
1
;
...
...
@@ -6141,7 +6141,7 @@ DROP PROCEDURE IF EXISTS sp6;
--
enable_warnings
delimiter
//;
--
error
ER_
PARSE_ERROR
--
error
ER_
UNKNOWN_DATA_TYPE
CREATE
PROCEDURE
sp6
(
)
BEGIN
declare
handler
undo
for
sqlstate
'02000'
set
@
x2
=
1
;
...
...
@@ -7455,7 +7455,7 @@ DROP PROCEDURE IF EXISTS sp1;
--
enable_warnings
delimiter
//;
--
error
ER_
PARSE_ERROR
--
error
ER_
UNKNOWN_DATA_TYPE
CREATE
PROCEDURE
sp1
(
)
BEGIN
declare
date
not
null
x
;
...
...
@@ -7468,7 +7468,7 @@ DROP PROCEDURE IF EXISTS sp1;
--
enable_warnings
delimiter
//;
--
error
ER_
PARSE_ERROR
--
error
ER_
UNKNOWN_DATA_TYPE
CREATE
PROCEDURE
sp1
(
)
BEGIN
declare
time
not
null
x
;
...
...
@@ -7481,7 +7481,7 @@ DROP PROCEDURE IF EXISTS sp1;
--
enable_warnings
delimiter
//;
--
error
ER_
PARSE_ERROR
--
error
ER_
UNKNOWN_DATA_TYPE
CREATE
PROCEDURE
sp1
(
)
BEGIN
declare
datetime
not
null
x
;
...
...
@@ -7494,7 +7494,7 @@ DROP PROCEDURE IF EXISTS sp1;
--
enable_warnings
delimiter
//;
--
error
ER_
PARSE_ERROR
--
error
ER_
UNKNOWN_DATA_TYPE
CREATE
PROCEDURE
sp1
(
)
BEGIN
declare
timestamp
not
null
x
;
...
...
@@ -7507,7 +7507,7 @@ DROP PROCEDURE IF EXISTS sp1;
--
enable_warnings
delimiter
//;
--
error
ER_
PARSE_ERROR
--
error
ER_
UNKNOWN_DATA_TYPE
CREATE
PROCEDURE
sp1
(
)
BEGIN
declare
year
not
null
x
;
...
...
sql/sql_lex.cc
View file @
d168601e
...
...
@@ -10433,3 +10433,30 @@ void Lex_field_type_st::set_handler_length_flags(const Type_handler *handler,
handler
=
handler
->
type_handler_unsigned
();
set
(
handler
,
length
,
NULL
);
}
bool
LEX
::
set_field_type_udt
(
Lex_field_type_st
*
type
,
const
LEX_CSTRING
&
name
,
const
Lex_length_and_dec_st
&
attr
)
{
const
Type_handler
*
h
;
if
(
!
(
h
=
Type_handler
::
handler_by_name_or_error
(
name
)))
return
true
;
type
->
set
(
h
,
attr
);
charset
=
&
my_charset_bin
;
return
false
;
}
bool
LEX
::
set_cast_type_udt
(
Lex_cast_type_st
*
type
,
const
LEX_CSTRING
&
name
)
{
const
Type_handler
*
h
;
if
(
!
(
h
=
Type_handler
::
handler_by_name_or_error
(
name
)))
return
true
;
type
->
set
(
h
);
charset
=
NULL
;
return
false
;
}
sql/sql_lex.h
View file @
d168601e
...
...
@@ -4558,6 +4558,12 @@ struct LEX: public Query_tables_list
Item_result
return_type
,
const
LEX_CSTRING
&
soname
);
Spvar_definition
*
row_field_name
(
THD
*
thd
,
const
Lex_ident_sys_st
&
name
);
bool
set_field_type_udt
(
Lex_field_type_st
*
type
,
const
LEX_CSTRING
&
name
,
const
Lex_length_and_dec_st
&
attr
);
bool
set_cast_type_udt
(
Lex_cast_type_st
*
type
,
const
LEX_CSTRING
&
name
);
};
...
...
sql/sql_yacc.yy
View file @
d168601e
This diff is collapsed.
Click to expand it.
sql/sql_yacc_ora.yy
View file @
d168601e
This diff is collapsed.
Click to expand it.
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