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
4c2c5ec9
Commit
4c2c5ec9
authored
Nov 18, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-14434 Wrong result for CHARSET(CONCAT(?,const))
parent
0d1e805a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
0 deletions
+61
-0
mysql-test/r/ps.result
mysql-test/r/ps.result
+37
-0
mysql-test/t/ps.test
mysql-test/t/ps.test
+19
-0
sql/item.cc
sql/item.cc
+5
-0
No files found.
mysql-test/r/ps.result
View file @
4c2c5ec9
...
...
@@ -4992,3 +4992,40 @@ ERROR 42000: OUT or INOUT argument 1 for routine test.p1 is not a variable or NE
EXECUTE IMMEDIATE 'CALL p1(?)' USING IGNORE;
ERROR 42000: OUT or INOUT argument 1 for routine test.p1 is not a variable or NEW pseudo-variable in BEFORE trigger
DROP PROCEDURE p1;
#
# MDEV-14434 Wrong result for CHARSET(CONCAT(?,const))
#
SET NAMES utf8;
EXECUTE IMMEDIATE "SELECT CHARSET(CONCAT(5,_latin1'a'))";
CHARSET(CONCAT(5,_latin1'a'))
latin1
EXECUTE IMMEDIATE "SELECT CHARSET(CONCAT(?,_latin1'a'))" USING 5;
CHARSET(CONCAT(?,_latin1'a'))
latin1
EXECUTE IMMEDIATE "SELECT CHARSET(CONCAT(?,_latin1'a'))" USING 5.5;
CHARSET(CONCAT(?,_latin1'a'))
latin1
EXECUTE IMMEDIATE "SELECT CHARSET(CONCAT(?,_latin1'a'))" USING 5.5e0;
CHARSET(CONCAT(?,_latin1'a'))
latin1
EXECUTE IMMEDIATE "SELECT CHARSET(CONCAT(?,_latin1'a'))" USING TIME'10:20:30';
CHARSET(CONCAT(?,_latin1'a'))
latin1
EXECUTE IMMEDIATE "SELECT CHARSET(CONCAT(?,_latin1'a'))" USING TIMESTAMP'2001-01-01 10:20:30';
CHARSET(CONCAT(?,_latin1'a'))
latin1
EXECUTE IMMEDIATE "SELECT COERCIBILITY(?)" USING 5;
COERCIBILITY(?)
5
EXECUTE IMMEDIATE "SELECT COERCIBILITY(?)" USING 5.5;
COERCIBILITY(?)
5
EXECUTE IMMEDIATE "SELECT COERCIBILITY(?)" USING 5.5e0;
COERCIBILITY(?)
5
EXECUTE IMMEDIATE "SELECT COERCIBILITY(?)" USING TIME'10:20:30';
COERCIBILITY(?)
5
EXECUTE IMMEDIATE "SELECT COERCIBILITY(?)" USING TIMESTAMP'2001-01-01 10:20:30';
COERCIBILITY(?)
5
mysql-test/t/ps.test
View file @
4c2c5ec9
...
...
@@ -4476,3 +4476,22 @@ EXECUTE IMMEDIATE 'CALL p1(?)' USING DEFAULT;
--
error
ER_SP_NOT_VAR_ARG
EXECUTE
IMMEDIATE
'CALL p1(?)'
USING
IGNORE
;
DROP
PROCEDURE
p1
;
--
echo
#
--
echo
# MDEV-14434 Wrong result for CHARSET(CONCAT(?,const))
--
echo
#
SET
NAMES
utf8
;
EXECUTE
IMMEDIATE
"SELECT CHARSET(CONCAT(5,_latin1'a'))"
;
EXECUTE
IMMEDIATE
"SELECT CHARSET(CONCAT(?,_latin1'a'))"
USING
5
;
EXECUTE
IMMEDIATE
"SELECT CHARSET(CONCAT(?,_latin1'a'))"
USING
5.5
;
EXECUTE
IMMEDIATE
"SELECT CHARSET(CONCAT(?,_latin1'a'))"
USING
5.5e0
;
EXECUTE
IMMEDIATE
"SELECT CHARSET(CONCAT(?,_latin1'a'))"
USING
TIME
'10:20:30'
;
EXECUTE
IMMEDIATE
"SELECT CHARSET(CONCAT(?,_latin1'a'))"
USING
TIMESTAMP
'2001-01-01 10:20:30'
;
EXECUTE
IMMEDIATE
"SELECT COERCIBILITY(?)"
USING
5
;
EXECUTE
IMMEDIATE
"SELECT COERCIBILITY(?)"
USING
5.5
;
EXECUTE
IMMEDIATE
"SELECT COERCIBILITY(?)"
USING
5.5e0
;
EXECUTE
IMMEDIATE
"SELECT COERCIBILITY(?)"
USING
TIME
'10:20:30'
;
EXECUTE
IMMEDIATE
"SELECT COERCIBILITY(?)"
USING
TIMESTAMP
'2001-01-01 10:20:30'
;
sql/item.cc
View file @
4c2c5ec9
...
...
@@ -3409,6 +3409,7 @@ void Item_param::set_int(longlong i, uint32 max_length_arg)
DBUG_ENTER
(
"Item_param::set_int"
);
value
.
integer
=
(
longlong
)
i
;
state
=
INT_VALUE
;
collation
.
set_numeric
();
max_length
=
max_length_arg
;
decimals
=
0
;
maybe_null
=
0
;
...
...
@@ -3421,6 +3422,7 @@ void Item_param::set_double(double d)
DBUG_ENTER
(
"Item_param::set_double"
);
value
.
real
=
d
;
state
=
REAL_VALUE
;
collation
.
set_numeric
();
max_length
=
DBL_DIG
+
8
;
decimals
=
NOT_FIXED_DEC
;
maybe_null
=
0
;
...
...
@@ -3450,6 +3452,7 @@ void Item_param::set_decimal(const char *str, ulong length)
str2my_decimal
(
E_DEC_FATAL_ERROR
,
str
,
&
decimal_value
,
&
end
);
state
=
DECIMAL_VALUE
;
decimals
=
decimal_value
.
frac
;
collation
.
set_numeric
();
max_length
=
my_decimal_precision_to_length_no_truncation
(
decimal_value
.
precision
(),
decimals
,
unsigned_flag
);
...
...
@@ -3465,6 +3468,7 @@ void Item_param::set_decimal(const my_decimal *dv, bool unsigned_arg)
my_decimal2decimal
(
dv
,
&
decimal_value
);
decimals
=
(
uint8
)
decimal_value
.
frac
;
collation
.
set_numeric
();
unsigned_flag
=
unsigned_arg
;
max_length
=
my_decimal_precision_to_length
(
decimal_value
.
intg
+
decimals
,
decimals
,
unsigned_flag
);
...
...
@@ -3475,6 +3479,7 @@ void Item_param::set_decimal(const my_decimal *dv, bool unsigned_arg)
void
Item_param
::
fix_temporal
(
uint32
max_length_arg
,
uint
decimals_arg
)
{
state
=
TIME_VALUE
;
collation
.
set_numeric
();
max_length
=
max_length_arg
;
decimals
=
decimals_arg
;
fix_type
(
Item
::
DATE_ITEM
);
...
...
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