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
6164613f
Commit
6164613f
authored
17 years ago
by
ramil/ram@ramil.myoffice.izhnet.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/ram/work/b32559/b32559.5.0
into mysql.com:/home/ram/work/b32559/b32559.5.1
parents
98b2f62d
ac034767
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
2 deletions
+32
-2
mysql-test/r/func_misc.result
mysql-test/r/func_misc.result
+7
-0
mysql-test/t/func_misc.test
mysql-test/t/func_misc.test
+11
-0
sql/item.cc
sql/item.cc
+11
-1
sql/item.h
sql/item.h
+3
-1
No files found.
mysql-test/r/func_misc.result
View file @
6164613f
...
...
@@ -212,6 +212,13 @@ test
SELECT NAME_CONST('test', 'test');
test
test
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (), (), ();
SELECT NAME_CONST(a, '1') FROM t1;
ERROR HY000: Incorrect arguments to NAME_CONST
SET INSERT_ID= NAME_CONST(a, a);
ERROR HY000: Incorrect arguments to NAME_CONST
DROP TABLE t1;
End of 5.0 tests
select connection_id() > 0;
connection_id() > 0
...
...
This diff is collapsed.
Click to expand it.
mysql-test/t/func_misc.test
View file @
6164613f
...
...
@@ -213,6 +213,17 @@ SELECT NAME_CONST('test', 1.0);
SELECT
NAME_CONST
(
'test'
,
-
1.0
);
SELECT
NAME_CONST
(
'test'
,
'test'
);
#
# Bug #32559: connection hangs on query with name_const
#
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(),
(),
();
--
error
ER_WRONG_ARGUMENTS
SELECT
NAME_CONST
(
a
,
'1'
)
FROM
t1
;
--
error
ER_WRONG_ARGUMENTS
SET
INSERT_ID
=
NAME_CONST
(
a
,
a
);
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
#
...
...
This diff is collapsed.
Click to expand it.
sql/item.cc
View file @
6164613f
...
...
@@ -1240,7 +1240,17 @@ bool Item_name_const::is_null()
Item
::
Type
Item_name_const
::
type
()
const
{
return
value_item
->
type
();
/*
As
1. one can try to create the Item_name_const passing non-constant
arguments, although it's incorrect and
2. the type() method can be called before the fix_fields() to get
type information for a further type cast, e.g.
if (item->type() == FIELD_ITEM)
((Item_field *) item)->...
we return NULL_ITEM in the case to avoid wrong casting.
*/
return
valid_args
?
value_item
->
type
()
:
NULL_ITEM
;
}
...
...
This diff is collapsed.
Click to expand it.
sql/item.h
View file @
6164613f
...
...
@@ -1242,11 +1242,13 @@ class Item_name_const : public Item
{
Item
*
value_item
;
Item
*
name_item
;
bool
valid_args
;
public:
Item_name_const
(
Item
*
name_arg
,
Item
*
val
)
:
value_item
(
val
),
name_item
(
name_arg
)
{
if
(
!
value_item
->
basic_const_item
())
if
(
!
(
valid_args
=
name_item
->
basic_const_item
()
&
value_item
->
basic_const_item
()))
my_error
(
ER_WRONG_ARGUMENTS
,
MYF
(
0
),
"NAME_CONST"
);
Item
::
maybe_null
=
TRUE
;
}
...
...
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