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
d6a7de20
Commit
d6a7de20
authored
Sep 19, 2017
by
Vicențiu Ciorbaru
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '5.5' into 10.0
parents
a8700998
e7bb8181
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
79 additions
and
26 deletions
+79
-26
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+1
-2
mysql-test/r/count_distinct.result
mysql-test/r/count_distinct.result
+25
-0
mysql-test/r/log_tables-big.result
mysql-test/r/log_tables-big.result
+5
-4
mysql-test/r/view.result
mysql-test/r/view.result
+0
-3
mysql-test/t/count_distinct.test
mysql-test/t/count_distinct.test
+29
-0
mysql-test/t/log_tables-big.test
mysql-test/t/log_tables-big.test
+5
-4
mysql-test/t/view.test
mysql-test/t/view.test
+1
-4
sql/sql_class.h
sql/sql_class.h
+1
-1
sql/sql_derived.cc
sql/sql_derived.cc
+2
-2
sql/uniques.cc
sql/uniques.cc
+10
-6
No files found.
mysql-test/mysql-test-run.pl
View file @
d6a7de20
...
@@ -751,8 +751,7 @@ sub run_test_server ($$$) {
...
@@ -751,8 +751,7 @@ sub run_test_server ($$$) {
# Repeat test $opt_repeat number of times
# Repeat test $opt_repeat number of times
my
$repeat
=
$result
->
{
repeat
}
||
1
;
my
$repeat
=
$result
->
{
repeat
}
||
1
;
# Don't repeat if test was skipped
if
(
$repeat
<
$opt_repeat
)
if
(
$repeat
<
$opt_repeat
&&
$result
->
{'
result
'}
ne
'
MTR_RES_SKIPPED
')
{
{
$result
->
{
retries
}
=
0
;
$result
->
{
retries
}
=
0
;
$result
->
{
rep_failures
}
++
if
$result
->
{
failures
};
$result
->
{
rep_failures
}
++
if
$result
->
{
failures
};
...
...
mysql-test/r/count_distinct.result
View file @
d6a7de20
...
@@ -106,3 +106,28 @@ count(distinct user_id)
...
@@ -106,3 +106,28 @@ count(distinct user_id)
17
17
drop table t1;
drop table t1;
set @@tmp_table_size = default;
set @@tmp_table_size = default;
create table t1 (
a VARCHAR(1020),
b int
);
insert into t1 values
( 0 , 1 ),
( 1 , 2 ),
( 2 , 3 ),
( 3 , 4 ),
( 4 , 5 ),
( 5 , 6 ),
( 6 , 7 ),
( 7 , 8 ),
( 8 , 9 ),
( 9 , 10 ),
( 0 , 11 ),
( 1 , 12 ),
( 2 , 13 ),
( 3 , 14 );
set @@tmp_table_size=1024;
select count(distinct a) from t1;
count(distinct a)
10
drop table t1;
set @@tmp_table_size = default;
mysql-test/r/log_tables-big.result
View file @
d6a7de20
set @log_output.saved = @@global.log_output;
set @@global.log_output = 'TABLE';
set @@global.log_output = 'TABLE';
set session long_query_time=10;
set session long_query_time=10;
select get_lock('bug27638', 1);
select get_lock('bug27638', 1);
...
@@ -7,25 +8,25 @@ set session long_query_time=1;
...
@@ -7,25 +8,25 @@ set session long_query_time=1;
select get_lock('bug27638', 2);
select get_lock('bug27638', 2);
get_lock('bug27638', 2)
get_lock('bug27638', 2)
0
0
select if (query_time >= '00:00:01', 'OK',
'WRONG'
) as qt, sql_text from mysql.slow_log
select if (query_time >= '00:00:01', 'OK',
concat('WRONG: ',query_time)
) as qt, sql_text from mysql.slow_log
where sql_text = 'select get_lock(\'bug27638\', 2)';
where sql_text = 'select get_lock(\'bug27638\', 2)';
qt sql_text
qt sql_text
OK select get_lock('bug27638', 2)
OK select get_lock('bug27638', 2)
select get_lock('bug27638', 60);
select get_lock('bug27638', 60);
get_lock('bug27638', 60)
get_lock('bug27638', 60)
0
0
select if (query_time >= '00:00:59', 'OK',
'WRONG'
) as qt, sql_text from mysql.slow_log
select if (query_time >= '00:00:59', 'OK',
concat('WRONG: ',query_time)
) as qt, sql_text from mysql.slow_log
where sql_text = 'select get_lock(\'bug27638\', 60)';
where sql_text = 'select get_lock(\'bug27638\', 60)';
qt sql_text
qt sql_text
OK select get_lock('bug27638', 60)
OK select get_lock('bug27638', 60)
select get_lock('bug27638', 101);
select get_lock('bug27638', 101);
get_lock('bug27638', 101)
get_lock('bug27638', 101)
0
0
select if (query_time >= '00:01:40', 'OK',
'WRONG'
) as qt, sql_text from mysql.slow_log
select if (query_time >= '00:01:40', 'OK',
concat('WRONG: ',query_time)
) as qt, sql_text from mysql.slow_log
where sql_text = 'select get_lock(\'bug27638\', 101)';
where sql_text = 'select get_lock(\'bug27638\', 101)';
qt sql_text
qt sql_text
OK select get_lock('bug27638', 101)
OK select get_lock('bug27638', 101)
select release_lock('bug27638');
select release_lock('bug27638');
release_lock('bug27638')
release_lock('bug27638')
1
1
set @@global.log_output
=default
;
set @@global.log_output
= @log_output.saved
;
mysql-test/r/view.result
View file @
d6a7de20
...
@@ -5627,9 +5627,6 @@ CREATE TABLE t3 (a INT);
...
@@ -5627,9 +5627,6 @@ CREATE TABLE t3 (a INT);
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.a FROM t3 AS t1, t3 AS t2;
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.a FROM t3 AS t1, t3 AS t2;
CREATE ALGORITHM = MERGE VIEW v2 AS SELECT * FROM v1;
CREATE ALGORITHM = MERGE VIEW v2 AS SELECT * FROM v1;
PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
EXECUTE stmt;
ERROR HY000: Can not insert into join view 'test.v2' without fields list
EXECUTE stmt;
ERROR HY000: Can not insert into join view 'test.v2' without fields list
ERROR HY000: Can not insert into join view 'test.v2' without fields list
drop view v1,v2;
drop view v1,v2;
drop table t3;
drop table t3;
...
...
mysql-test/t/count_distinct.test
View file @
d6a7de20
...
@@ -120,6 +120,35 @@ select count(distinct user_id) from t1;
...
@@ -120,6 +120,35 @@ select count(distinct user_id) from t1;
drop
table
t1
;
drop
table
t1
;
set
@@
tmp_table_size
=
default
;
set
@@
tmp_table_size
=
default
;
#
# MDEV-13457: Wrong result for aggregate function with distinct clause when the value for
# tmp_table_size is small
#
create
table
t1
(
a
VARCHAR
(
1020
),
b
int
);
insert
into
t1
values
(
0
,
1
),
(
1
,
2
),
(
2
,
3
),
(
3
,
4
),
(
4
,
5
),
(
5
,
6
),
(
6
,
7
),
(
7
,
8
),
(
8
,
9
),
(
9
,
10
),
(
0
,
11
),
(
1
,
12
),
(
2
,
13
),
(
3
,
14
);
set
@@
tmp_table_size
=
1024
;
select
count
(
distinct
a
)
from
t1
;
drop
table
t1
;
set
@@
tmp_table_size
=
default
;
#
#
# End of 5.5 tests
# End of 5.5 tests
#
#
mysql-test/t/log_tables-big.test
View file @
d6a7de20
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
# check that CSV engine was compiled in
# check that CSV engine was compiled in
--
source
include
/
have_csv
.
inc
--
source
include
/
have_csv
.
inc
set
@
log_output
.
saved
=
@@
global
.
log_output
;
set
@@
global
.
log_output
=
'TABLE'
;
set
@@
global
.
log_output
=
'TABLE'
;
connect
(
con1
,
localhost
,
root
,,);
connect
(
con1
,
localhost
,
root
,,);
...
@@ -21,13 +22,13 @@ select get_lock('bug27638', 1);
...
@@ -21,13 +22,13 @@ select get_lock('bug27638', 1);
connection
con2
;
connection
con2
;
set
session
long_query_time
=
1
;
set
session
long_query_time
=
1
;
select
get_lock
(
'bug27638'
,
2
);
select
get_lock
(
'bug27638'
,
2
);
select
if
(
query_time
>=
'00:00:01'
,
'OK'
,
'WRONG'
)
as
qt
,
sql_text
from
mysql
.
slow_log
select
if
(
query_time
>=
'00:00:01'
,
'OK'
,
concat
(
'WRONG: '
,
query_time
)
)
as
qt
,
sql_text
from
mysql
.
slow_log
where
sql_text
=
'select get_lock(\'bug27638\', 2)'
;
where
sql_text
=
'select get_lock(\'bug27638\', 2)'
;
select
get_lock
(
'bug27638'
,
60
);
select
get_lock
(
'bug27638'
,
60
);
select
if
(
query_time
>=
'00:00:59'
,
'OK'
,
'WRONG'
)
as
qt
,
sql_text
from
mysql
.
slow_log
select
if
(
query_time
>=
'00:00:59'
,
'OK'
,
concat
(
'WRONG: '
,
query_time
)
)
as
qt
,
sql_text
from
mysql
.
slow_log
where
sql_text
=
'select get_lock(\'bug27638\', 60)'
;
where
sql_text
=
'select get_lock(\'bug27638\', 60)'
;
select
get_lock
(
'bug27638'
,
101
);
select
get_lock
(
'bug27638'
,
101
);
select
if
(
query_time
>=
'00:01:40'
,
'OK'
,
'WRONG'
)
as
qt
,
sql_text
from
mysql
.
slow_log
select
if
(
query_time
>=
'00:01:40'
,
'OK'
,
concat
(
'WRONG: '
,
query_time
)
)
as
qt
,
sql_text
from
mysql
.
slow_log
where
sql_text
=
'select get_lock(\'bug27638\', 101)'
;
where
sql_text
=
'select get_lock(\'bug27638\', 101)'
;
connection
con1
;
connection
con1
;
select
release_lock
(
'bug27638'
);
select
release_lock
(
'bug27638'
);
...
@@ -36,4 +37,4 @@ connection default;
...
@@ -36,4 +37,4 @@ connection default;
disconnect
con1
;
disconnect
con1
;
disconnect
con2
;
disconnect
con2
;
set
@@
global
.
log_output
=
default
;
set
@@
global
.
log_output
=
@
log_output
.
saved
;
mysql-test/t/view.test
View file @
d6a7de20
...
@@ -5573,11 +5573,8 @@ drop table t1,t2,t3;
...
@@ -5573,11 +5573,8 @@ drop table t1,t2,t3;
CREATE TABLE t3 (a INT);
CREATE TABLE t3 (a INT);
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.a FROM t3 AS t1, t3 AS t2;
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.a FROM t3 AS t1, t3 AS t2;
CREATE ALGORITHM = MERGE VIEW v2 AS SELECT * FROM v1;
CREATE ALGORITHM = MERGE VIEW v2 AS SELECT * FROM v1;
PREPARE stmt FROM '
REPLACE
INTO
v2
SELECT
a
FROM
t3
';
--error ER_VIEW_NO_INSERT_FIELD_LIST
EXECUTE stmt;
--error ER_VIEW_NO_INSERT_FIELD_LIST
--error ER_VIEW_NO_INSERT_FIELD_LIST
EXECUTE stmt
;
PREPARE stmt FROM '
REPLACE
INTO
v2
SELECT
a
FROM
t3
'
;
drop view v1,v2;
drop view v1,v2;
drop table t3;
drop table t3;
...
...
sql/sql_class.h
View file @
d6a7de20
...
@@ -4617,7 +4617,7 @@ class Unique :public Sql_alloc
...
@@ -4617,7 +4617,7 @@ class Unique :public Sql_alloc
{
{
DBUG_ENTER
(
"unique_add"
);
DBUG_ENTER
(
"unique_add"
);
DBUG_PRINT
(
"info"
,
(
"tree %u - %lu"
,
tree
.
elements_in_tree
,
max_elements
));
DBUG_PRINT
(
"info"
,
(
"tree %u - %lu"
,
tree
.
elements_in_tree
,
max_elements
));
if
(
!
(
tree
.
flag
&
TREE_ONLY_DUPS
)
&&
if
(
!
(
tree
.
flag
&
TREE_ONLY_DUPS
)
&&
tree
.
elements_in_tree
>=
max_elements
&&
flush
())
tree
.
elements_in_tree
>=
max_elements
&&
flush
())
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
DBUG_RETURN
(
!
tree_insert
(
&
tree
,
ptr
,
0
,
tree
.
custom_arg
));
DBUG_RETURN
(
!
tree_insert
(
&
tree
,
ptr
,
0
,
tree
.
custom_arg
));
...
...
sql/sql_derived.cc
View file @
d6a7de20
...
@@ -520,6 +520,8 @@ bool mysql_derived_merge_for_insert(THD *thd, LEX *lex, TABLE_LIST *derived)
...
@@ -520,6 +520,8 @@ bool mysql_derived_merge_for_insert(THD *thd, LEX *lex, TABLE_LIST *derived)
derived
->
merge_underlying_list
!=
0
));
derived
->
merge_underlying_list
!=
0
));
if
(
derived
->
merged_for_insert
)
if
(
derived
->
merged_for_insert
)
DBUG_RETURN
(
FALSE
);
DBUG_RETURN
(
FALSE
);
if
(
derived
->
init_derived
(
thd
,
FALSE
))
DBUG_RETURN
(
TRUE
);
if
(
derived
->
is_materialized_derived
())
if
(
derived
->
is_materialized_derived
())
DBUG_RETURN
(
mysql_derived_prepare
(
thd
,
lex
,
derived
));
DBUG_RETURN
(
mysql_derived_prepare
(
thd
,
lex
,
derived
));
if
((
thd
->
lex
->
sql_command
==
SQLCOM_UPDATE_MULTI
||
if
((
thd
->
lex
->
sql_command
==
SQLCOM_UPDATE_MULTI
||
...
@@ -537,8 +539,6 @@ bool mysql_derived_merge_for_insert(THD *thd, LEX *lex, TABLE_LIST *derived)
...
@@ -537,8 +539,6 @@ bool mysql_derived_merge_for_insert(THD *thd, LEX *lex, TABLE_LIST *derived)
DBUG_ASSERT
(
derived
->
table
);
DBUG_ASSERT
(
derived
->
table
);
}
}
}
}
else
derived
->
table
=
derived
->
merge_underlying_list
->
table
;
DBUG_RETURN
(
FALSE
);
DBUG_RETURN
(
FALSE
);
}
}
...
...
sql/uniques.cc
View file @
d6a7de20
...
@@ -100,6 +100,9 @@ Unique::Unique(qsort_cmp2 comp_func, void * comp_func_fixed_arg,
...
@@ -100,6 +100,9 @@ Unique::Unique(qsort_cmp2 comp_func, void * comp_func_fixed_arg,
*/
*/
max_elements
=
(
ulong
)
(
max_in_memory_size
/
max_elements
=
(
ulong
)
(
max_in_memory_size
/
ALIGN_SIZE
(
sizeof
(
TREE_ELEMENT
)
+
size
));
ALIGN_SIZE
(
sizeof
(
TREE_ELEMENT
)
+
size
));
if
(
!
max_elements
)
max_elements
=
1
;
(
void
)
open_cached_file
(
&
file
,
mysql_tmpdir
,
TEMP_PREFIX
,
DISK_BUFFER_SIZE
,
(
void
)
open_cached_file
(
&
file
,
mysql_tmpdir
,
TEMP_PREFIX
,
DISK_BUFFER_SIZE
,
MYF
(
MY_WME
));
MYF
(
MY_WME
));
}
}
...
@@ -643,11 +646,12 @@ bool Unique::walk(TABLE *table, tree_walk_action action, void *walk_action_arg)
...
@@ -643,11 +646,12 @@ bool Unique::walk(TABLE *table, tree_walk_action action, void *walk_action_arg)
if
(
flush_io_cache
(
&
file
)
||
reinit_io_cache
(
&
file
,
READ_CACHE
,
0L
,
0
,
0
))
if
(
flush_io_cache
(
&
file
)
||
reinit_io_cache
(
&
file
,
READ_CACHE
,
0L
,
0
,
0
))
return
1
;
return
1
;
/*
/*
merge_buffer must fit at least MERGEBUFF2 keys, because
merge_buffer must fit at least MERGEBUFF2 + 1 keys, because
merge_index() can merge that many BUFFPEKs at once.
merge_index() can merge that many BUFFPEKs at once. The extra space for one key
is needed when a piece of merge buffer is re-read, see merge_walk()
*/
*/
size_t
buff_sz
=
MY_MAX
(
MERGEBUFF2
,
max_in_memory_size
/
full_size
+
1
)
*
full_size
;
size_t
buff_sz
=
MY_MAX
(
MERGEBUFF2
+
1
,
max_in_memory_size
/
full_size
+
1
)
*
full_size
;
if
(
!
(
merge_buffer
=
(
uchar
*
)
my_malloc
(
buff_sz
,
MYF
(
MY_
THREAD_SPECIFIC
|
MY_
WME
))))
if
(
!
(
merge_buffer
=
(
uchar
*
)
my_malloc
(
buff_sz
,
MYF
(
MY_WME
))))
return
1
;
return
1
;
if
(
buff_sz
<
full_size
*
(
file_ptrs
.
elements
+
1UL
))
if
(
buff_sz
<
full_size
*
(
file_ptrs
.
elements
+
1UL
))
res
=
merge
(
table
,
merge_buffer
,
buff_sz
>=
full_size
*
MERGEBUFF2
)
;
res
=
merge
(
table
,
merge_buffer
,
buff_sz
>=
full_size
*
MERGEBUFF2
)
;
...
@@ -708,8 +712,8 @@ bool Unique::merge(TABLE *table, uchar *buff, bool without_last_merge)
...
@@ -708,8 +712,8 @@ bool Unique::merge(TABLE *table, uchar *buff, bool without_last_merge)
full_size
;
full_size
;
sort_param
.
min_dupl_count
=
min_dupl_count
;
sort_param
.
min_dupl_count
=
min_dupl_count
;
sort_param
.
res_length
=
0
;
sort_param
.
res_length
=
0
;
sort_param
.
max_keys_per_buffer
=
sort_param
.
keys
=
(
uint
)
MY_MAX
((
max_in_memory_size
/
sort_param
.
sort_length
),
(
uint
)
(
max_in_memory_size
/
sort_param
.
sort_length
);
MERGEBUFF2
);
sort_param
.
not_killable
=
1
;
sort_param
.
not_killable
=
1
;
sort_param
.
unique_buff
=
buff
+
(
sort_param
.
max_keys_per_buffer
*
sort_param
.
unique_buff
=
buff
+
(
sort_param
.
max_keys_per_buffer
*
...
...
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