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
9f84451d
Commit
9f84451d
authored
Apr 22, 2018
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-15960 Wrong data type on CREATE..SELECT char_or_enum_or_text_spvar
parent
c555dc76
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
191 additions
and
55 deletions
+191
-55
mysql-test/main/sp-anchor-row-type-table.result
mysql-test/main/sp-anchor-row-type-table.result
+1
-1
mysql-test/main/sp-anchor-type.result
mysql-test/main/sp-anchor-type.result
+8
-8
mysql-test/main/sp-row.result
mysql-test/main/sp-row.result
+18
-18
mysql-test/main/sp-vars.result
mysql-test/main/sp-vars.result
+69
-0
mysql-test/main/sp-vars.test
mysql-test/main/sp-vars.test
+67
-0
mysql-test/suite/compat/oracle/r/sp-anchor-row-type-table.result
...est/suite/compat/oracle/r/sp-anchor-row-type-table.result
+1
-1
mysql-test/suite/compat/oracle/r/sp-row.result
mysql-test/suite/compat/oracle/r/sp-row.result
+18
-18
mysql-test/suite/compat/oracle/r/sp.result
mysql-test/suite/compat/oracle/r/sp.result
+8
-8
sql/item.h
sql/item.h
+1
-1
No files found.
mysql-test/main/sp-anchor-row-type-table.result
View file @
9f84451d
...
...
@@ -701,7 +701,7 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL,
`b` text DEFAULT NULL,
`c`
var
char(1) DEFAULT NULL
`c` char(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP PROCEDURE p2;
DROP PROCEDURE p1;
...
...
mysql-test/main/sp-anchor-type.result
View file @
9f84451d
...
...
@@ -462,15 +462,15 @@ t2 CREATE TABLE `t2` (
`dc100` decimal(10,0) DEFAULT NULL,
`dc103` decimal(10,3) DEFAULT NULL,
`dc209` decimal(20,9) DEFAULT NULL,
`cc`
var
char(10) DEFAULT NULL,
`cc` char(10) DEFAULT NULL,
`cv` varchar(10) DEFAULT NULL,
`cvu` varchar(10) CHARACTER SET utf8 DEFAULT NULL,
`t1` tinytext DEFAULT NULL,
`t2` text DEFAULT NULL,
`t3` mediumtext DEFAULT NULL,
`t4` longtext DEFAULT NULL,
`enum1`
var
char(1) DEFAULT NULL,
`set1`
var
char(5) DEFAULT NULL,
`enum1` char(1) DEFAULT NULL,
`set1` char(5) DEFAULT NULL,
`blob1` tinyblob DEFAULT NULL,
`blob2` blob DEFAULT NULL,
`blob3` mediumblob DEFAULT NULL,
...
...
@@ -624,15 +624,15 @@ t2 CREATE TABLE `t2` (
`dc100` decimal(10,0) DEFAULT NULL,
`dc103` decimal(10,3) DEFAULT NULL,
`dc209` decimal(20,9) DEFAULT NULL,
`cc`
var
char(10) DEFAULT NULL,
`cc` char(10) DEFAULT NULL,
`cv` varchar(10) DEFAULT NULL,
`cvu` varchar(10) CHARACTER SET utf8 DEFAULT NULL,
`t1` tinytext DEFAULT NULL,
`t2` text DEFAULT NULL,
`t3` mediumtext DEFAULT NULL,
`t4` longtext DEFAULT NULL,
`enum1`
var
char(1) DEFAULT NULL,
`set1`
var
char(5) DEFAULT NULL,
`enum1` char(1) DEFAULT NULL,
`set1` char(5) DEFAULT NULL,
`blob1` tinyblob DEFAULT NULL,
`blob2` blob DEFAULT NULL,
`blob3` mediumblob DEFAULT NULL,
...
...
@@ -1042,7 +1042,7 @@ t1 CREATE TABLE `t1` (
`a_flt0` float DEFAULT NULL,
`a_dbl0` double DEFAULT NULL,
`a_bit3` bit(3) DEFAULT NULL,
`a_enum0`
var
char(1) DEFAULT NULL,
`a_enum0` char(1) DEFAULT NULL,
`a_varchar10` varchar(10) DEFAULT NULL,
`a_text1` text DEFAULT NULL,
`a_tinytext1` tinytext DEFAULT NULL,
...
...
@@ -1060,7 +1060,7 @@ t1 CREATE TABLE `t1` (
`aa_flt0` float DEFAULT NULL,
`aa_dbl0` double DEFAULT NULL,
`aa_bit3` bit(3) DEFAULT NULL,
`aa_enum0`
var
char(1) DEFAULT NULL,
`aa_enum0` char(1) DEFAULT NULL,
`aa_varchar10` varchar(10) DEFAULT NULL,
`aa_text1` text DEFAULT NULL,
`aa_tinytext1` tinytext DEFAULT NULL,
...
...
mysql-test/main/sp-row.result
View file @
9f84451d
...
...
@@ -1795,8 +1795,8 @@ CALL p1();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`var`
var
char(1) DEFAULT NULL,
`rec.var`
var
char(1) DEFAULT NULL
`var` char(1) DEFAULT NULL,
`rec.var` char(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP PROCEDURE p1;
...
...
@@ -1805,8 +1805,8 @@ CALL p1();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`var`
var
binary(1) DEFAULT NULL,
`rec.var`
var
binary(1) DEFAULT NULL
`var` binary(1) DEFAULT NULL,
`rec.var` binary(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP PROCEDURE p1;
...
...
@@ -1815,8 +1815,8 @@ CALL p1();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`var`
var
char(1) DEFAULT NULL,
`rec.var`
var
char(1) DEFAULT NULL
`var` char(1) DEFAULT NULL,
`rec.var` char(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP PROCEDURE p1;
...
...
@@ -1825,8 +1825,8 @@ CALL p1();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`var`
var
char(10) DEFAULT NULL,
`rec.var`
var
char(10) DEFAULT NULL
`var` char(10) DEFAULT NULL,
`rec.var` char(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP PROCEDURE p1;
...
...
@@ -1835,8 +1835,8 @@ CALL p1();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`var`
var
char(10) CHARACTER SET utf8 DEFAULT NULL,
`rec.var`
var
char(10) CHARACTER SET utf8 DEFAULT NULL
`var` char(10) CHARACTER SET utf8 DEFAULT NULL,
`rec.var` char(10) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP PROCEDURE p1;
...
...
@@ -1845,8 +1845,8 @@ CALL p1();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`var`
var
binary(10) DEFAULT NULL,
`rec.var`
var
binary(10) DEFAULT NULL
`var` binary(10) DEFAULT NULL,
`rec.var` binary(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP PROCEDURE p1;
...
...
@@ -2084,8 +2084,8 @@ CALL p1();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`var`
medium
text CHARACTER SET utf8 DEFAULT NULL,
`rec.var`
medium
text CHARACTER SET utf8 DEFAULT NULL
`var` text CHARACTER SET utf8 DEFAULT NULL,
`rec.var` text CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP PROCEDURE p1;
...
...
@@ -2094,8 +2094,8 @@ CALL p1();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`var` text CHARACTER SET utf8 DEFAULT NULL,
`rec.var` text CHARACTER SET utf8 DEFAULT NULL
`var` t
inyt
ext CHARACTER SET utf8 DEFAULT NULL,
`rec.var` t
inyt
ext CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP PROCEDURE p1;
...
...
@@ -2104,8 +2104,8 @@ CALL p1();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`var`
long
text CHARACTER SET utf8 DEFAULT NULL,
`rec.var`
long
text CHARACTER SET utf8 DEFAULT NULL
`var`
medium
text CHARACTER SET utf8 DEFAULT NULL,
`rec.var`
medium
text CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP PROCEDURE p1;
...
...
mysql-test/main/sp-vars.result
View file @
9f84451d
...
...
@@ -1241,3 +1241,72 @@ t1 CREATE TABLE "t1" (
"a" year(4) DEFAULT NULL
)
DROP PROCEDURE p1;
#
# MDEV-15960 Wrong data type on CREATE..SELECT char_or_enum_or_text_spvar
#
BEGIN NOT ATOMIC
DECLARE var TINYTEXT CHARACTER SET utf8;
CREATE TABLE t1 AS SELECT var;
END;
$$
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"var" tinytext CHARACTER SET utf8 DEFAULT NULL
)
DROP TABLE t1;
BEGIN NOT ATOMIC
DECLARE var TEXT CHARACTER SET utf8;
CREATE TABLE t1 AS SELECT var;
END;
$$
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"var" text CHARACTER SET utf8 DEFAULT NULL
)
DROP TABLE t1;
BEGIN NOT ATOMIC
DECLARE var MEDIUMTEXT CHARACTER SET utf8;
CREATE TABLE t1 AS SELECT var;
END;
$$
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"var" mediumtext CHARACTER SET utf8 DEFAULT NULL
)
DROP TABLE t1;
BEGIN NOT ATOMIC
DECLARE var LONGTEXT CHARACTER SET utf8;
CREATE TABLE t1 AS SELECT var;
END;
$$
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"var" longtext CHARACTER SET utf8 DEFAULT NULL
)
DROP TABLE t1;
BEGIN NOT ATOMIC
DECLARE var CHAR(1);
CREATE TABLE t1 AS SELECT var;
END;
$$
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"var" char(1) DEFAULT NULL
)
DROP TABLE t1;
BEGIN NOT ATOMIC
DECLARE var ENUM('a');
CREATE TABLE t1 AS SELECT var;
END;
$$
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"var" char(1) DEFAULT NULL
)
DROP TABLE t1;
mysql-test/main/sp-vars.test
View file @
9f84451d
...
...
@@ -1536,3 +1536,70 @@ $$
DELIMITER
;
$$
CALL
p1
;
DROP
PROCEDURE
p1
;
--
echo
#
--
echo
# MDEV-15960 Wrong data type on CREATE..SELECT char_or_enum_or_text_spvar
--
echo
#
DELIMITER
$$
;
BEGIN
NOT
ATOMIC
DECLARE
var
TINYTEXT
CHARACTER
SET
utf8
;
CREATE
TABLE
t1
AS
SELECT
var
;
END
;
$$
DELIMITER
;
$$
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
DELIMITER
$$
;
BEGIN
NOT
ATOMIC
DECLARE
var
TEXT
CHARACTER
SET
utf8
;
CREATE
TABLE
t1
AS
SELECT
var
;
END
;
$$
DELIMITER
;
$$
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
DELIMITER
$$
;
BEGIN
NOT
ATOMIC
DECLARE
var
MEDIUMTEXT
CHARACTER
SET
utf8
;
CREATE
TABLE
t1
AS
SELECT
var
;
END
;
$$
DELIMITER
;
$$
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
DELIMITER
$$
;
BEGIN
NOT
ATOMIC
DECLARE
var
LONGTEXT
CHARACTER
SET
utf8
;
CREATE
TABLE
t1
AS
SELECT
var
;
END
;
$$
DELIMITER
;
$$
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
DELIMITER
$$
;
BEGIN
NOT
ATOMIC
DECLARE
var
CHAR
(
1
);
CREATE
TABLE
t1
AS
SELECT
var
;
END
;
$$
DELIMITER
;
$$
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
DELIMITER
$$
;
BEGIN
NOT
ATOMIC
DECLARE
var
ENUM
(
'a'
);
CREATE
TABLE
t1
AS
SELECT
var
;
END
;
$$
DELIMITER
;
$$
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
mysql-test/suite/compat/oracle/r/sp-anchor-row-type-table.result
View file @
9f84451d
...
...
@@ -21,7 +21,7 @@ Table Create Table
t2 CREATE TABLE "t2" (
"a" int(11) DEFAULT NULL,
"b" text DEFAULT NULL,
"c"
var
char(1) DEFAULT NULL
"c" char(1) DEFAULT NULL
)
DROP PROCEDURE p2;
DROP PROCEDURE p1;
...
...
mysql-test/suite/compat/oracle/r/sp-row.result
View file @
9f84451d
...
...
@@ -1872,8 +1872,8 @@ CALL p1();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"var"
var
char(1) DEFAULT NULL,
"rec.var"
var
char(1) DEFAULT NULL
"var" char(1) DEFAULT NULL,
"rec.var" char(1) DEFAULT NULL
)
DROP TABLE t1;
DROP PROCEDURE p1;
...
...
@@ -1882,8 +1882,8 @@ CALL p1();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"var"
var
binary(1) DEFAULT NULL,
"rec.var"
var
binary(1) DEFAULT NULL
"var" binary(1) DEFAULT NULL,
"rec.var" binary(1) DEFAULT NULL
)
DROP TABLE t1;
DROP PROCEDURE p1;
...
...
@@ -1892,8 +1892,8 @@ CALL p1();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"var"
var
char(1) DEFAULT NULL,
"rec.var"
var
char(1) DEFAULT NULL
"var" char(1) DEFAULT NULL,
"rec.var" char(1) DEFAULT NULL
)
DROP TABLE t1;
DROP PROCEDURE p1;
...
...
@@ -1902,8 +1902,8 @@ CALL p1();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"var"
var
char(10) DEFAULT NULL,
"rec.var"
var
char(10) DEFAULT NULL
"var" char(10) DEFAULT NULL,
"rec.var" char(10) DEFAULT NULL
)
DROP TABLE t1;
DROP PROCEDURE p1;
...
...
@@ -1912,8 +1912,8 @@ CALL p1();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"var"
var
char(10) CHARACTER SET utf8 DEFAULT NULL,
"rec.var"
var
char(10) CHARACTER SET utf8 DEFAULT NULL
"var" char(10) CHARACTER SET utf8 DEFAULT NULL,
"rec.var" char(10) CHARACTER SET utf8 DEFAULT NULL
)
DROP TABLE t1;
DROP PROCEDURE p1;
...
...
@@ -1922,8 +1922,8 @@ CALL p1();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"var"
var
binary(10) DEFAULT NULL,
"rec.var"
var
binary(10) DEFAULT NULL
"var" binary(10) DEFAULT NULL,
"rec.var" binary(10) DEFAULT NULL
)
DROP TABLE t1;
DROP PROCEDURE p1;
...
...
@@ -2161,8 +2161,8 @@ CALL p1();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"var"
medium
text CHARACTER SET utf8 DEFAULT NULL,
"rec.var"
medium
text CHARACTER SET utf8 DEFAULT NULL
"var" text CHARACTER SET utf8 DEFAULT NULL,
"rec.var" text CHARACTER SET utf8 DEFAULT NULL
)
DROP TABLE t1;
DROP PROCEDURE p1;
...
...
@@ -2171,8 +2171,8 @@ CALL p1();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"var" text CHARACTER SET utf8 DEFAULT NULL,
"rec.var" text CHARACTER SET utf8 DEFAULT NULL
"var" t
inyt
ext CHARACTER SET utf8 DEFAULT NULL,
"rec.var" t
inyt
ext CHARACTER SET utf8 DEFAULT NULL
)
DROP TABLE t1;
DROP PROCEDURE p1;
...
...
@@ -2181,8 +2181,8 @@ CALL p1();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"var"
long
text CHARACTER SET utf8 DEFAULT NULL,
"rec.var"
long
text CHARACTER SET utf8 DEFAULT NULL
"var"
medium
text CHARACTER SET utf8 DEFAULT NULL,
"rec.var"
medium
text CHARACTER SET utf8 DEFAULT NULL
)
DROP TABLE t1;
DROP PROCEDURE p1;
...
...
mysql-test/suite/compat/oracle/r/sp.result
View file @
9f84451d
...
...
@@ -1704,15 +1704,15 @@ t2 CREATE TABLE "t2" (
"dc100" decimal(10,0) DEFAULT NULL,
"dc103" decimal(10,3) DEFAULT NULL,
"dc209" decimal(20,9) DEFAULT NULL,
"cc"
var
char(10) DEFAULT NULL,
"cc" char(10) DEFAULT NULL,
"cv" varchar(10) DEFAULT NULL,
"cvu" varchar(10) CHARACTER SET utf8 DEFAULT NULL,
"t1" tinytext DEFAULT NULL,
"t2" text DEFAULT NULL,
"t3" mediumtext DEFAULT NULL,
"t4" longtext DEFAULT NULL,
"enum1"
var
char(1) DEFAULT NULL,
"set1"
var
char(5) DEFAULT NULL,
"enum1" char(1) DEFAULT NULL,
"set1" char(5) DEFAULT NULL,
"blob1" tinyblob DEFAULT NULL,
"blob2" longblob DEFAULT NULL,
"blob3" mediumblob DEFAULT NULL,
...
...
@@ -1866,15 +1866,15 @@ t2 CREATE TABLE "t2" (
"dc100" decimal(10,0) DEFAULT NULL,
"dc103" decimal(10,3) DEFAULT NULL,
"dc209" decimal(20,9) DEFAULT NULL,
"cc"
var
char(10) DEFAULT NULL,
"cc" char(10) DEFAULT NULL,
"cv" varchar(10) DEFAULT NULL,
"cvu" varchar(10) CHARACTER SET utf8 DEFAULT NULL,
"t1" tinytext DEFAULT NULL,
"t2" text DEFAULT NULL,
"t3" mediumtext DEFAULT NULL,
"t4" longtext DEFAULT NULL,
"enum1"
var
char(1) DEFAULT NULL,
"set1"
var
char(5) DEFAULT NULL,
"enum1" char(1) DEFAULT NULL,
"set1" char(5) DEFAULT NULL,
"blob1" tinyblob DEFAULT NULL,
"blob2" longblob DEFAULT NULL,
"blob3" mediumblob DEFAULT NULL,
...
...
@@ -2382,7 +2382,7 @@ t1 CREATE TABLE "t1" (
"a_flt0" float DEFAULT NULL,
"a_dbl0" double DEFAULT NULL,
"a_bit3" bit(3) DEFAULT NULL,
"a_enum0"
var
char(1) DEFAULT NULL,
"a_enum0" char(1) DEFAULT NULL,
"a_varchar10" varchar(10) DEFAULT NULL,
"a_text1" text DEFAULT NULL,
"a_tinytext1" tinytext DEFAULT NULL,
...
...
@@ -2400,7 +2400,7 @@ t1 CREATE TABLE "t1" (
"aa_flt0" float DEFAULT NULL,
"aa_dbl0" double DEFAULT NULL,
"aa_bit3" bit(3) DEFAULT NULL,
"aa_enum0"
var
char(1) DEFAULT NULL,
"aa_enum0" char(1) DEFAULT NULL,
"aa_varchar10" varchar(10) DEFAULT NULL,
"aa_text1" text DEFAULT NULL,
"aa_tinytext1" tinytext DEFAULT NULL,
...
...
sql/item.h
View file @
9f84451d
...
...
@@ -2505,7 +2505,7 @@ class Item_splocal :public Item_sp_variable,
based on result_type(), which is less exact.
*/
Field
*
create_field_for_create_select
(
TABLE
*
table
)
{
return
tmp_table_field_from_field_type
(
table
);
}
{
return
create_table_field_from_handler
(
table
);
}
};
...
...
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