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
6022c31a
Commit
6022c31a
authored
Mar 15, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for Bug#3183
parent
857b5957
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
0 deletions
+50
-0
mysql-test/r/index_merge.result
mysql-test/r/index_merge.result
+20
-0
mysql-test/t/index_merge.test
mysql-test/t/index_merge.test
+10
-0
sql/opt_range.h
sql/opt_range.h
+9
-0
sql/sql_delete.cc
sql/sql_delete.cc
+7
-0
sql/sql_update.cc
sql/sql_update.cc
+4
-0
No files found.
mysql-test/r/index_merge.result
View file @
6022c31a
...
@@ -314,4 +314,24 @@ key1 key2 key3 key4 key5 key6 key7 key8 key9 keyA keyB keyC
...
@@ -314,4 +314,24 @@ key1 key2 key3 key4 key5 key6 key7 key8 key9 keyA keyB keyC
11 11 11 11 11 11 11 1013 11 11 11 11
11 11 11 11 11 11 11 1013 11 11 11 11
12 12 12 12 12 12 12 1012 12 12 12 12
12 12 12 12 12 12 12 1012 12 12 12 12
1016 1016 1016 1016 1016 1016 1016 8 1016 1016 1016 1016
1016 1016 1016 1016 1016 1016 1016 8 1016 1016 1016 1016
explain select * from t0 where key1 < 3 or key2 < 4;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 index_merge i1,i2 i1,i2 4,4 NULL 7 Using where
select * from t0 where key1 < 3 or key2 < 4;
key1 key2 key3 key4 key5 key6 key7 key8
1 1 1 1 1 1 1 1023
2 2 2 2 2 2 2 1022
3 3 3 3 3 3 3 1021
update t0 set key8=123 where key1 < 3 or key2 < 4;
select * from t0 where key1 < 3 or key2 < 4;
key1 key2 key3 key4 key5 key6 key7 key8
1 1 1 1 1 1 1 123
2 2 2 2 2 2 2 123
3 3 3 3 3 3 3 123
delete from t0 where key1 < 3 or key2 < 4;
select * from t0 where key1 < 3 or key2 < 4;
key1 key2 key3 key4 key5 key6 key7 key8
select count(*) from t0;
count(*)
1021
drop table t0, t1, t2, t3, t4;
drop table t0, t1, t2, t3, t4;
mysql-test/t/index_merge.test
View file @
6022c31a
...
@@ -267,5 +267,15 @@ select * from t3 where
...
@@ -267,5 +267,15 @@ select * from t3 where
key5
=
5
or
key6
=
6
or
key7
=
7
or
key8
=
8
or
key5
=
5
or
key6
=
6
or
key7
=
7
or
key8
=
8
or
key9
=
9
or
keyA
=
10
or
keyB
=
11
or
keyC
=
12
;
key9
=
9
or
keyA
=
10
or
keyB
=
11
or
keyC
=
12
;
# Test for Bug#3183
explain
select
*
from
t0
where
key1
<
3
or
key2
<
4
;
select
*
from
t0
where
key1
<
3
or
key2
<
4
;
update
t0
set
key8
=
123
where
key1
<
3
or
key2
<
4
;
select
*
from
t0
where
key1
<
3
or
key2
<
4
;
delete
from
t0
where
key1
<
3
or
key2
<
4
;
select
*
from
t0
where
key1
<
3
or
key2
<
4
;
select
count
(
*
)
from
t0
;
drop
table
t0
,
t1
,
t2
,
t3
,
t4
;
drop
table
t0
,
t1
,
t2
,
t3
,
t4
;
sql/opt_range.h
View file @
6022c31a
...
@@ -87,7 +87,16 @@ class QUICK_SELECT_I
...
@@ -87,7 +87,16 @@ class QUICK_SELECT_I
QUICK_SELECT_I
();
QUICK_SELECT_I
();
virtual
~
QUICK_SELECT_I
(){};
virtual
~
QUICK_SELECT_I
(){};
/*
Call init() immediately after creation of quick select. if init() call
fails, reset() or get_next() must not be called.
*/
virtual
int
init
()
=
0
;
virtual
int
init
()
=
0
;
/*
Call reset() before first get_next call. get_next must not be called if
reset() call fails.
*/
virtual
int
reset
(
void
)
=
0
;
virtual
int
reset
(
void
)
=
0
;
virtual
int
get_next
()
=
0
;
/* get next record to retrieve */
virtual
int
get_next
()
=
0
;
/* get next record to retrieve */
virtual
bool
reverse_sorted
()
=
0
;
virtual
bool
reverse_sorted
()
=
0
;
...
...
sql/sql_delete.cc
View file @
6022c31a
...
@@ -150,6 +150,13 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, SQL_LIST *order,
...
@@ -150,6 +150,13 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, SQL_LIST *order,
select
=
0
;
select
=
0
;
}
}
/* If quick select is used, initialize it before retrieving rows. */
if
(
select
&&
select
->
quick
&&
select
->
quick
->
reset
())
{
delete
select
;
free_underlaid_joins
(
thd
,
&
thd
->
lex
->
select_lex
);
DBUG_RETURN
(
-
1
);
// This will force out message
}
init_read_record
(
&
info
,
thd
,
table
,
select
,
1
,
1
);
init_read_record
(
&
info
,
thd
,
table
,
select
,
1
,
1
);
deleted
=
0L
;
deleted
=
0L
;
init_ftfuncs
(
thd
,
&
thd
->
lex
->
select_lex
,
1
);
init_ftfuncs
(
thd
,
&
thd
->
lex
->
select_lex
,
1
);
...
...
sql/sql_update.cc
View file @
6022c31a
...
@@ -246,7 +246,11 @@ int mysql_update(THD *thd,
...
@@ -246,7 +246,11 @@ int mysql_update(THD *thd,
DISK_BUFFER_SIZE
,
MYF
(
MY_WME
)))
DISK_BUFFER_SIZE
,
MYF
(
MY_WME
)))
goto
err
;
goto
err
;
/* If quick select is used, initialize it before retrieving rows. */
if
(
select
&&
select
->
quick
&&
select
->
quick
->
reset
())
goto
err
;
init_read_record
(
&
info
,
thd
,
table
,
select
,
0
,
1
);
init_read_record
(
&
info
,
thd
,
table
,
select
,
0
,
1
);
thd
->
proc_info
=
"Searching rows for update"
;
thd
->
proc_info
=
"Searching rows for update"
;
uint
tmp_limit
=
limit
;
uint
tmp_limit
=
limit
;
...
...
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