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
ce8b60b4
Commit
ce8b60b4
authored
Jun 12, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge moonbone.local:/work/16716-bug-4.1-mysql
into moonbone.local:/work/16716-bug-4.1-opt-mysql
parents
1991a87d
a9824f26
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
83 additions
and
4 deletions
+83
-4
mysql-test/r/func_in.result
mysql-test/r/func_in.result
+21
-0
mysql-test/r/multi_update.result
mysql-test/r/multi_update.result
+5
-0
mysql-test/t/func_in.test
mysql-test/t/func_in.test
+12
-0
mysql-test/t/multi_update.test
mysql-test/t/multi_update.test
+8
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+35
-2
sql/sql_parse.cc
sql/sql_parse.cc
+2
-2
No files found.
mysql-test/r/func_in.result
View file @
ce8b60b4
...
@@ -202,3 +202,24 @@ select count(*) from t1 where id not in (1,2);
...
@@ -202,3 +202,24 @@ select count(*) from t1 where id not in (1,2);
count(*)
count(*)
1
1
drop table t1;
drop table t1;
create table t1 (f1 char(1), f2 int);
insert into t1 values (1,0),('a',1),('z',2);
select f1 from t1 where f1 in (1,'z');
f1
1
z
select f2 from t1 where f2 in (1,'z');
f2
0
1
select f1 from t1 where 'z' in (1,f1);
f1
z
select * from t1 where 'z' in (f2,f1);
f1 f2
z 2
select * from t1 where 1 in (f2,f1);
f1 f2
1 0
a 1
drop table t1;
mysql-test/r/multi_update.result
View file @
ce8b60b4
...
@@ -475,3 +475,8 @@ aclid bigint, index idx_acl(aclid)
...
@@ -475,3 +475,8 @@ aclid bigint, index idx_acl(aclid)
insert into t2 values(1,null);
insert into t2 values(1,null);
delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1';
delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1';
drop table t1, t2;
drop table t1, t2;
create table t1(a int);
create table t2(a int);
delete from t1,t2 using t1,t2 where t1.a=(select a from t1);
ERROR HY000: You can't specify target table 't1' for update in FROM clause
drop table t1, t2;
mysql-test/t/func_in.test
View file @
ce8b60b4
...
@@ -109,4 +109,16 @@ select count(*) from t1 where id not in (1);
...
@@ -109,4 +109,16 @@ select count(*) from t1 where id not in (1);
select
count
(
*
)
from
t1
where
id
not
in
(
1
,
2
);
select
count
(
*
)
from
t1
where
id
not
in
(
1
,
2
);
drop
table
t1
;
drop
table
t1
;
#
# Bug#18360 Incorrect type coercion in IN() results in false comparison
#
create
table
t1
(
f1
char
(
1
),
f2
int
);
insert
into
t1
values
(
1
,
0
),(
'a'
,
1
),(
'z'
,
2
);
select
f1
from
t1
where
f1
in
(
1
,
'z'
);
select
f2
from
t1
where
f2
in
(
1
,
'z'
);
select
f1
from
t1
where
'z'
in
(
1
,
f1
);
select
*
from
t1
where
'z'
in
(
f2
,
f1
);
select
*
from
t1
where
1
in
(
f2
,
f1
);
drop
table
t1
;
# End of 4.1 tests
# End of 4.1 tests
mysql-test/t/multi_update.test
View file @
ce8b60b4
...
@@ -448,4 +448,12 @@ insert into t2 values(1,null);
...
@@ -448,4 +448,12 @@ insert into t2 values(1,null);
delete
t2
,
t1
from
t2
left
join
t1
on
(
t2
.
aclid
=
t1
.
aclid
)
where
t2
.
refid
=
'1'
;
delete
t2
,
t1
from
t2
left
join
t1
on
(
t2
.
aclid
=
t1
.
aclid
)
where
t2
.
refid
=
'1'
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
#
# Bug#19225: unchecked error leads to server crash
#
create
table
t1
(
a
int
);
create
table
t2
(
a
int
);
--
error
1093
delete
from
t1
,
t2
using
t1
,
t2
where
t1
.
a
=
(
select
a
from
t1
);
drop
table
t1
,
t2
;
# End of 4.1 tests
# End of 4.1 tests
sql/item_cmpfunc.cc
View file @
ce8b60b4
...
@@ -58,12 +58,45 @@ static void agg_result_type(Item_result *type, Item **items, uint nitems)
...
@@ -58,12 +58,45 @@ static void agg_result_type(Item_result *type, Item **items, uint nitems)
}
}
}
}
/*
Aggregates result types from the array of items.
SYNOPSIS:
agg_cmp_type()
type [out] the aggregated type
items array of items to aggregate the type from
nitems number of items in the array
DESCRIPTION
This function aggregates result types from the array of items. Found type
supposed to be used later for comparison of values of these items.
Aggregation itself is performed by the item_cmp_type() function.
NOTES
Aggregation rules:
If all items are constants the type will be aggregated from all items.
If there are some non-constant items then only types of non-constant
items will be used for aggregation.
*/
static
void
agg_cmp_type
(
Item_result
*
type
,
Item
**
items
,
uint
nitems
)
static
void
agg_cmp_type
(
Item_result
*
type
,
Item
**
items
,
uint
nitems
)
{
{
uint
i
;
uint
i
;
type
[
0
]
=
items
[
0
]
->
result_type
();
type
[
0
]
=
items
[
0
]
->
result_type
();
for
(
i
=
1
;
i
<
nitems
;
i
++
)
/* Reset to 0 on first occurence of non-const item. 1 otherwise */
type
[
0
]
=
item_cmp_type
(
type
[
0
],
items
[
i
]
->
result_type
());
bool
is_const
=
items
[
0
]
->
const_item
();
for
(
i
=
1
;
i
<
nitems
;
i
++
)
{
if
(
!
items
[
i
]
->
const_item
())
{
type
[
0
]
=
is_const
?
items
[
i
]
->
result_type
()
:
item_cmp_type
(
type
[
0
],
items
[
i
]
->
result_type
());
is_const
=
0
;
}
else
if
(
is_const
)
type
[
0
]
=
item_cmp_type
(
type
[
0
],
items
[
i
]
->
result_type
());
}
}
}
static
void
my_coll_agg_error
(
DTCollation
&
c1
,
DTCollation
&
c2
,
static
void
my_coll_agg_error
(
DTCollation
&
c1
,
DTCollation
&
c2
,
...
...
sql/sql_parse.cc
View file @
ce8b60b4
...
@@ -3047,8 +3047,8 @@ unsent_create_error:
...
@@ -3047,8 +3047,8 @@ unsent_create_error:
}
}
}
}
if
(
!
thd
->
is_fatal_error
&&
(
result
=
new
multi_delete
(
thd
,
aux_tables
,
if
(
!
res
&&
!
thd
->
is_fatal_error
&&
table_count
)))
(
result
=
new
multi_delete
(
thd
,
aux_tables
,
table_count
)))
{
{
res
=
mysql_select
(
thd
,
&
select_lex
->
ref_pointer_array
,
res
=
mysql_select
(
thd
,
&
select_lex
->
ref_pointer_array
,
select_lex
->
get_table_list
(),
select_lex
->
get_table_list
(),
...
...
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