Skip to content

Commit

Permalink
Merge branch '10.0' of https://github.com/MariaDB/server into 10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Buggynours committed Jun 20, 2016
2 parents 0a96c9c + a80dbe0 commit f2dded9
Show file tree
Hide file tree
Showing 20 changed files with 325 additions and 56 deletions.
2 changes: 1 addition & 1 deletion mysql-test/r/contributors.result
Expand Up @@ -7,7 +7,7 @@ Visma http://visma.com Member of the MariaDB Foundation
Nexedi http://www.nexedi.com Member of the MariaDB Foundation
Acronis http://www.acronis.com Member of the MariaDB Foundation
Verkkokauppa.com Finland Sponsor of the MariaDB Foundation
Webyog Bangalore Sponsor of the MariaDB Foundation
Virtuozzo https://virtuozzo.com/ Sponsor of the MariaDB Foundation
Google USA Sponsoring encryption, parallel replication and GTID
Facebook USA Sponsoring non-blocking API, LIMIT ROWS EXAMINED etc
Ronald Bradford Brisbane, Australia EFF contribution for UC2006 Auction
Expand Down
19 changes: 19 additions & 0 deletions mysql-test/r/func_in.result
Expand Up @@ -812,3 +812,22 @@ EXECUTE s;
1
DROP TABLE t1;
# End of 5.3 tests
#
# Start of 10.0 tests
#
#
# MDEV-10020 InnoDB NOT IN Query Crash When One Item Is NULL
#
CREATE TABLE t1
(
a INT(11),
b VARCHAR(10),
KEY (b)
);
INSERT INTO t1 VALUES (1,'x'),(2,'y'),(3,'z');
SELECT * FROM t1 WHERE b NOT IN (NULL, '', 'A');
a b
DROP TABLE t1;
#
# End of 10.0 tests
#
70 changes: 70 additions & 0 deletions mysql-test/r/information_schema_stats.result
@@ -0,0 +1,70 @@
set global userstat=1;
create table just_a_test(id int,first_name varchar(10),last_name varchar(10),address varchar(100),phone bigint,email varchar(30), state varchar(30));
insert into just_a_test values(1,'fa','la','china_a',11111111,'fa_la@163.com','California'),
(2,'fb','lb','china_b',22222222,'fb_lb@163.com','Arizona'),
(3,'fc','lc','china_c',33333333,'fc_lc@163.com','California'),
(4,'fd','ld','china_d',44444444,'fd_ld@163.com','Utah'),
(5,'fe','le','china_e',55555555,'fe_le@163.com','Arizona');
alter table just_a_test add primary key (id);
alter table just_a_test add key IND_just_a_test_first_name_last_name(first_name,last_name);
alter table just_a_test add key IND_just_a_test_state(state);
select count(*) from just_a_test where first_name='fc' and last_name='lc';
count(*)
1
select count(*) from just_a_test where state = 'California';
count(*)
2
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test';
TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ
test just_a_test IND_just_a_test_state 2
test just_a_test IND_just_a_test_first_name_last_name 1
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test';
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES
test just_a_test 18 5 5
alter table just_a_test drop key IND_just_a_test_first_name_last_name;
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test';
TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ
test just_a_test IND_just_a_test_state 2
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test';
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES
test just_a_test 23 5 5
alter table just_a_test drop column state;
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test';
TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test';
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES
test just_a_test 28 5 5
drop table just_a_test;
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test';
TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test';
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES
create table just_a_test(id int not null primary key,first_name varchar(10),last_name varchar(10),address varchar(100),phone bigint,email varchar(30), state varchar(30),key(first_name,last_name),key(state));
insert into just_a_test values(1,'fa','la','china_a',11111111,'fa_la@163.com','California'),
(2,'fb','lb','china_b',22222222,'fb_lb@163.com','Arizona'),
(3,'fc','lc','china_c',33333333,'fc_lc@163.com','California'),
(4,'fd','ld','china_d',44444444,'fd_ld@163.com','Utah'),
(5,'fe','le','china_e',55555555,'fe_le@163.com','Arizona');
select count(*) from just_a_test where first_name='fc' and last_name='lc';
count(*)
1
select count(*) from just_a_test where state = 'California';
count(*)
2
select count(*) from just_a_test where id between 2 and 4;
count(*)
3
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test';
TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ
test just_a_test first_name 1
test just_a_test state 2
test just_a_test PRIMARY 5
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test';
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES
test just_a_test 8 5 15
drop table just_a_test;
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test';
TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test';
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES
set global userstat=0;
4 changes: 0 additions & 4 deletions mysql-test/r/status_user.result
Expand Up @@ -128,16 +128,12 @@ handler_read_key
set @@global.userstat=0;
select * from information_schema.index_statistics;
TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ
test t1 PRIMARY 2
select * from information_schema.table_statistics;
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES
test t1 6 13 13
show table_statistics;
Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes
test t1 6 13 13
show index_statistics;
Table_schema Table_name Index_name Rows_read
test t1 PRIMARY 2
select TOTAL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.client_statistics;;
TOTAL_CONNECTIONS 1
CONCURRENT_CONNECTIONS 0
Expand Down
8 changes: 8 additions & 0 deletions mysql-test/r/type_datetime.result
Expand Up @@ -834,5 +834,13 @@ a b a b
DEALLOCATE PREPARE stmt1;
DROP TABLE t1,t2;
#
# MDEV-9374 having '2015-01-01 01:00:00.000001' > coalesce(NULL) returns true
#
CREATE TABLE t1 (c1 DATETIME(0));
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 HAVING '2015-01-01 01:00:00.000001' > COALESCE(c1);
c1
DROP TABLE t1;
#
# End of 5.5 tests
#
10 changes: 10 additions & 0 deletions mysql-test/t/bootstrap.test
Expand Up @@ -89,3 +89,13 @@ drop table t1;
--replace_result .dll .so
select * from mysql.plugin;
truncate table mysql.plugin;


#
# MDEV-9969 mysql_install_db error processing ignore_db_dirs.
#
--write_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql
use test;
EOF
--exec $MYSQLD_BOOTSTRAP_CMD --ignore-db-dirs='some_dir' --ignore-db-dirs='some_dir' < $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
--remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql
21 changes: 21 additions & 0 deletions mysql-test/t/func_in.test
Expand Up @@ -606,3 +606,24 @@ EXECUTE s;
DROP TABLE t1;

--echo # End of 5.3 tests

--echo #
--echo # Start of 10.0 tests
--echo #

--echo #
--echo # MDEV-10020 InnoDB NOT IN Query Crash When One Item Is NULL
--echo #
CREATE TABLE t1
(
a INT(11),
b VARCHAR(10),
KEY (b)
);
INSERT INTO t1 VALUES (1,'x'),(2,'y'),(3,'z');
SELECT * FROM t1 WHERE b NOT IN (NULL, '', 'A');
DROP TABLE t1;

--echo #
--echo # End of 10.0 tests
--echo #
44 changes: 44 additions & 0 deletions mysql-test/t/information_schema_stats.test
@@ -0,0 +1,44 @@
#
# MDEV-8633: information_schema.index_statistics doesn't delete item when drop table indexes or drop table;
#
set global userstat=1;
create table just_a_test(id int,first_name varchar(10),last_name varchar(10),address varchar(100),phone bigint,email varchar(30), state varchar(30));
insert into just_a_test values(1,'fa','la','china_a',11111111,'fa_la@163.com','California'),
(2,'fb','lb','china_b',22222222,'fb_lb@163.com','Arizona'),
(3,'fc','lc','china_c',33333333,'fc_lc@163.com','California'),
(4,'fd','ld','china_d',44444444,'fd_ld@163.com','Utah'),
(5,'fe','le','china_e',55555555,'fe_le@163.com','Arizona');
alter table just_a_test add primary key (id);
alter table just_a_test add key IND_just_a_test_first_name_last_name(first_name,last_name);
alter table just_a_test add key IND_just_a_test_state(state);
select count(*) from just_a_test where first_name='fc' and last_name='lc';
select count(*) from just_a_test where state = 'California';
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test';
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test';
alter table just_a_test drop key IND_just_a_test_first_name_last_name;
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test';
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test';
alter table just_a_test drop column state;
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test';
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test';
drop table just_a_test;
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test';
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test';
#
# Test direct drop table
#
create table just_a_test(id int not null primary key,first_name varchar(10),last_name varchar(10),address varchar(100),phone bigint,email varchar(30), state varchar(30),key(first_name,last_name),key(state));
insert into just_a_test values(1,'fa','la','china_a',11111111,'fa_la@163.com','California'),
(2,'fb','lb','china_b',22222222,'fb_lb@163.com','Arizona'),
(3,'fc','lc','china_c',33333333,'fc_lc@163.com','California'),
(4,'fd','ld','china_d',44444444,'fd_ld@163.com','Utah'),
(5,'fe','le','china_e',55555555,'fe_le@163.com','Arizona');
select count(*) from just_a_test where first_name='fc' and last_name='lc';
select count(*) from just_a_test where state = 'California';
select count(*) from just_a_test where id between 2 and 4;
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test';
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test';
drop table just_a_test;
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test';
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test';
set global userstat=0;
8 changes: 8 additions & 0 deletions mysql-test/t/type_datetime.test
Expand Up @@ -610,6 +610,14 @@ EXECUTE stmt1;
DEALLOCATE PREPARE stmt1;
DROP TABLE t1,t2;

--echo #
--echo # MDEV-9374 having '2015-01-01 01:00:00.000001' > coalesce(NULL) returns true
--echo #
CREATE TABLE t1 (c1 DATETIME(0));
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 HAVING '2015-01-01 01:00:00.000001' > COALESCE(c1);
DROP TABLE t1;

--echo #
--echo # End of 5.5 tests
--echo #
4 changes: 2 additions & 2 deletions mysys/my_context.c
Expand Up @@ -206,7 +206,7 @@ my_context_spawn(struct my_context *c, void (*f)(void *), void *d)
(
"movq %%rsp, (%[save])\n\t"
"movq %[stack], %%rsp\n\t"
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4 && !defined(__INTEL_COMPILER)
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && !defined(__INTEL_COMPILER)
/*
This emits a DWARF DW_CFA_undefined directive to make the return address
undefined. This indicates that this is the top of the stack frame, and
Expand Down Expand Up @@ -454,7 +454,7 @@ my_context_spawn(struct my_context *c, void (*f)(void *), void *d)
(
"movl %%esp, (%[save])\n\t"
"movl %[stack], %%esp\n\t"
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4 && !defined(__INTEL_COMPILER)
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && !defined(__INTEL_COMPILER)
/*
This emits a DWARF DW_CFA_undefined directive to make the return address
undefined. This indicates that this is the top of the stack frame, and
Expand Down
2 changes: 1 addition & 1 deletion scripts/mysql_install_db.pl.in
Expand Up @@ -238,7 +238,7 @@ sub quote_options {
##############################################################################

my $opt = {};
parse_arguments($opt, 'PICK-ARGS-FROM-ARGV', @ARGV);
parse_arguments($opt, @ARGV);

# ----------------------------------------------------------------------
# We can now find my_print_defaults. This script supports:
Expand Down
2 changes: 1 addition & 1 deletion scripts/mysql_install_db.sh
Expand Up @@ -216,7 +216,7 @@ cannot_find_file()
# Ok, let's go. We first need to parse arguments which are required by
# my_print_defaults so that we can execute it first, then later re-parse
# the command line to add any extra bits that we need.
parse_arguments PICK-ARGS-FROM-ARGV "$@"
parse_arguments "$@"

#
# We can now find my_print_defaults. This script supports:
Expand Down
2 changes: 1 addition & 1 deletion sql/contributors.h
Expand Up @@ -46,7 +46,7 @@ struct show_table_contributors_st show_table_contributors[]= {

/* Smaller sponsors, newer per year */
{"Verkkokauppa.com", "Finland", "Sponsor of the MariaDB Foundation"},
{"Webyog", "Bangalore", "Sponsor of the MariaDB Foundation"},
{"Virtuozzo", "https://virtuozzo.com/", "Sponsor of the MariaDB Foundation"},

/* Sponsors of important features */
{"Google", "USA", "Sponsoring encryption, parallel replication and GTID"},
Expand Down
2 changes: 1 addition & 1 deletion sql/opt_range.cc
Expand Up @@ -7730,7 +7730,7 @@ static SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param, Item_func *cond_func,
break;
}
SEL_TREE *tree2;
for (; i < func->array->count; i++)
for (; i < func->array->used_count; i++)
{
if (func->array->compare_elems(i, i-1))
{
Expand Down

0 comments on commit f2dded9

Please sign in to comment.