Commit 1ef07d08 authored by Igor Babaev's avatar Igor Babaev

Merge 10.0-base -> 10.0.

Also fixed a bug in sql_update.cc: the code of mysql_update() lacked
a call of set_statistics_for_table().
parents 421bbdcf f853333e
......@@ -1936,7 +1936,9 @@ static void print_xml_row(FILE *xml_file, const char *row_name,
{
create_stmt_ptr= (*row)[i];
create_stmt_len= lengths[i];
#ifndef DBUG_OFF
body_found= 1;
#endif
}
else
{
......
......@@ -18,8 +18,8 @@ export DEB_BUILD_OPTIONS="nocheck"
# Find major.minor version.
#
source ./VERSION
UPSTREAM="${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}"
RELEASE_EXTRA=${MYSQL_VERSION_EXTRA}
UPSTREAM="${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}${MYSQL_VERSION_EXTRA}"
RELEASE_EXTRA=""
RELEASE_NAME=mariadb
PATCHLEVEL=""
......
......@@ -51,9 +51,6 @@ word32 PBKDF2_HMAC<T>::DeriveKey(byte* derived, word32 dLen, const byte* pwd,
if (dLen > MaxDerivedKeyLength())
return 0;
if (iterations < 0)
return 0;
ByteBlock buffer(T::DIGEST_SIZE);
HMAC<T> hmac;
......
......@@ -383,7 +383,8 @@ int maria_recreate_table(HA_CHECK *param, MARIA_HA **org_info, char *filename);
int maria_disable_indexes(MARIA_HA *info);
int maria_enable_indexes(MARIA_HA *info);
int maria_indexes_are_disabled(MARIA_HA *info);
void maria_disable_non_unique_index(MARIA_HA *info, ha_rows rows);
void maria_disable_indexes_for_rebuild(MARIA_HA *info, ha_rows rows,
my_bool all_keys);
my_bool maria_test_if_sort_rep(MARIA_HA *info, ha_rows rows, ulonglong key_map,
my_bool force);
......
......@@ -335,6 +335,12 @@ enum ha_base_keytype {
#define HA_CREATE_DELAY_KEY_WRITE 64
#define HA_CREATE_RELIES_ON_SQL_LAYER 128
/* Flags used by start_bulk_insert */
#define HA_CREATE_UNIQUE_INDEX_BY_SORT 1
/*
The following flags (OR-ed) are passed to handler::info() method.
The method copies misc handler information out of the storage engine
......
......@@ -63,6 +63,8 @@
#define T_ZEROFILL_KEEP_LSN ((ulonglong) 1L << 33)
/** If repair should not bump create_rename_lsn */
#define T_NO_CREATE_RENAME_LSN ((ulonglong) 1L << 33)
#define T_CREATE_UNIQUE_BY_SORT ((ulonglong) 1L << 34)
#define T_SUPPRESS_ERR_HANDLING ((ulonglong) 1L << 35)
#define T_REP_ANY (T_REP | T_REP_BY_SORT | T_REP_PARALLEL)
......
......@@ -75,7 +75,8 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../sql/debug_sync.cc ../sql/opt_table_elimination.cc
../sql/sql_prepare.cc ../sql/sql_rename.cc ../sql/sql_repl.cc
../sql/sql_select.cc ../sql/sql_servers.cc
../sql/sql_show.cc ../sql/sql_state.c ../sql/sql_string.cc
../sql/sql_show.cc ../sql/sql_state.c
../sql/sql_statistics.cc ../sql/sql_string.cc
../sql/sql_tablespace.cc ../sql/sql_table.cc ../sql/sql_test.cc
../sql/sql_trigger.cc ../sql/sql_udf.cc ../sql/sql_union.cc
../sql/sql_update.cc ../sql/sql_view.cc ../sql/sql_profile.cc
......
--echo #
--echo # mdev-539: fast build of unique/primary indexes for MyISAM/Aria
--echo #
--disable_warnings
DROP DATABASE IF EXISTS dbt3_s001;
--enable_warnings
CREATE DATABASE dbt3_s001;
use dbt3_s001;
--disable_query_log
--disable_result_log
--disable_warnings
--source include/dbt3_s001.inc
--enable_warnings
--enable_result_log
--enable_query_log
drop index `primary` on lineitem;
show create table lineitem;
alter table lineitem add primary key (l_orderkey, l_linenumber);
show create table lineitem;
drop index `primary` on lineitem;
select * from lineitem where l_orderkey=1 and l_linenumber=2;
insert into lineitem values
(1,68,9,2,36,34850.16,0.07,0.06,'N','O','1996-04-12','1996-02-28','1996-04-20','TAKE BACK RETURN','MAIL','slyly bold pinto beans detect s');
select * from lineitem where l_orderkey=1 and l_linenumber=2;
--error ER_DUP_ENTRY
alter table lineitem add primary key (l_orderkey, l_linenumber);
show create table lineitem;
select * from lineitem where l_orderkey=1 and l_linenumber=2;
delete from lineitem where l_orderkey=1 and l_linenumber=2 and l_discount=0.07;
alter table lineitem add primary key (l_orderkey, l_linenumber);
show create table lineitem;
select * from lineitem where l_orderkey=1 and l_linenumber=2;
create unique index i_c_name on customer(c_name);
show create table customer;
select * from customer where c_name='Customer#000000003';
drop index i_c_name on customer;
insert into customer values
(303,'Customer#000000003','MG9kdTD2WBHm',1,'11-719-748-3364',7498.12,'AUTOMOBILE','special packages wake. slyly reg');
select * from customer where c_name='Customer#000000003';
--error ER_DUP_ENTRY
alter table customer add unique index i_c_name(c_name);
show create table customer;
select * from customer where c_name='Customer#000000003';
delete from customer where c_custkey=303;
select * from customer where c_name='Customer#000000003';
alter table customer add unique index i_c_name(c_name);
show create table customer;
select * from customer where c_name='Customer#000000003';
drop index `primary` on customer;
show create table customer;
insert into customer values
(3,'Customer#000000303','MG9kdTD2WBHm',1,'11-719-748-3364',7498.12,'AUTOMOBILE','special packages wake. slyly reg');
alter ignore table customer add primary key (c_custkey);
show create table customer;
select * from customer where c_custkey=3;
DROP DATABASE dbt3_s001;
if (`select count(*) < 3 from information_schema.tables
where table_schema = 'mysql' and table_name in ('table_stats','column_stats','index_stats')`)
{
--skip Needs stat tables
}
--use-stat-tables='complementary'
......@@ -16,3 +16,6 @@ show create table proc;
show create table event;
show create table general_log;
show create table slow_log;
show create table table_stats;
show create table column_stats;
show create table index_stats;
CREATE TABLE Country (
Code char(3) NOT NULL default '',
Name char(52) NOT NULL default '',
SurfaceArea float(10,2) NOT NULL default '0.00',
Population int(11) NOT NULL default '0',
Capital int(11) default NULL,
PRIMARY KEY (Code),
UNIQUE INDEX (Name)
) CHARACTER SET utf8 COLLATE utf8_bin;
CREATE TABLE City (
ID int(11) NOT NULL auto_increment,
Name char(35) NOT NULL default '',
Country char(3) NOT NULL default '',
Population int(11) NOT NULL default '0',
PRIMARY KEY (ID),
INDEX (Population),
INDEX (Country)
) CHARACTER SET utf8 COLLATE utf8_bin;
CREATE TABLE CountryLanguage (
Country char(3) NOT NULL default '',
Language char(30) NOT NULL default '',
Percentage float(3,1) NOT NULL default '0.0',
PRIMARY KEY (Country, Language),
INDEX (Percentage)
) CHARACTER SET utf8 COLLATE utf8_bin;
......@@ -7,6 +7,7 @@ performance_schema
test
show tables in mysql;
Tables_in_mysql
column_stats
columns_priv
db
event
......@@ -17,6 +18,7 @@ help_keyword
help_relation
help_topic
host
index_stats
innodb_index_stats
innodb_table_stats
ndb_binlog_index
......@@ -29,6 +31,7 @@ slave_master_info
slave_relay_log_info
slave_worker_info
slow_log
table_stats
tables_priv
time_zone
time_zone_leap_second
......
......@@ -176,12 +176,12 @@ create table t1 (a int, b int);
alter table t1 add unique (a,b), add key (b);
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 0 a 1 a A NULL NULL NULL YES BTREE
t1 0 a 2 b A NULL NULL NULL YES BTREE
t1 0 a 1 a A 3 NULL NULL YES BTREE
t1 0 a 2 b A 300 NULL NULL YES BTREE
t1 1 b 1 b A 100 NULL NULL YES BTREE
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze status Table is already up to date
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 0 a 1 a A 3 NULL NULL YES BTREE
......
This diff is collapsed.
This diff is collapsed.
drop table if exists t1,t2;
show tables;
Tables_in_mysql
column_stats
columns_priv
db
event
......@@ -11,6 +12,7 @@ help_keyword
help_relation
help_topic
host
index_stats
innodb_index_stats
innodb_table_stats
ndb_binlog_index
......@@ -23,6 +25,7 @@ slave_master_info
slave_relay_log_info
slave_worker_info
slow_log
table_stats
tables_priv
time_zone
time_zone_leap_second
......@@ -40,6 +43,7 @@ grant ALL on *.* to test@localhost identified by "gambling";
grant ALL on *.* to test@127.0.0.1 identified by "gambling";
show tables;
Tables_in_mysql
column_stats
columns_priv
db
event
......@@ -50,6 +54,7 @@ help_keyword
help_relation
help_topic
host
index_stats
innodb_index_stats
innodb_table_stats
ndb_binlog_index
......@@ -62,6 +67,7 @@ slave_master_info
slave_relay_log_info
slave_worker_info
slow_log
table_stats
tables_priv
time_zone
time_zone_leap_second
......@@ -87,6 +93,7 @@ ERROR HY000: Password hash should be a 41-digit hexadecimal number
set password=old_password('gambling3');
show tables;
Tables_in_mysql
column_stats
columns_priv
db
event
......@@ -97,6 +104,7 @@ help_keyword
help_relation
help_topic
host
index_stats
innodb_index_stats
innodb_table_stats
ndb_binlog_index
......@@ -109,6 +117,7 @@ slave_master_info
slave_relay_log_info
slave_worker_info
slow_log
table_stats
tables_priv
time_zone
time_zone_leap_second
......
......@@ -2403,3 +2403,30 @@ a b
1 1
drop table t1;
#
# Checking that CREATE IF NOT EXISTS is not blocked by running SELECT
#
create table t1 (a int, b int) engine=myisam;
create table t2 (a int, b int) engine=myisam;
insert into t1 values (1,1);
lock tables t1 read;
set @@lock_wait_timeout=5;
create table if not exists t1 (a int, b int);
Warnings:
Note 1050 Table 't1' already exists
create table if not exists t1 (a int, b int) select 2,2;
Warnings:
Note 1050 Table 't1' already exists
create table if not exists t1 like t2;
Warnings:
Note 1050 Table 't1' already exists
create table t1 (a int, b int);
ERROR 42S01: Table 't1' already exists
create table t1 (a int, b int) select 2,2;
ERROR 42S01: Table 't1' already exists
create table t1 like t2;
ERROR 42S01: Table 't1' already exists
select * from t1;
a b
1 1
unlock tables;
drop table t1,t2;
......@@ -81,6 +81,7 @@ TRIGGERS
USER_PRIVILEGES
USER_STATISTICS
VIEWS
column_stats
columns_priv
db
event
......@@ -91,6 +92,7 @@ help_keyword
help_relation
help_topic
host
index_stats
plugin
proc
procs_priv
......@@ -102,6 +104,7 @@ t2
t3
t4
t5
table_stats
tables_priv
time_zone
time_zone_leap_second
......@@ -120,6 +123,7 @@ TABLE_CONSTRAINTS TABLE_CONSTRAINTS
TABLE_PRIVILEGES TABLE_PRIVILEGES
TABLE_STATISTICS TABLE_STATISTICS
TRIGGERS TRIGGERS
table_stats table_stats
tables_priv tables_priv
time_zone time_zone
time_zone_leap_second time_zone_leap_second
......@@ -141,6 +145,7 @@ TABLE_CONSTRAINTS TABLE_CONSTRAINTS
TABLE_PRIVILEGES TABLE_PRIVILEGES
TABLE_STATISTICS TABLE_STATISTICS
TRIGGERS TRIGGERS
table_stats table_stats
tables_priv tables_priv
time_zone time_zone
time_zone_leap_second time_zone_leap_second
......@@ -162,6 +167,7 @@ TABLE_CONSTRAINTS TABLE_CONSTRAINTS
TABLE_PRIVILEGES TABLE_PRIVILEGES
TABLE_STATISTICS TABLE_STATISTICS
TRIGGERS TRIGGERS
table_stats table_stats
tables_priv tables_priv
time_zone time_zone
time_zone_leap_second time_zone_leap_second
......@@ -1934,6 +1940,26 @@ event_object_table trigger_name
# Switching to connection 'default'.
#
#
# MDEV-3818: Query against view over IS tables worse than equivalent query without view
#
create view v1 as select table_schema, table_name, column_name from information_schema.columns;
explain extended
select column_name from v1
where (table_schema = "osm") and (table_name = "test");
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE columns ALL NULL TABLE_SCHEMA,TABLE_NAME NULL NULL NULL NULL Using where; Open_frm_only; Scanned 0 databases
Warnings:
Note 1003 select `information_schema`.`columns`.`COLUMN_NAME` AS `column_name` from `information_schema`.`columns` where ((`information_schema`.`columns`.`TABLE_SCHEMA` = 'osm') and (`information_schema`.`columns`.`TABLE_NAME` = 'test'))
explain extended
select information_schema.columns.column_name as column_name
from information_schema.columns
where (information_schema.columns.table_schema = 'osm') and (information_schema.columns.table_name = 'test');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE columns ALL NULL TABLE_SCHEMA,TABLE_NAME NULL NULL NULL NULL Using where; Open_frm_only; Scanned 0 databases
Warnings:
Note 1003 select `information_schema`.`columns`.`COLUMN_NAME` AS `column_name` from `information_schema`.`columns` where ((`information_schema`.`columns`.`TABLE_SCHEMA` = 'osm') and (`information_schema`.`columns`.`TABLE_NAME` = 'test'))
drop view v1;
#
# Clean-up.
drop database mysqltest;
#
......
......@@ -418,4 +418,4 @@ Wildcard: inf_rmation_schema
SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA;
table_schema count(*)
information_schema 58
mysql 23
mysql 26
......@@ -19,6 +19,7 @@ mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
......@@ -28,6 +29,7 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.ndb_binlog_index OK
......@@ -40,6 +42,7 @@ mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
mysql.slave_worker_info OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
......
CREATE TABLE A (
pk INTEGER AUTO_INCREMENT PRIMARY KEY,
fdate DATE
) ENGINE=MyISAM;
CREATE PROCEDURE p_analyze()
BEGIN
DECLARE attempts INTEGER DEFAULT 100;
wl_loop: WHILE attempts > 0 DO
ANALYZE TABLE A;
SET attempts = attempts - 1;
END WHILE wl_loop;
END |
CREATE FUNCTION rnd3() RETURNS INT
BEGIN
RETURN ROUND(3 * RAND() + 0.5);
END |
SET GLOBAL use_stat_tables = PREFERABLY;
DROP TABLE A;
DROP PROCEDURE p_analyze;
DROP FUNCTION rnd3;
SET GLOBAL use_stat_tables = DEFAULT;
......@@ -7,6 +7,7 @@ mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
......@@ -16,6 +17,7 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.ndb_binlog_index OK
......@@ -27,6 +29,7 @@ mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
mysql.slave_worker_info OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
......@@ -49,6 +52,7 @@ mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
......@@ -58,6 +62,7 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.ndb_binlog_index OK
......@@ -69,6 +74,7 @@ mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
mysql.slave_worker_info OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
......@@ -91,6 +97,7 @@ mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
......@@ -100,6 +107,7 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.ndb_binlog_index OK
......@@ -111,6 +119,7 @@ mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
mysql.slave_worker_info OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
......@@ -136,6 +145,7 @@ mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
......@@ -145,6 +155,7 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.ndb_binlog_index OK
......@@ -156,6 +167,7 @@ mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
mysql.slave_worker_info OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
......@@ -184,6 +196,7 @@ mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
......@@ -193,6 +206,7 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.ndb_binlog_index OK
......@@ -204,6 +218,7 @@ mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
mysql.slave_worker_info OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
......@@ -235,6 +250,7 @@ mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
......@@ -244,6 +260,7 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.ndb_binlog_index OK
......@@ -255,6 +272,7 @@ mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
mysql.slave_worker_info OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
......@@ -289,6 +307,7 @@ mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
......@@ -298,6 +317,7 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.ndb_binlog_index OK
......@@ -309,6 +329,7 @@ mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
mysql.slave_worker_info OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
......
......@@ -9,6 +9,7 @@ mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
......@@ -18,6 +19,7 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.ndb_binlog_index OK
......@@ -29,6 +31,7 @@ mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
mysql.slave_worker_info OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
......
......@@ -3,6 +3,7 @@ drop view if exists v1;
drop database if exists client_test_db;
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
......@@ -12,6 +13,7 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.ndb_binlog_index OK
......@@ -23,6 +25,7 @@ mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
mysql.slave_worker_info OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
......@@ -32,6 +35,7 @@ mysql.time_zone_transition_type OK
mysql.user OK
mtr.global_suppressions Table is already up to date
mtr.test_suppressions Table is already up to date
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
......@@ -41,6 +45,7 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats
note : Table does not support optimize, doing recreate + analyze instead
status : OK
......@@ -56,6 +61,7 @@ mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
mysql.slave_worker_info OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
......@@ -63,6 +69,7 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
......@@ -72,6 +79,7 @@ mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.ndb_binlog_index OK
......@@ -83,6 +91,7 @@ mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
mysql.slave_worker_info OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
......@@ -90,6 +99,7 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
mysql.column_stats Table is already up to date
mysql.columns_priv Table is already up to date
mysql.db Table is already up to date
mysql.event Table is already up to date
......@@ -99,6 +109,7 @@ mysql.help_keyword Table is already up to date
mysql.help_relation Table is already up to date
mysql.help_topic Table is already up to date
mysql.host Table is already up to date
mysql.index_stats Table is already up to date
mysql.innodb_index_stats
note : Table does not support optimize, doing recreate + analyze instead
status : OK
......@@ -114,6 +125,7 @@ mysql.servers Table is already up to date
mysql.slave_master_info Table is already up to date
mysql.slave_relay_log_info Table is already up to date
mysql.slave_worker_info Table is already up to date
mysql.table_stats Table is already up to date
mysql.tables_priv Table is already up to date
mysql.time_zone Table is already up to date
mysql.time_zone_leap_second Table is already up to date
......
......@@ -918,6 +918,9 @@ The following options may be given as the first argument:
Prohibit update of a VIEW, which does not contain a key
of the underlying table and the query uses a LIMIT clause
(usually get from GUI tools)
--use-stat-tables=name
Specifies how to use system statistics tables. Possible
values are NEVER, COMPLEMENTARY, PREVERABLY
-u, --user=name Run mysqld daemon as user.
--userstat Enables statistics gathering for USER_STATISTICS,
CLIENT_STATISTICS, INDEX_STATISTICS and TABLE_STATISTICS
......@@ -1198,6 +1201,7 @@ transaction-isolation REPEATABLE-READ
transaction-prealloc-size 4096
transaction-read-only FALSE
updatable-views-with-limit YES
use-stat-tables NEVER
userstat FALSE
verbose TRUE
wait-timeout 28800
......
......@@ -1576,7 +1576,7 @@ update t1 set c1=lpad(id+1000, 12, ' '), c2=lpad(id+10000, 15, ' ');
alter table t1 add unique index (c1), add unique index (c2), add index (c3);
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze status Table is already up to date
explain
select * from t1 where (c1=' 100000' or c2=' 2000000');
id select_type table type possible_keys key key_len ref rows Extra
......
drop table if exists t0, t1, t2, t3, t4;
drop view if exists v1;
set debug_sync='RESET';
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (a int);
......@@ -1076,3 +1077,4 @@ show explain for foo;
ERROR HY000: You may only use constant expressions in this statement
# End
drop table t0;
set debug_sync='RESET';
This diff is collapsed.
SET SESSION STORAGE_ENGINE='InnoDB';
select @@global.use_stat_tables;
@@global.use_stat_tables
NEVER
select @@session.use_stat_tables;
@@session.use_stat_tables
NEVER
set @save_use_stat_tables=@@use_stat_tables;
set use_stat_tables='preferably';
DROP DATABASE IF EXISTS dbt3_s001;
CREATE DATABASE dbt3_s001;
use dbt3_s001;
set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='extended_keys=off';
#
# Bug mdev-503: optimizer ignores setting use_stat_tables='preferably'
#
flush tables
customer, lineitem, nation, orders, part, partsupp, region, supplier;
set use_stat_tables='never';
EXPLAIN select sql_calc_found_rows straight_join
l_orderkey, sum(l_extendedprice*(1-l_discount)) as revenue,
o_orderdate, o_shippriority
from orders, customer, lineitem
where c_mktsegment = 'BUILDING' and c_custkey = o_custkey
and l_orderkey = o_orderkey and o_orderdate < date '1995-03-15'
and l_shipdate > date '1995-03-15'
group by l_orderkey, o_orderdate, o_shippriority
order by revenue desc, o_orderdate
limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE orders ALL PRIMARY,i_o_orderdate,i_o_custkey NULL NULL NULL # Using where; Using temporary; Using filesort
1 SIMPLE customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey # Using where
1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey # Using where
set use_stat_tables='preferably';
EXPLAIN select sql_calc_found_rows straight_join
l_orderkey, sum(l_extendedprice*(1-l_discount)) as revenue,
o_orderdate, o_shippriority
from orders, customer, lineitem
where c_mktsegment = 'BUILDING' and c_custkey = o_custkey
and l_orderkey = o_orderkey and o_orderdate < date '1995-03-15'
and l_shipdate > date '1995-03-15'
group by l_orderkey, o_orderdate, o_shippriority
order by revenue desc, o_orderdate
limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE orders ALL PRIMARY,i_o_orderdate,i_o_custkey NULL NULL NULL 1500 Using where; Using temporary; Using filesort
1 SIMPLE customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 Using where
1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
flush tables customer, orders, lineitem;
EXPLAIN select sql_calc_found_rows straight_join
l_orderkey, sum(l_extendedprice*(1-l_discount)) as revenue,
o_orderdate, o_shippriority
from orders, customer, lineitem
where c_mktsegment = 'BUILDING' and c_custkey = o_custkey
and l_orderkey = o_orderkey and o_orderdate < date '1995-03-15'
and l_shipdate > date '1995-03-15'
group by l_orderkey, o_orderdate, o_shippriority
order by revenue desc, o_orderdate
limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE orders ALL PRIMARY,i_o_orderdate,i_o_custkey NULL NULL NULL 1500 Using where; Using temporary; Using filesort
1 SIMPLE customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 Using where
1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
# End of the test case for mdev-503
set optimizer_switch=@save_optimizer_switch;
DROP DATABASE dbt3_s001;
use test;
set use_stat_tables=@save_use_stat_tables;
SET SESSION STORAGE_ENGINE=DEFAULT;
This diff is collapsed.
set @save_use_stat_tables=@@use_stat_tables;
set use_stat_tables='preferably';
DROP DATABASE IF EXISTS dbt3_s001;
CREATE DATABASE dbt3_s001;
use dbt3_s001;
set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='extended_keys=off';
select * from mysql.table_stats;
db_name table_name cardinality
dbt3_s001 customer 150
dbt3_s001 lineitem 6005
dbt3_s001 nation 25
dbt3_s001 orders 1500
dbt3_s001 part 200
dbt3_s001 partsupp 700
dbt3_s001 region 5
dbt3_s001 supplier 10
select * from mysql.index_stats;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 customer PRIMARY 1 1.0000
dbt3_s001 customer i_c_nationkey 1 6.0000
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
dbt3_s001 lineitem i_l_shipdate 1 2.6500
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
dbt3_s001 lineitem i_l_partkey 1 30.0250
dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_receiptdate 1 2.6477
dbt3_s001 lineitem i_l_orderkey 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
dbt3_s001 lineitem i_l_commitdate 1 2.7160
dbt3_s001 nation PRIMARY 1 1.0000
dbt3_s001 nation i_n_regionkey 1 5.0000
dbt3_s001 orders PRIMARY 1 1.0000
dbt3_s001 orders i_o_orderdate 1 1.3321
dbt3_s001 orders i_o_custkey 1 15.0000
dbt3_s001 part PRIMARY 1 1.0000
dbt3_s001 partsupp PRIMARY 1 3.5000
dbt3_s001 partsupp PRIMARY 2 1.0000
dbt3_s001 partsupp i_ps_partkey 1 3.5000
dbt3_s001 partsupp i_ps_suppkey 1 70.0000
dbt3_s001 region PRIMARY 1 1.0000
dbt3_s001 supplier PRIMARY 1 1.0000
dbt3_s001 supplier i_s_nationkey 1 1.1111
flush table lineitem;
set use_stat_tables='never';
select sum(l_extendedprice*l_discount) as revenue
from lineitem
where l_shipdate >= date '1994-01-01'
and l_shipdate < date '1994-01-01' + interval '1' year
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
and l_quantity < 24;
revenue
77949.91860000002
set debug_sync='statistics_mem_alloc_start1 WAIT_FOR second_thread_started_too';
set debug_sync='statistics_mem_alloc_start2 SIGNAL first_thread_working';
use dbt3_s001;
set use_stat_tables='preferably';
select sum(l_extendedprice*l_discount) as revenue
from lineitem
where l_shipdate >= date '1994-01-01'
and l_shipdate < date '1994-01-01' + interval '1' year
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
and l_quantity < 24 ;
set debug_sync='statistics_mem_alloc_start1 SIGNAL second_thread_started_too';
set debug_sync='statistics_mem_alloc_start2 WAIT_FOR first_thread_working';
use dbt3_s001;
set use_stat_tables='preferably';
select sum(l_extendedprice*l_discount) as revenue
from lineitem
where l_shipdate >= date '1994-01-01'
and l_shipdate < date '1994-01-01' + interval '1' year
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
and l_quantity < 24;
revenue
77949.91860000002
revenue
77949.91860000002
set use_stat_tables='preferably';
set debug_sync='RESET';
select * from mysql.index_stats where table_name='lineitem' order by index_name;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
dbt3_s001 lineitem i_l_commitdate 1 2.7160
dbt3_s001 lineitem i_l_orderkey 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
dbt3_s001 lineitem i_l_partkey 1 30.0250
dbt3_s001 lineitem i_l_receiptdate 1 2.6477
dbt3_s001 lineitem i_l_shipdate 1 2.6500
dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
delete from mysql.index_stats
where table_name='lineitem' and
index_name in ('i_l_shipdate', 'i_l_receiptdate');
select * from mysql.index_stats where table_name='lineitem' order by index_name;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
dbt3_s001 lineitem i_l_commitdate 1 2.7160
dbt3_s001 lineitem i_l_orderkey 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
dbt3_s001 lineitem i_l_partkey 1 30.0250
dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
analyze table lineitem persistent for columns() indexes (i_l_shipdate);
select * from mysql.index_stats where table_name='lineitem' order by index_name;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
dbt3_s001 lineitem i_l_commitdate 1 2.7160
dbt3_s001 lineitem i_l_orderkey 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
dbt3_s001 lineitem i_l_partkey 1 30.0250
dbt3_s001 lineitem i_l_shipdate 1 2.6500
dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
delete from mysql.index_stats
where table_name='lineitem' and index_name= 'i_l_shipdate';
select * from mysql.index_stats where table_name='lineitem' order by index_name;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
dbt3_s001 lineitem i_l_commitdate 1 2.7160
dbt3_s001 lineitem i_l_orderkey 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
dbt3_s001 lineitem i_l_partkey 1 30.0250
dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
set debug_sync='statistics_collection_start1 WAIT_FOR second_thread_started_too';
set debug_sync='statistics_collection_start2 SIGNAL first_thread_working';
use dbt3_s001;
set use_stat_tables='preferably';
analyze table lineitem persistent for columns() indexes (i_l_shipdate);
set debug_sync='statistics_collection_start1 SIGNAL second_thread_started_too';
set debug_sync='statistics_collection_start2 WAIT_FOR first_thread_working';
use dbt3_s001;
set use_stat_tables='preferably';
analyze table lineitem persistent for columns() indexes (i_l_receiptdate);
set debug_sync='RESET';
select * from mysql.index_stats where table_name='lineitem' order by index_name;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
dbt3_s001 lineitem i_l_commitdate 1 2.7160
dbt3_s001 lineitem i_l_orderkey 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
dbt3_s001 lineitem i_l_partkey 1 30.0250
dbt3_s001 lineitem i_l_receiptdate 1 2.6477
dbt3_s001 lineitem i_l_shipdate 1 2.6500
dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
select * from mysql.index_stats where table_name='lineitem'
order by index_name, prefix_arity;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
dbt3_s001 lineitem i_l_commitdate 1 2.7160
dbt3_s001 lineitem i_l_orderkey 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
dbt3_s001 lineitem i_l_partkey 1 30.0250
dbt3_s001 lineitem i_l_receiptdate 1 2.6477
dbt3_s001 lineitem i_l_shipdate 1 2.6500
dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
set debug_sync='RESET';
set debug_sync='statistics_collection_start SIGNAL parked WAIT_FOR finish';
use dbt3_s001;
set use_stat_tables='preferably';
analyze table lineitem persistent for all;
set debug_sync='now WAIT_FOR parked';
use dbt3_s001;
set use_stat_tables='never';
set debug_sync='now SIGNAL finish';
set debug_sync='RESET';
select * from mysql.index_stats where table_name='lineitem'
order by index_name, prefix_arity;
db_name table_name index_name prefix_arity avg_frequency
dbt3_s001 lineitem PRIMARY 1 4.0033
dbt3_s001 lineitem PRIMARY 2 1.0000
dbt3_s001 lineitem i_l_commitdate 1 2.7160
dbt3_s001 lineitem i_l_orderkey 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
dbt3_s001 lineitem i_l_partkey 1 30.0250
dbt3_s001 lineitem i_l_receiptdate 1 2.6477
dbt3_s001 lineitem i_l_shipdate 1 2.6500
dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
set @save_global_use_stat_tables=@@global.use_stat_tables;
set global use_stat_tables='preferably';
set debug_sync='RESET';
set debug_sync='statistics_update_start SIGNAL parker WAIT_FOR go1 EXECUTE 1';
set debug_sync='thr_multi_lock_after_thr_lock SIGNAL go2 EXECUTE 2';
use dbt3_s001;
analyze table lineitem persistent for all;
set debug_sync='open_and_process_table WAIT_FOR parker';
set debug_sync='statistics_read_start SIGNAL go1 WAIT_FOR go2';
use dbt3_s001;
select * from mysql.index_stats, lineitem where index_name= 'i_l_shipdate' and l_orderkey=1 and l_partkey=68;
db_name table_name index_name prefix_arity avg_frequency l_orderkey l_partkey l_suppkey l_linenumber l_quantity l_extendedprice l_discount l_tax l_returnflag l_linestatus l_shipDATE l_commitDATE l_receiptDATE l_shipinstruct l_shipmode l_comment
dbt3_s001 lineitem i_l_shipdate 1 2.6500 1 68 9 2 36 34850.16 0.09 0.06 N O 1996-04-12 1996-02-28 1996-04-20 TAKE BACK RETURN MAIL slyly bold pinto beans detect s
set debug_sync='RESET';
set global use_stat_tables=@save_global_use_stat_tables;
DROP DATABASE dbt3_s001;
use test;
set use_stat_tables=@save_use_stat_tables;
This diff is collapsed.
#
# Bug mdev-3866: valgrind complain from ANALYZE on a table with BIT field
#
SET use_stat_tables = 'preferably';
CREATE TABLE t1 (pk int PRIMARY KEY, a bit(1), INDEX idx(a)
) ENGINE=MyISAM PARTITION BY KEY(pk) PARTITIONS 2;
INSERT INTO t1 VALUES (1,1),(2,0),(3,0),(4,1);
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
SET use_stat_tables = DEFAULT;
DROP TABLE t1;
#
# Bug mdev-463: assertion failure when running ANALYZE with RBR on
#
SET GLOBAL use_stat_tables = PREFERABLY;
CREATE TABLE t1 (i INT) ENGINE=InnoDB;
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
DROP TABLE t1;
SET GLOBAL use_stat_tables = DEFAULT;
SET use_stat_tables = PREFERABLY;
CREATE TABLE t1 ( a INT ) ENGINE=MyISAM PARTITION BY HASH(a) PARTITIONS 2;
ALTER TABLE t1 ANALYZE PARTITION p1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 246 Server ver: #, Binlog ver: #
master-bin.000001 246 Binlog_checkpoint 1 286 master-bin.000001
master-bin.000001 286 Query 1 386 use `test`; CREATE TABLE t1 (i INT) ENGINE=InnoDB
master-bin.000001 386 Query 1 465 use `test`; ANALYZE TABLE t1
master-bin.000001 465 Query 1 569 use `test`; DROP TABLE `t1` /* generated by server */
master-bin.000001 569 Query 1 705 use `test`; CREATE TABLE t1 ( a INT ) ENGINE=MyISAM PARTITION BY HASH(a) PARTITIONS 2
master-bin.000001 705 Query 1 803 use `test`; ALTER TABLE t1 ANALYZE PARTITION p1
SET use_stat_tables = DEFAULT;
DROP TABLE t1;
include/master-slave.inc
[connection master]
#
# Bug mdev-485: unexpected failure with replication of DROP/ALTER table
# when RBR is on
#
CREATE TABLE t1 ( a int, b int ) ENGINE=MyISAM;
INSERT INTO t1 VALUES (2,20), (1,20), (3,30);
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
DROP TABLE t1;
CREATE TABLE t1 ( a int, b int, INDEX idx1(b) ) ENGINE=MyISAM;
INSERT INTO t1 VALUES (2,20), (1,20), (3,30);
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
DROP INDEX idx1 ON t1;
DROP TABLE t1;
CREATE TABLE t1 ( a int, b int, INDEX idx1(b) ) ENGINE=MyISAM;
INSERT INTO t1 VALUES (2,20), (1,20), (3,30);
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
ALTER TABLE t1 DROP COLUMN b;
DROP TABLE t1;
CREATE TABLE t1 ( a int, b int, INDEX idx1(b) ) ENGINE=MyISAM;
INSERT INTO t1 VALUES (2,20), (1,20), (3,30);
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
ALTER TABLE t1 RENAME to s;
DROP TABLE s;
CREATE TABLE t1 ( a int, b int, INDEX idx1(b) ) ENGINE=MyISAM;
INSERT INTO t1 VALUES (2,20), (1,20), (3,30);
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
ALTER TABLE t1 CHANGE COLUMN b c int ;
DROP TABLE t1;
include/rpl_end.inc
This diff is collapsed.
......@@ -108,7 +108,7 @@ Handler_mrr_key_refills 0
Handler_mrr_rowid_refills 0
Handler_prepare 18
Handler_read_first 0
Handler_read_key 3
Handler_read_key 9
Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
......@@ -124,7 +124,7 @@ Handler_update 5
Handler_write 7
select variable_value - @global_read_key as "handler_read_key" from information_schema.global_status where variable_name="handler_read_key";
handler_read_key
3
9
set @@global.userstat=0;
select * from information_schema.index_statistics;
TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ
......
......@@ -2247,5 +2247,36 @@ MAX(a) bb
NULL NULL
drop table t1, t2;
set optimizer_switch=@subselect4_tmp;
#
# MDEV-3899 Valgrind warnings (blocks are definitely lost) in filesort on IN subquery with SUM and DISTINCT
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(9);
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (8);
SELECT * FROM t1
WHERE (1, 1) IN (SELECT a, SUM(DISTINCT a) FROM t1, t2 GROUP BY a);
a
1
9
drop table t1, t2;
#
# MDEV-3902 Assertion `record_length == m_record_length' failed at Filesort_buffer::alloc_sort_buffer
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (pk INT PRIMARY KEY, b INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,1),(2,7);
CREATE TABLE t3 (c INT) ENGINE=MyISAM;
INSERT INTO t3 VALUES (8);
SELECT * FROM t1
WHERE (1, 5) IN (SELECT b, SUM(DISTINCT b) FROM t2, t3 GROUP BY b);
a
SELECT * FROM t2 AS alias1, t2 AS alias2
WHERE EXISTS ( SELECT 1 ) AND (alias2.pk = alias1.b )
ORDER BY alias1.b;
pk b pk b
1 1 1 1
drop table t1, t2, t3;
SET optimizer_switch= @@global.optimizer_switch;
set @@tmp_table_size= @@global.tmp_table_size;
......@@ -399,10 +399,10 @@ WHERE Code = Country GROUP BY Code)
order by Country;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY CountryLanguage index NULL PRIMARY 33 NULL 984 Using where; Using index
3 MATERIALIZED CountryLanguage index PRIMARY PRIMARY 33 NULL 984 Using index; Using temporary
3 MATERIALIZED Country eq_ref PRIMARY PRIMARY 3 world.CountryLanguage.Country 1 Using index
2 MATERIALIZED CountryLanguage index PRIMARY PRIMARY 33 NULL 984 Using index; Using temporary
2 MATERIALIZED Country eq_ref PRIMARY PRIMARY 3 world.CountryLanguage.Country 1 Using index
3 MATERIALIZED Country index PRIMARY PRIMARY 3 NULL 239 Using index
3 MATERIALIZED CountryLanguage ref PRIMARY PRIMARY 3 world.Country.Code 4 Using index
2 MATERIALIZED Country index PRIMARY PRIMARY 3 NULL 239 Using index
2 MATERIALIZED CountryLanguage ref PRIMARY PRIMARY 3 world.Country.Code 4 Using index
select count(*)
from CountryLanguage
where
......
show tables;
Tables_in_db
column_stats
columns_priv
db
event
......@@ -10,6 +11,7 @@ help_keyword
help_relation
help_topic
host
index_stats
innodb_index_stats
innodb_table_stats
ndb_binlog_index
......@@ -22,6 +24,7 @@ slave_master_info
slave_relay_log_info
slave_worker_info
slow_log
table_stats
tables_priv
time_zone
time_zone_leap_second
......@@ -269,5 +272,36 @@ slow_log CREATE TABLE `slow_log` (
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
show create table table_stats;
Table Create Table
table_stats CREATE TABLE `table_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`cardinality` bigint(21) unsigned DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Tables'
show create table column_stats;
Table Create Table
column_stats CREATE TABLE `column_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`column_name` varchar(64) COLLATE utf8_bin NOT NULL,
`min_value` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`max_value` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`nulls_ratio` decimal(12,4) DEFAULT NULL,
`avg_length` decimal(12,4) DEFAULT NULL,
`avg_frequency` decimal(12,4) DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`,`column_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Columns'
show create table index_stats;
Table Create Table
index_stats CREATE TABLE `index_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`index_name` varchar(64) COLLATE utf8_bin NOT NULL,
`prefix_arity` int(11) unsigned NOT NULL,
`avg_frequency` decimal(12,4) DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`,`index_name`,`prefix_arity`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Indexes'
show tables;
Tables_in_test
show tables;
Tables_in_db
column_stats
columns_priv
db
event
......@@ -10,6 +11,7 @@ help_keyword
help_relation
help_topic
host
index_stats
innodb_index_stats
innodb_table_stats
ndb_binlog_index
......@@ -22,6 +24,7 @@ slave_master_info
slave_relay_log_info
slave_worker_info
slow_log
table_stats
tables_priv
time_zone
time_zone_leap_second
......@@ -269,5 +272,36 @@ slow_log CREATE TABLE `slow_log` (
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
show create table table_stats;
Table Create Table
table_stats CREATE TABLE `table_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`cardinality` bigint(21) unsigned DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Tables'
show create table column_stats;
Table Create Table
column_stats CREATE TABLE `column_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`column_name` varchar(64) COLLATE utf8_bin NOT NULL,
`min_value` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`max_value` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`nulls_ratio` double DEFAULT NULL,
`avg_length` double DEFAULT NULL,
`avg_frequency` double DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`,`column_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Columns'
show create table index_stats;
Table Create Table
index_stats CREATE TABLE `index_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`index_name` varchar(64) COLLATE utf8_bin NOT NULL,
`prefix_arity` int(11) unsigned NOT NULL,
`avg_frequency` double DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`,`index_name`,`prefix_arity`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Indexes'
show tables;
Tables_in_test
show tables;
Tables_in_db
column_stats
columns_priv
db
event
......@@ -10,6 +11,7 @@ help_keyword
help_relation
help_topic
host
index_stats
innodb_index_stats
innodb_table_stats
ndb_binlog_index
......@@ -22,6 +24,7 @@ slave_master_info
slave_relay_log_info
slave_worker_info
slow_log
table_stats
tables_priv
time_zone
time_zone_leap_second
......@@ -269,5 +272,36 @@ slow_log CREATE TABLE `slow_log` (
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
show create table table_stats;
Table Create Table
table_stats CREATE TABLE `table_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`cardinality` bigint(21) unsigned DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Tables'
show create table column_stats;
Table Create Table
column_stats CREATE TABLE `column_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`column_name` varchar(64) COLLATE utf8_bin NOT NULL,
`min_value` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`max_value` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`nulls_ratio` double DEFAULT NULL,
`avg_length` double DEFAULT NULL,
`avg_frequency` double DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`,`column_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Columns'
show create table index_stats;
Table Create Table
index_stats CREATE TABLE `index_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`index_name` varchar(64) COLLATE utf8_bin NOT NULL,
`prefix_arity` int(11) unsigned NOT NULL,
`avg_frequency` double DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`,`index_name`,`prefix_arity`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Indexes'
show tables;
Tables_in_test
show tables;
Tables_in_db
column_stats
columns_priv
db
event
......@@ -10,6 +11,7 @@ help_keyword
help_relation
help_topic
host
index_stats
innodb_index_stats
innodb_table_stats
ndb_binlog_index
......@@ -22,6 +24,7 @@ slave_master_info
slave_relay_log_info
slave_worker_info
slow_log
table_stats
tables_priv
time_zone
time_zone_leap_second
......@@ -269,5 +272,36 @@ slow_log CREATE TABLE `slow_log` (
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
show create table table_stats;
Table Create Table
table_stats CREATE TABLE `table_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`cardinality` bigint(21) unsigned DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Tables'
show create table column_stats;
Table Create Table
column_stats CREATE TABLE `column_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`column_name` varchar(64) COLLATE utf8_bin NOT NULL,
`min_value` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`max_value` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`nulls_ratio` double DEFAULT NULL,
`avg_length` double DEFAULT NULL,
`avg_frequency` double DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`,`column_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Columns'
show create table index_stats;
Table Create Table
index_stats CREATE TABLE `index_stats` (
`db_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`index_name` varchar(64) COLLATE utf8_bin NOT NULL,
`prefix_arity` int(11) unsigned NOT NULL,
`avg_frequency` double DEFAULT NULL,
PRIMARY KEY (`db_name`,`table_name`,`index_name`,`prefix_arity`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Indexes'
show tables;
Tables_in_test
......@@ -11,6 +11,7 @@ Note 1265 Data truncated for column 'c1' at row 1
INSERT IGNORE INTO t1 (c1) VALUES(NOW());
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Warning 1062 Duplicate entry '2007-02-13' for key 'c1'
SELECT * FROM t1;
c1
2007-02-13
......@@ -20,6 +21,8 @@ CREATE TABLE t1(c1 YEAR NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(1999);
INSERT INTO t1 (c1) VALUES(2000);
INSERT IGNORE INTO t1 (c1) VALUES(1999);
Warnings:
Warning 1062 Duplicate entry '1999' for key 'c1'
SELECT * FROM t1;
c1
1999
......@@ -36,6 +39,7 @@ Note 1265 Data truncated for column 'c1' at row 1
INSERT IGNORE INTO t1 (c1) VALUES(NOW());
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Warning 1062 Duplicate entry '09:09:33' for key 'c1'
SELECT * FROM t1;
c1
09:09:33
......@@ -45,6 +49,8 @@ CREATE TABLE t1(c1 YEAR NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(1999);
INSERT INTO t1 (c1) VALUES(2000);
INSERT IGNORE INTO t1 (c1) VALUES(1999);
Warnings:
Warning 1062 Duplicate entry '1999' for key 'c1'
SELECT * FROM t1;
c1
1999
......@@ -55,6 +61,8 @@ SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1) VALUES(NOW());
INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01'));
INSERT IGNORE INTO t1 (c1) VALUES(NOW());
Warnings:
Warning 1062 Duplicate entry '2007-02-13 09:09:33' for key 'c1'
SELECT * FROM t1;
c1
2007-02-13 09:09:33
......@@ -64,6 +72,8 @@ CREATE TABLE t1(c1 YEAR NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(1999);
INSERT INTO t1 (c1) VALUES(2000);
INSERT IGNORE INTO t1 (c1) VALUES(1999);
Warnings:
Warning 1062 Duplicate entry '1999' for key 'c1'
SELECT * FROM t1;
c1
1999
......@@ -74,6 +84,8 @@ SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1) VALUES(NOW());
INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01'));
INSERT IGNORE INTO t1 (c1) VALUES(NOW());
Warnings:
Warning 1062 Duplicate entry '2007-02-13 09:09:33' for key 'c1'
SELECT * FROM t1;
c1
2007-02-13 09:09:33
......@@ -83,6 +95,8 @@ CREATE TABLE t1(c1 YEAR NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(1999);
INSERT INTO t1 (c1) VALUES(2000);
INSERT IGNORE INTO t1 (c1) VALUES(1999);
Warnings:
Warning 1062 Duplicate entry '1999' for key 'c1'
SELECT * FROM t1;
c1
1999
......
......@@ -27,11 +27,13 @@ Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Note 1265 Data truncated for column 'c2' at row 1
Note 1265 Data truncated for column 'c3' at row 1
Warning 1062 Duplicate entry '2007-02-13-2007-02-13-2007-02-13' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01'));
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Note 1265 Data truncated for column 'c2' at row 1
Note 1265 Data truncated for column 'c3' at row 1
Warning 1062 Duplicate entry '2007-02-13-2007-02-13-2007-02-14' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
2007-02-13 2007-02-13 2007-02-13
......@@ -45,7 +47,11 @@ INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,2000,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(2000,1999,1999);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(1999,1999,1999);
Warnings:
Warning 1062 Duplicate entry '1999-1999-1999' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
Warnings:
Warning 1062 Duplicate entry '1999-1999-2000' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
1999 1999 1999
......@@ -80,11 +86,13 @@ Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Note 1265 Data truncated for column 'c2' at row 1
Note 1265 Data truncated for column 'c3' at row 1
Warning 1062 Duplicate entry '09:09:33-09:09:33-09:09:33' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01'));
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Note 1265 Data truncated for column 'c2' at row 1
Note 1265 Data truncated for column 'c3' at row 1
Warning 1062 Duplicate entry '09:09:33-09:09:33-10:10:34' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
09:09:33 09:09:33 09:09:33
......@@ -98,7 +106,11 @@ INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,2000,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(2000,1999,1999);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(1999,1999,1999);
Warnings:
Warning 1062 Duplicate entry '1999-1999-1999' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
Warnings:
Warning 1062 Duplicate entry '1999-1999-2000' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
1999 1999 1999
......@@ -113,7 +125,11 @@ INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01'));
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW());
INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW());
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
Warnings:
Warning 1062 Duplicate entry '2007-02-13 09:09:33-2007-02-13 09:09:33-2007-02-13 09:09:33' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01'));
Warnings:
Warning 1062 Duplicate entry '2007-02-13 09:09:33-2007-02-13 09:09:33-2007-02-14 10:10:34' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
2007-02-13 09:09:33 2007-02-13 09:09:33 2007-02-13 09:09:33
......@@ -127,7 +143,11 @@ INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,2000,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(2000,1999,1999);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(1999,1999,1999);
Warnings:
Warning 1062 Duplicate entry '1999-1999-1999' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
Warnings:
Warning 1062 Duplicate entry '1999-1999-2000' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
1999 1999 1999
......@@ -142,7 +162,11 @@ INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01'));
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW());
INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW());
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
Warnings:
Warning 1062 Duplicate entry '2007-02-13 09:09:33-2007-02-13 09:09:33-2007-02-13 09:09:33' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01'));
Warnings:
Warning 1062 Duplicate entry '2007-02-13 09:09:33-2007-02-13 09:09:33-2007-02-14 10:10:34' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
2007-02-13 09:09:33 2007-02-13 09:09:33 2007-02-13 09:09:33
......@@ -156,7 +180,11 @@ INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,2000,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(2000,1999,1999);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(1999,1999,1999);
Warnings:
Warning 1062 Duplicate entry '1999-1999-1999' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
Warnings:
Warning 1062 Duplicate entry '1999-1999-2000' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
1999 1999 1999
......
......@@ -8,8 +8,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
......@@ -29,8 +35,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
......@@ -50,8 +62,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
......@@ -71,8 +89,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
......@@ -92,8 +116,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
......@@ -113,8 +143,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
......@@ -134,8 +170,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
......@@ -155,8 +197,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
......@@ -176,8 +224,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
......@@ -197,8 +251,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
......@@ -218,8 +278,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
......@@ -239,8 +305,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
......@@ -260,8 +332,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
......@@ -281,8 +359,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES(11,11,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,10,11);
INSERT INTO t1 (c1,c2,c3) VALUES(10,11,11);
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,10);
Warnings:
Warning 1062 Duplicate entry '10-10-10' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,10,11);
Warnings:
Warning 1062 Duplicate entry '10-10-11' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(10,11,11);
Warnings:
Warning 1062 Duplicate entry '10-11-11' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
10 10 10
......
......@@ -8,8 +8,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
Warnings:
Warning 1062 Duplicate entry 'abc-abc-abc' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
Warnings:
Warning 1062 Duplicate entry 'abc-abc-def' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','def','def');
Warnings:
Warning 1062 Duplicate entry 'abc-def-def' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
abc abc abc
......@@ -29,8 +35,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
Warnings:
Warning 1062 Duplicate entry 'abc-abc-abc' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
Warnings:
Warning 1062 Duplicate entry 'abc-abc-def' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','def','def');
Warnings:
Warning 1062 Duplicate entry 'abc-def-def' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
abc abc abc
......@@ -50,8 +62,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
Warnings:
Warning 1062 Duplicate entry 'abc-abc-abc' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
Warnings:
Warning 1062 Duplicate entry 'abc-abc-def' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','def','def');
Warnings:
Warning 1062 Duplicate entry 'abc-def-def' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
abc
......@@ -65,8 +83,14 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
Warnings:
Warning 1062 Duplicate entry 'abc-abc-abc' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
Warnings:
Warning 1062 Duplicate entry 'abc-abc-def' for key 'c1'
INSERT IGNORE INTO t1 (c1,c2,c3) VALUES('abc','def','def');
Warnings:
Warning 1062 Duplicate entry 'abc-def-def' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
abc abc abc
......
......@@ -3,6 +3,8 @@ CREATE TABLE t1(c1 TINYINT NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
......@@ -12,6 +14,8 @@ CREATE TABLE t1(c1 SMALLINT NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
......@@ -21,6 +25,8 @@ CREATE TABLE t1(c1 MEDIUMINT NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
......@@ -30,6 +36,8 @@ CREATE TABLE t1(c1 INT NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
......@@ -39,6 +47,8 @@ CREATE TABLE t1(c1 INTEGER NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
......@@ -48,6 +58,8 @@ CREATE TABLE t1(c1 BIGINT NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
......@@ -57,6 +69,8 @@ CREATE TABLE t1(c1 DECIMAL NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
......@@ -66,6 +80,8 @@ CREATE TABLE t1(c1 DEC NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
......@@ -75,6 +91,8 @@ CREATE TABLE t1(c1 FIXED NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
......@@ -84,6 +102,8 @@ CREATE TABLE t1(c1 NUMERIC NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
......@@ -93,6 +113,8 @@ CREATE TABLE t1(c1 DOUBLE NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
......@@ -102,6 +124,8 @@ CREATE TABLE t1(c1 REAL NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
......@@ -111,6 +135,8 @@ CREATE TABLE t1(c1 DOUBLE PRECISION NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
......@@ -120,6 +146,8 @@ CREATE TABLE t1(c1 FLOAT NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'PRIMARY'
SELECT * FROM t1;
c1
10
......
......@@ -3,6 +3,8 @@ CREATE TABLE t1(c1 TINYINT NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
......@@ -12,6 +14,8 @@ CREATE TABLE t1(c1 SMALLINT NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
......@@ -21,6 +25,8 @@ CREATE TABLE t1(c1 MEDIUMINT NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
......@@ -30,6 +36,8 @@ CREATE TABLE t1(c1 INT NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
......@@ -39,6 +47,8 @@ CREATE TABLE t1(c1 INTEGER NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
......@@ -48,6 +58,8 @@ CREATE TABLE t1(c1 BIGINT NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
......@@ -57,6 +69,8 @@ CREATE TABLE t1(c1 DECIMAL NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
......@@ -66,6 +80,8 @@ CREATE TABLE t1(c1 DEC NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
......@@ -75,6 +91,8 @@ CREATE TABLE t1(c1 FIXED NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
......@@ -84,6 +102,8 @@ CREATE TABLE t1(c1 NUMERIC NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
......@@ -93,6 +113,8 @@ CREATE TABLE t1(c1 DOUBLE NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
......@@ -102,6 +124,8 @@ CREATE TABLE t1(c1 REAL NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
......@@ -111,6 +135,8 @@ CREATE TABLE t1(c1 DOUBLE PRECISION NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
......@@ -120,6 +146,8 @@ CREATE TABLE t1(c1 FLOAT NULL UNIQUE);
INSERT INTO t1 (c1) VALUES(10);
INSERT INTO t1 (c1) VALUES(11);
INSERT IGNORE INTO t1 (c1) VALUES(10);
Warnings:
Warning 1062 Duplicate entry '10' for key 'c1'
SELECT * FROM t1;
c1
10
......
......@@ -2,6 +2,8 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 TEXT);
ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
TRUNCATE TABLE t1;
Warnings:
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
SELECT * FROM t1 ORDER BY c1;
c1 c2
1 abc
......
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 TEXT);
LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_unique_error1.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
Warnings:
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
SELECT * FROM t1 ORDER BY c1;
c1 c2
1 abc
......@@ -10,6 +12,8 @@ c1 c2
DROP TABLE t1;
CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 TEXT);
LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_unique_error1.inc' IGNORE INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
Warnings:
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
SELECT * FROM t1 ORDER BY c1;
c1 c2
1 abc
......
......@@ -4,6 +4,9 @@ INSERT INTO t1 VALUES(3,'a');
ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
TRUNCATE TABLE t1;
INSERT INTO t1 VALUES(3,'a');
Warnings:
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
SELECT * FROM t1 ORDER BY c1;
c1 c2
1 abc
......
......@@ -12,6 +12,10 @@ Tables_in_test
t1
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
TRUNCATE TABLE t1;
Warnings:
Warning 1062 Duplicate entry '1' for key 'PRIMARY'
Warning 1062 Duplicate entry '1' for key 'PRIMARY'
Warning 1062 Duplicate entry '0' for key 'PRIMARY'
SELECT * FROM t1 ORDER BY c1;
c1 c2
0 def
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment