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
b30fb701
Commit
b30fb701
authored
Apr 04, 2019
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.1 into 10.2
parents
f6023857
71a2e6a3
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
34 additions
and
5 deletions
+34
-5
mysql-test/include/index_merge1.inc
mysql-test/include/index_merge1.inc
+4
-0
mysql-test/include/index_merge2.inc
mysql-test/include/index_merge2.inc
+8
-0
mysql-test/include/index_merge_2sweeps.inc
mysql-test/include/index_merge_2sweeps.inc
+2
-0
mysql-test/include/index_merge_ror.inc
mysql-test/include/index_merge_ror.inc
+8
-0
mysql-test/include/index_merge_ror_cpk.inc
mysql-test/include/index_merge_ror_cpk.inc
+2
-2
mysql-test/r/index_merge_innodb.result
mysql-test/r/index_merge_innodb.result
+5
-0
mysql-test/r/index_merge_myisam.result
mysql-test/r/index_merge_myisam.result
+3
-0
mysql-test/t/index_merge_innodb.test
mysql-test/t/index_merge_innodb.test
+2
-0
sql/item_func.h
sql/item_func.h
+0
-1
sql/sql_class.h
sql/sql_class.h
+0
-1
sql/sql_load.cc
sql/sql_load.cc
+0
-1
No files found.
mysql-test/include/index_merge1.inc
View file @
b30fb701
...
@@ -37,12 +37,14 @@ insert into t0 values (1),(2),(3),(4),(5),(6),(7),(8);
...
@@ -37,12 +37,14 @@ insert into t0 values (1),(2),(3),(4),(5),(6),(7),(8);
let
$
1
=
7
;
let
$
1
=
7
;
set
@
d
=
8
;
set
@
d
=
8
;
begin
;
while
(
$
1
)
while
(
$
1
)
{
{
eval
insert
into
t0
select
key1
+@
d
from
t0
;
eval
insert
into
t0
select
key1
+@
d
from
t0
;
eval
set
@
d
=@
d
*
2
;
eval
set
@
d
=@
d
*
2
;
dec
$
1
;
dec
$
1
;
}
}
commit
;
--
enable_query_log
--
enable_query_log
alter
table
t0
add
key2
int
not
null
,
add
index
i2
(
key2
);
alter
table
t0
add
key2
int
not
null
,
add
index
i2
(
key2
);
...
@@ -362,6 +364,7 @@ INSERT INTO t1 VALUES ('foo','bar', 'ZZ'),('fuz','baz', 'ZZ');
...
@@ -362,6 +364,7 @@ INSERT INTO t1 VALUES ('foo','bar', 'ZZ'),('fuz','baz', 'ZZ');
--
disable_query_log
--
disable_query_log
let
$
1
=
9
;
let
$
1
=
9
;
begin
;
while
(
$
1
)
while
(
$
1
)
{
{
eval
INSERT
INTO
t1
SELECT
*
from
t1
WHERE
cola
=
'foo'
;
eval
INSERT
INTO
t1
SELECT
*
from
t1
WHERE
cola
=
'foo'
;
...
@@ -374,6 +377,7 @@ while ($1)
...
@@ -374,6 +377,7 @@ while ($1)
eval
INSERT
INTO
t1
SELECT
*
from
t1
WHERE
cola
<>
'foo'
;
eval
INSERT
INTO
t1
SELECT
*
from
t1
WHERE
cola
<>
'foo'
;
dec
$
1
;
dec
$
1
;
}
}
commit
;
--
enable_query_log
--
enable_query_log
...
...
mysql-test/include/index_merge2.inc
View file @
b30fb701
...
@@ -34,11 +34,13 @@ create table t1
...
@@ -34,11 +34,13 @@ create table t1
--
disable_query_log
--
disable_query_log
let
$
1
=
200
;
let
$
1
=
200
;
begin
;
while
(
$
1
)
while
(
$
1
)
{
{
eval
insert
into
t1
values
(
200
-
$
1
,
$
1
);
eval
insert
into
t1
values
(
200
-
$
1
,
$
1
);
dec
$
1
;
dec
$
1
;
}
}
commit
;
--
enable_query_log
--
enable_query_log
# No primary key
# No primary key
...
@@ -80,11 +82,13 @@ create table t1 (
...
@@ -80,11 +82,13 @@ create table t1 (
show
warnings
;
show
warnings
;
--
disable_query_log
--
disable_query_log
let
$
1
=
30
;
let
$
1
=
30
;
begin
;
while
(
$
1
)
while
(
$
1
)
{
{
eval
insert
into
t1
(
key1
,
key2
,
filler
)
values
(
$
1
/
4
,
$
1
/
8
,
'filler-data'
);
eval
insert
into
t1
(
key1
,
key2
,
filler
)
values
(
$
1
/
4
,
$
1
/
8
,
'filler-data'
);
dec
$
1
;
dec
$
1
;
}
}
commit
;
--
enable_query_log
--
enable_query_log
explain
select
pk
from
t1
where
key1
=
1
and
key2
=
1
;
explain
select
pk
from
t1
where
key1
=
1
and
key2
=
1
;
select
pk
from
t1
where
key2
=
1
and
key1
=
1
;
select
pk
from
t1
where
key2
=
1
and
key1
=
1
;
...
@@ -331,16 +335,20 @@ insert into t1(key1) values (1),(2),(3),(4),(5),(6),(7),(8);
...
@@ -331,16 +335,20 @@ insert into t1(key1) values (1),(2),(3),(4),(5),(6),(7),(8);
let
$
1
=
7
;
let
$
1
=
7
;
set
@
d
=
8
;
set
@
d
=
8
;
begin
;
while
(
$
1
)
while
(
$
1
)
{
{
eval
insert
into
t1
(
key1
)
select
key1
+@
d
from
t1
;
eval
insert
into
t1
(
key1
)
select
key1
+@
d
from
t1
;
eval
set
@
d
=@
d
*
2
;
eval
set
@
d
=@
d
*
2
;
dec
$
1
;
dec
$
1
;
}
}
commit
;
alter
table
t1
add
index
i2
(
key2
);
alter
table
t1
add
index
i2
(
key2
);
alter
table
t1
add
index
i3
(
key3
);
alter
table
t1
add
index
i3
(
key3
);
update
t1
set
key2
=
key1
,
key3
=
key1
;
update
t1
set
key2
=
key1
,
key3
=
key1
;
insert
into
t1
select
10000
+
key1
,
10000
+
key2
,
10000
+
key3
from
t1
;
analyze
table
t1
;
analyze
table
t1
;
# to test the bug, the following must use "sort_union":
# to test the bug, the following must use "sort_union":
...
...
mysql-test/include/index_merge_2sweeps.inc
View file @
b30fb701
...
@@ -32,12 +32,14 @@ create table t1 (
...
@@ -32,12 +32,14 @@ create table t1 (
--
disable_query_log
--
disable_query_log
begin
;
let
$
1
=
1000
;
let
$
1
=
1000
;
while
(
$
1
)
while
(
$
1
)
{
{
eval
insert
into
t1
values
(
$
1
,
$
1
,
$
1
,
'filler-data'
,
'filler-data-2'
);
eval
insert
into
t1
values
(
$
1
,
$
1
,
$
1
,
'filler-data'
,
'filler-data-2'
);
dec
$
1
;
dec
$
1
;
}
}
commit
;
--
enable_query_log
--
enable_query_log
select
*
from
t1
where
(
key1
>=
2
and
key1
<=
10
)
or
(
pk
>=
4
and
pk
<=
8
);
select
*
from
t1
where
(
key1
>=
2
and
key1
<=
10
)
or
(
pk
>=
4
and
pk
<=
8
);
...
...
mysql-test/include/index_merge_ror.inc
View file @
b30fb701
...
@@ -67,18 +67,21 @@ create table t1
...
@@ -67,18 +67,21 @@ create table t1
create
table
t0
as
select
*
from
t1
;
create
table
t0
as
select
*
from
t1
;
--
disable_query_log
--
disable_query_log
--
echo
# Printing of many insert into t0 values (....) disabled.
--
echo
# Printing of many insert into t0 values (....) disabled.
begin
;
let
$cnt
=
1000
;
let
$cnt
=
1000
;
while
(
$cnt
)
while
(
$cnt
)
{
{
eval
insert
into
t0
values
(
1
,
2
,
3
,
1
,
2
,
3
,
0
,
0
,
0
,
0
,
'data1'
,
'data2'
,
'data3'
,
'data4'
,
'data5'
,
'data6'
);
eval
insert
into
t0
values
(
1
,
2
,
3
,
1
,
2
,
3
,
0
,
0
,
0
,
0
,
'data1'
,
'data2'
,
'data3'
,
'data4'
,
'data5'
,
'data6'
);
dec
$cnt
;
dec
$cnt
;
}
}
commit
;
--
enable_query_log
--
enable_query_log
alter
table
t1
disable
keys
;
alter
table
t1
disable
keys
;
--
disable_query_log
--
disable_query_log
--
echo
# Printing of many insert into t1 select .... from t0 disabled.
--
echo
# Printing of many insert into t1 select .... from t0 disabled.
let
$
1
=
4
;
let
$
1
=
4
;
begin
;
while
(
$
1
)
while
(
$
1
)
{
{
let
$
2
=
4
;
let
$
2
=
4
;
...
@@ -94,6 +97,7 @@ while ($1)
...
@@ -94,6 +97,7 @@ while ($1)
}
}
dec
$
1
;
dec
$
1
;
}
}
commit
;
--
echo
# Printing of many insert into t1 (...) values (....) disabled.
--
echo
# Printing of many insert into t1 (...) values (....) disabled.
# Row retrieval tests
# Row retrieval tests
...
@@ -101,6 +105,7 @@ while ($1)
...
@@ -101,6 +105,7 @@ while ($1)
# insert enough rows for index intersection to be used for (key1,key2)
# insert enough rows for index intersection to be used for (key1,key2)
insert
into
t1
(
key1
,
key2
,
key3
,
key4
,
filler1
)
values
(
100
,
100
,
100
,
100
,
'key1-key2-key3-key4'
);
insert
into
t1
(
key1
,
key2
,
key3
,
key4
,
filler1
)
values
(
100
,
100
,
100
,
100
,
'key1-key2-key3-key4'
);
let
$cnt
=
400
;
let
$cnt
=
400
;
begin
;
while
(
$cnt
)
while
(
$cnt
)
{
{
eval
insert
into
t1
(
key1
,
key2
,
key3
,
key4
,
filler1
)
values
(
100
,
-
1
,
100
,
-
1
,
'key1-key3'
);
eval
insert
into
t1
(
key1
,
key2
,
key3
,
key4
,
filler1
)
values
(
100
,
-
1
,
100
,
-
1
,
'key1-key3'
);
...
@@ -112,6 +117,7 @@ while ($cnt)
...
@@ -112,6 +117,7 @@ while ($cnt)
eval
insert
into
t1
(
key1
,
key2
,
key3
,
key4
,
filler1
)
values
(
-
1
,
100
,
-
1
,
100
,
'key2-key4'
);
eval
insert
into
t1
(
key1
,
key2
,
key3
,
key4
,
filler1
)
values
(
-
1
,
100
,
-
1
,
100
,
'key2-key4'
);
dec
$cnt
;
dec
$cnt
;
}
}
commit
;
--
enable_query_log
--
enable_query_log
alter
table
t1
enable
keys
;
alter
table
t1
enable
keys
;
select
count
(
*
)
from
t1
;
select
count
(
*
)
from
t1
;
...
@@ -249,6 +255,7 @@ create table t2 (
...
@@ -249,6 +255,7 @@ create table t2 (
--
disable_query_log
--
disable_query_log
let
$
1
=
8
;
let
$
1
=
8
;
begin
;
while
(
$
1
)
while
(
$
1
)
{
{
eval
insert
into
t2
values
(
repeat
(
char
(
$
1
+
64
),
8
),
repeat
(
char
(
$
1
+
64
),
8
),
'filler1'
,
'filler2'
);
eval
insert
into
t2
values
(
repeat
(
char
(
$
1
+
64
),
8
),
repeat
(
char
(
$
1
+
64
),
8
),
'filler1'
,
'filler2'
);
...
@@ -256,6 +263,7 @@ while ($1)
...
@@ -256,6 +263,7 @@ while ($1)
}
}
insert
into
t2
select
*
from
t2
;
insert
into
t2
select
*
from
t2
;
insert
into
t2
select
*
from
t2
;
insert
into
t2
select
*
from
t2
;
commit
;
--
enable_query_log
--
enable_query_log
# The table row buffer is reused. Fill it with rows that don't match.
# The table row buffer is reused. Fill it with rows that don't match.
...
...
mysql-test/include/index_merge_ror_cpk.inc
View file @
b30fb701
...
@@ -56,14 +56,14 @@ create table t1
...
@@ -56,14 +56,14 @@ create table t1
);
);
--
disable_query_log
--
disable_query_log
set
autocommit
=
0
;
begin
;
let
$
1
=
10000
;
let
$
1
=
10000
;
while
(
$
1
)
while
(
$
1
)
{
{
eval
insert
into
t1
values
(
$
1
div
10
,
$
1
mod
100
,
$
1
/
100
,
$
1
/
100
,
$
1
/
100
,
$
1
/
100
,
$
1
/
100
,
$
1
/
100
,
$
1
/
100
,
$
1
mod
100
,
$
1
/
1000
,
'filler-data-$1'
,
'filler2'
);
eval
insert
into
t1
values
(
$
1
div
10
,
$
1
mod
100
,
$
1
/
100
,
$
1
/
100
,
$
1
/
100
,
$
1
/
100
,
$
1
/
100
,
$
1
/
100
,
$
1
/
100
,
$
1
mod
100
,
$
1
/
1000
,
'filler-data-$1'
,
'filler2'
);
dec
$
1
;
dec
$
1
;
}
}
set
autocommit
=
1
;
commit
;
--
enable_query_log
--
enable_query_log
# Verify that range scan on CPK is ROR
# Verify that range scan on CPK is ROR
...
...
mysql-test/r/index_merge_innodb.result
View file @
b30fb701
...
@@ -294,6 +294,7 @@ key3 int not null default 0
...
@@ -294,6 +294,7 @@ key3 int not null default 0
);
);
insert into t1(key1) values (1),(2),(3),(4),(5),(6),(7),(8);
insert into t1(key1) values (1),(2),(3),(4),(5),(6),(7),(8);
set @d=8;
set @d=8;
begin;
insert into t1 (key1) select key1+@d from t1;
insert into t1 (key1) select key1+@d from t1;
set @d=@d*2;
set @d=@d*2;
insert into t1 (key1) select key1+@d from t1;
insert into t1 (key1) select key1+@d from t1;
...
@@ -308,9 +309,11 @@ insert into t1 (key1) select key1+@d from t1;
...
@@ -308,9 +309,11 @@ insert into t1 (key1) select key1+@d from t1;
set @d=@d*2;
set @d=@d*2;
insert into t1 (key1) select key1+@d from t1;
insert into t1 (key1) select key1+@d from t1;
set @d=@d*2;
set @d=@d*2;
commit;
alter table t1 add index i2(key2);
alter table t1 add index i2(key2);
alter table t1 add index i3(key3);
alter table t1 add index i3(key3);
update t1 set key2=key1,key3=key1;
update t1 set key2=key1,key3=key1;
insert into t1 select 10000+key1, 10000+key2,10000+key3 from t1;
analyze table t1;
analyze table t1;
Table Op Msg_type Msg_text
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze status OK
...
@@ -672,6 +675,7 @@ a int,
...
@@ -672,6 +675,7 @@ a int,
b int,
b int,
INDEX idx(a))
INDEX idx(a))
ENGINE=INNODB;
ENGINE=INNODB;
begin;
INSERT INTO t1(a,b) VALUES
INSERT INTO t1(a,b) VALUES
(11, 1100), (2, 200), (1, 100), (14, 1400), (5, 500),
(11, 1100), (2, 200), (1, 100), (14, 1400), (5, 500),
(3, 300), (17, 1700), (4, 400), (12, 1200), (8, 800),
(3, 300), (17, 1700), (4, 400), (12, 1200), (8, 800),
...
@@ -691,6 +695,7 @@ INSERT INTO t1(a,b) SELECT a,b FROM t1;
...
@@ -691,6 +695,7 @@ INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1 VALUES (1000000, 0, 0);
INSERT INTO t1 VALUES (1000000, 0, 0);
commit;
SET SESSION sort_buffer_size = 1024*36;
SET SESSION sort_buffer_size = 1024*36;
set @tmp_optimizer_switch=@@optimizer_switch;
set @tmp_optimizer_switch=@@optimizer_switch;
set optimizer_switch='derived_merge=off,derived_with_keys=off';
set optimizer_switch='derived_merge=off,derived_with_keys=off';
...
...
mysql-test/r/index_merge_myisam.result
View file @
b30fb701
...
@@ -1132,6 +1132,7 @@ key3 int not null default 0
...
@@ -1132,6 +1132,7 @@ key3 int not null default 0
);
);
insert into t1(key1) values (1),(2),(3),(4),(5),(6),(7),(8);
insert into t1(key1) values (1),(2),(3),(4),(5),(6),(7),(8);
set @d=8;
set @d=8;
begin;
insert into t1 (key1) select key1+@d from t1;
insert into t1 (key1) select key1+@d from t1;
set @d=@d*2;
set @d=@d*2;
insert into t1 (key1) select key1+@d from t1;
insert into t1 (key1) select key1+@d from t1;
...
@@ -1146,9 +1147,11 @@ insert into t1 (key1) select key1+@d from t1;
...
@@ -1146,9 +1147,11 @@ insert into t1 (key1) select key1+@d from t1;
set @d=@d*2;
set @d=@d*2;
insert into t1 (key1) select key1+@d from t1;
insert into t1 (key1) select key1+@d from t1;
set @d=@d*2;
set @d=@d*2;
commit;
alter table t1 add index i2(key2);
alter table t1 add index i2(key2);
alter table t1 add index i3(key3);
alter table t1 add index i3(key3);
update t1 set key2=key1,key3=key1;
update t1 set key2=key1,key3=key1;
insert into t1 select 10000+key1, 10000+key2,10000+key3 from t1;
analyze table t1;
analyze table t1;
Table Op Msg_type Msg_text
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze status OK
...
...
mysql-test/t/index_merge_innodb.test
View file @
b30fb701
...
@@ -46,6 +46,7 @@ CREATE TABLE t1 (
...
@@ -46,6 +46,7 @@ CREATE TABLE t1 (
INDEX
idx
(
a
))
INDEX
idx
(
a
))
ENGINE
=
INNODB
;
ENGINE
=
INNODB
;
begin
;
INSERT
INTO
t1
(
a
,
b
)
VALUES
INSERT
INTO
t1
(
a
,
b
)
VALUES
(
11
,
1100
),
(
2
,
200
),
(
1
,
100
),
(
14
,
1400
),
(
5
,
500
),
(
11
,
1100
),
(
2
,
200
),
(
1
,
100
),
(
14
,
1400
),
(
5
,
500
),
(
3
,
300
),
(
17
,
1700
),
(
4
,
400
),
(
12
,
1200
),
(
8
,
800
),
(
3
,
300
),
(
17
,
1700
),
(
4
,
400
),
(
12
,
1200
),
(
8
,
800
),
...
@@ -65,6 +66,7 @@ INSERT INTO t1(a,b) SELECT a,b FROM t1;
...
@@ -65,6 +66,7 @@ INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT
INTO
t1
(
a
,
b
)
SELECT
a
,
b
FROM
t1
;
INSERT
INTO
t1
(
a
,
b
)
SELECT
a
,
b
FROM
t1
;
INSERT
INTO
t1
(
a
,
b
)
SELECT
a
,
b
FROM
t1
;
INSERT
INTO
t1
(
a
,
b
)
SELECT
a
,
b
FROM
t1
;
INSERT
INTO
t1
VALUES
(
1000000
,
0
,
0
);
INSERT
INTO
t1
VALUES
(
1000000
,
0
,
0
);
commit
;
SET
SESSION
sort_buffer_size
=
1024
*
36
;
SET
SESSION
sort_buffer_size
=
1024
*
36
;
set
@
tmp_optimizer_switch
=@@
optimizer_switch
;
set
@
tmp_optimizer_switch
=@@
optimizer_switch
;
...
...
sql/item_func.h
View file @
b30fb701
...
@@ -1921,7 +1921,6 @@ class Item_func_set_user_var :public Item_func_user_var
...
@@ -1921,7 +1921,6 @@ class Item_func_set_user_var :public Item_func_user_var
user variable it the first connection context).
user variable it the first connection context).
*/
*/
my_thread_id
entry_thread_id
;
my_thread_id
entry_thread_id
;
char
buffer
[
MAX_FIELD_WIDTH
];
String
value
;
String
value
;
my_decimal
decimal_buff
;
my_decimal
decimal_buff
;
bool
null_item
;
bool
null_item
;
...
...
sql/sql_class.h
View file @
b30fb701
...
@@ -4905,7 +4905,6 @@ class select_insert :public select_result_interceptor {
...
@@ -4905,7 +4905,6 @@ class select_insert :public select_result_interceptor {
class
select_create
:
public
select_insert
{
class
select_create
:
public
select_insert
{
ORDER
*
group
;
TABLE_LIST
*
create_table
;
TABLE_LIST
*
create_table
;
Table_specification_st
*
create_info
;
Table_specification_st
*
create_info
;
TABLE_LIST
*
select_tables
;
TABLE_LIST
*
select_tables
;
...
...
sql/sql_load.cc
View file @
b30fb701
...
@@ -167,7 +167,6 @@ class READ_INFO: public Load_data_param
...
@@ -167,7 +167,6 @@ class READ_INFO: public Load_data_param
int
enclosed_char
,
escape_char
;
int
enclosed_char
,
escape_char
;
int
*
stack
,
*
stack_pos
;
int
*
stack
,
*
stack_pos
;
bool
found_end_of_line
,
start_of_line
,
eof
;
bool
found_end_of_line
,
start_of_line
,
eof
;
NET
*
io_net
;
int
level
;
/* for load xml */
int
level
;
/* for load xml */
bool
getbyte
(
char
*
to
)
bool
getbyte
(
char
*
to
)
...
...
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