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
f73efac9
Commit
f73efac9
authored
Feb 05, 2009
by
Ramil Kalimullin
Browse files
Options
Browse Files
Download
Plain Diff
Auto-merge
parents
a0d88146
91d23568
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
6 deletions
+33
-6
mysql-test/r/func_misc.result
mysql-test/r/func_misc.result
+5
-0
mysql-test/t/func_misc.test
mysql-test/t/func_misc.test
+9
-0
sql/item.cc
sql/item.cc
+19
-6
No files found.
mysql-test/r/func_misc.result
View file @
f73efac9
...
@@ -324,6 +324,11 @@ select @my_uuid_date - @my_uuid_synthetic;
...
@@ -324,6 +324,11 @@ select @my_uuid_date - @my_uuid_synthetic;
@my_uuid_date - @my_uuid_synthetic
@my_uuid_date - @my_uuid_synthetic
0
0
set @@session.time_zone=@save_tz;
set @@session.time_zone=@save_tz;
CREATE TABLE t1 (a DATE);
SELECT * FROM t1 WHERE a = NAME_CONST('reportDate',
_binary'2009-01-09' COLLATE 'binary');
a
DROP TABLE t1;
End of 5.0 tests
End of 5.0 tests
select connection_id() > 0;
select connection_id() > 0;
connection_id() > 0
connection_id() > 0
...
...
mysql-test/t/func_misc.test
View file @
f73efac9
...
@@ -445,6 +445,15 @@ select @my_uuid_date - @my_uuid_synthetic;
...
@@ -445,6 +445,15 @@ select @my_uuid_date - @my_uuid_synthetic;
set
@@
session
.
time_zone
=@
save_tz
;
set
@@
session
.
time_zone
=@
save_tz
;
#
# Bug#42014: Crash, name_const with collate
#
CREATE
TABLE
t1
(
a
DATE
);
SELECT
*
FROM
t1
WHERE
a
=
NAME_CONST
(
'reportDate'
,
_binary
'2009-01-09'
COLLATE
'binary'
);
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
#
#
...
...
sql/item.cc
View file @
f73efac9
...
@@ -1274,13 +1274,26 @@ Item::Type Item_name_const::type() const
...
@@ -1274,13 +1274,26 @@ Item::Type Item_name_const::type() const
valid_args guarantees value_item->basic_const_item(); if type is
valid_args guarantees value_item->basic_const_item(); if type is
FUNC_ITEM, then we have a fudged item_func_neg() on our hands
FUNC_ITEM, then we have a fudged item_func_neg() on our hands
and return the underlying type.
and return the underlying type.
For Item_func_set_collation()
e.g. NAME_CONST('name', 'value' COLLATE collation) we return its
'value' argument type.
*/
*/
return
valid_args
?
if
(
!
valid_args
)
(((
value_item
->
type
()
==
FUNC_ITEM
)
&&
return
NULL_ITEM
;
(((
Item_func
*
)
value_item
)
->
functype
()
==
Item_func
::
NEG_FUNC
))
?
Item
::
Type
value_type
=
value_item
->
type
();
((
Item_func
*
)
value_item
)
->
key_item
()
->
type
()
:
if
(
value_type
==
FUNC_ITEM
)
value_item
->
type
())
:
{
NULL_ITEM
;
/*
The second argument of NAME_CONST('name', 'value') must be
a simple constant item or a NEG_FUNC/COLLATE_FUNC.
*/
DBUG_ASSERT
(((
Item_func
*
)
value_item
)
->
functype
()
==
Item_func
::
NEG_FUNC
||
((
Item_func
*
)
value_item
)
->
functype
()
==
Item_func
::
COLLATE_FUNC
);
return
((
Item_func
*
)
value_item
)
->
key_item
()
->
type
();
}
return
value_type
;
}
}
...
...
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