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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
97562d74
Commit
97562d74
authored
Jun 13, 2006
by
ramil@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #12728: Very strange behaviour of ELT
parent
e09910f9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
0 deletions
+27
-0
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+7
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+8
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+11
-0
sql/item_strfunc.h
sql/item_strfunc.h
+1
-0
No files found.
mysql-test/r/func_str.result
View file @
97562d74
...
...
@@ -436,3 +436,10 @@ id aes_decrypt(str, 'bar')
1 foo
2 NULL
DROP TABLE t1, t2;
create table t1(a varchar(8), primary key(a));
insert into t1 values('bar'), ('foo');
select a from t1 where a=elt(1, 'foo', 'bar') or a=elt(2, 'foo', 'bar');
a
bar
foo
drop table t1;
mysql-test/t/func_str.test
View file @
97562d74
...
...
@@ -254,3 +254,11 @@ SELECT t1.id, aes_decrypt(str, 'bar') FROM t1, t2 WHERE t1.id = t2.id
DROP
TABLE
t1
,
t2
;
#
# Bug #12728: strange elt() behavior
#
create
table
t1
(
a
varchar
(
8
),
primary
key
(
a
));
insert
into
t1
values
(
'bar'
),
(
'foo'
);
select
a
from
t1
where
a
=
elt
(
1
,
'foo'
,
'bar'
)
or
a
=
elt
(
2
,
'foo'
,
'bar'
);
drop
table
t1
;
sql/item_strfunc.cc
View file @
97562d74
...
...
@@ -1599,6 +1599,17 @@ String *Item_func_elt::val_str(String *str)
}
bool
Item_func_elt
::
eq
(
const
Item
*
par_item
,
bool
binary_cmp
)
const
{
/*
We can use (Item_func_elt*) typecast here because the check is done
in the Item_func::eq().
*/
return
Item_func
::
eq
(
par_item
,
binary_cmp
)
&&
item
->
eq
(((
Item_func_elt
*
)
par_item
)
->
item
,
binary_cmp
);
}
void
Item_func_make_set
::
split_sum_func
(
List
<
Item
>
&
fields
)
{
if
(
item
->
with_sum_func
&&
item
->
type
()
!=
SUM_FUNC_ITEM
)
...
...
sql/item_strfunc.h
View file @
97562d74
...
...
@@ -372,6 +372,7 @@ public:
void
fix_length_and_dec
();
void
update_used_tables
();
const
char
*
func_name
()
const
{
return
"elt"
;
}
bool
eq
(
const
Item
*
par_item
,
bool
binary_cmp
)
const
;
unsigned
int
size_of
()
{
return
sizeof
(
*
this
);}
};
...
...
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