Commit 1125dfd6 authored by Kristofer Pettersson's avatar Kristofer Pettersson

Automerge

parents b3bb760c 58701cae
......@@ -517,9 +517,14 @@ static int process_all_tables_in_db(char *database)
LINT_INIT(res);
if (use_db(database))
return 1;
if (mysql_query(sock, "SHOW /*!50002 FULL*/ TABLES") ||
!((res= mysql_store_result(sock))))
if ((mysql_query(sock, "SHOW /*!50002 FULL*/ TABLES") &&
mysql_query(sock, "SHOW TABLES")) ||
!(res= mysql_store_result(sock)))
{
my_printf_error(0, "Error: Couldn't get table list for database %s: %s",
MYF(0), database, mysql_error(sock));
return 1;
}
num_columns= mysql_num_fields(res);
......
......@@ -384,6 +384,7 @@ static void emb_free_embedded_thd(MYSQL *mysql)
thd->clear_data_list();
thread_count--;
thd->store_globals();
thd->unlink();
delete thd;
mysql->thd=0;
}
......@@ -627,6 +628,7 @@ void *create_embedded_thd(int client_flag)
bzero((char*) &thd->net, sizeof(thd->net));
thread_count++;
threads.append(thd);
return thd;
err:
delete(thd);
......
# include/wait_condition.inc
#
# SUMMARY
#
# Waits until the passed statement returns true, or the operation
# times out.
#
# USAGE
#
# let $wait_condition=
# SELECT c = 3 FROM t;
# --source include/wait_condition.inc
#
# OR
#
# let $wait_timeout= 60; # Override default 30 seconds with 60.
# let $wait_condition=
# SELECT c = 3 FROM t;
# --source include/wait_condition.inc
# --echo Executed the test condition $wait_condition_reps times
#
# EXAMPLE
# events_bugs.test, events_time_zone.test
#
--disable_query_log
let $wait_counter= 300;
if ($wait_timeout)
{
let $wait_counter= `SELECT $wait_timeout * 10`;
}
# Reset $wait_timeout so that its value won't be used on subsequent
# calls, and default will be used instead.
let $wait_timeout= 0;
# Keep track of how many times the wait condition is tested
# This is used by some tests (e.g., main.status)
let $wait_condition_reps= 0;
while ($wait_counter)
{
let $success= `$wait_condition`;
inc $wait_condition_reps;
if ($success)
{
let $wait_counter= 0;
}
if (!$success)
{
real_sleep 0.1;
dec $wait_counter;
}
}
if (!$success)
{
echo Timeout in wait_condition.inc for $wait_condition;
}
--enable_query_log
......@@ -1754,8 +1754,8 @@ create table t1 like information_schema.character_sets;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`CHARACTER_SET_NAME` varchar(64) NOT NULL DEFAULT '',
`DEFAULT_COLLATE_NAME` varchar(64) NOT NULL DEFAULT '',
`CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '',
`DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '',
`DESCRIPTION` varchar(60) NOT NULL DEFAULT '',
`MAXLEN` bigint(3) NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8
......
......@@ -2130,6 +2130,15 @@ Table Checksum
test.t1 2465757603
DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (a TEXT, b TEXT, KEY(b(1)));
INSERT INTO t1 VALUES (NULL, NULL), (NULL, NULL), (NULL, NULL), (NULL, NULL);
CREATE TABLE t1
(a TEXT, b TEXT, KEY(b(1))) ENGINE=FEDERATED
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
SELECT t1.a FROM t1, t1 as t2 WHERE t2.b NOT LIKE t1.b;
a
DROP TABLE t1;
DROP TABLE t1;
End of 5.0 tests
create server 's1' foreign data wrapper 'mysql' options (port 3306);
drop server 's1';
......
......@@ -517,8 +517,8 @@ drop table t1;
SHOW CREATE TABLE INFORMATION_SCHEMA.character_sets;
Table Create Table
CHARACTER_SETS CREATE TEMPORARY TABLE `CHARACTER_SETS` (
`CHARACTER_SET_NAME` varchar(64) NOT NULL DEFAULT '',
`DEFAULT_COLLATE_NAME` varchar(64) NOT NULL DEFAULT '',
`CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '',
`DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '',
`DESCRIPTION` varchar(60) NOT NULL DEFAULT '',
`MAXLEN` bigint(3) NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8
......@@ -526,8 +526,8 @@ set names latin2;
SHOW CREATE TABLE INFORMATION_SCHEMA.character_sets;
Table Create Table
CHARACTER_SETS CREATE TEMPORARY TABLE `CHARACTER_SETS` (
`CHARACTER_SET_NAME` varchar(64) NOT NULL DEFAULT '',
`DEFAULT_COLLATE_NAME` varchar(64) NOT NULL DEFAULT '',
`CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '',
`DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '',
`DESCRIPTION` varchar(60) NOT NULL DEFAULT '',
`MAXLEN` bigint(3) NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8
......@@ -541,8 +541,8 @@ alter table t1 default character set utf8;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`CHARACTER_SET_NAME` varchar(64) NOT NULL DEFAULT '',
`DEFAULT_COLLATE_NAME` varchar(64) NOT NULL DEFAULT '',
`CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '',
`DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '',
`DESCRIPTION` varchar(60) NOT NULL DEFAULT '',
`MAXLEN` bigint(3) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8
......@@ -716,8 +716,8 @@ select column_type from information_schema.columns
where table_schema="information_schema" and table_name="COLUMNS" and
(column_name="character_set_name" or column_name="collation_name");
column_type
varchar(64)
varchar(64)
varchar(32)
varchar(32)
select TABLE_ROWS from information_schema.tables where
table_schema="information_schema" and table_name="COLUMNS";
TABLE_ROWS
......@@ -764,7 +764,6 @@ information_schema PARTITIONS PARTITION_DESCRIPTION
information_schema PLUGINS PLUGIN_DESCRIPTION
information_schema PROCESSLIST INFO
information_schema ROUTINES ROUTINE_DEFINITION
information_schema ROUTINES SQL_MODE
information_schema TRIGGERS ACTION_CONDITION
information_schema TRIGGERS ACTION_STATEMENT
information_schema VIEWS VIEW_DEFINITION
......@@ -1652,4 +1651,60 @@ id select_type table type possible_keys key key_len ref rows Extra
explain select count(*) from information_schema.views;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE views ALL NULL NULL NULL NULL NULL Open_frm_only; Scanned all databases
set global init_connect="drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;";
select * from information_schema.global_variables where variable_name='init_connect';
VARIABLE_NAME VARIABLE_VALUE
INIT_CONNECT drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists t1;
drop table if exists t1;drop table if exists
Warnings:
Warning 1265 Data truncated for column 'VARIABLE_VALUE' at row 1
set global init_connect="";
create table t0 select * from information_schema.global_status where VARIABLE_NAME='COM_SELECT';
SELECT 1;
1
1
select a.VARIABLE_VALUE - b.VARIABLE_VALUE from t0 b, information_schema.global_status a
where a.VARIABLE_NAME = b.VARIABLE_NAME;
a.VARIABLE_VALUE - b.VARIABLE_VALUE
2
drop table t0;
End of 5.1 tests.
......@@ -145,3 +145,9 @@ table_schema = "test" AND table_name = "t1";
PARTITION_DESCRIPTION
10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53
drop table t1;
drop table if exists t1;
create table t1 (f1 int key) partition by key(f1) partitions 2;
select create_options from information_schema.tables where table_schema="test";
create_options
partitioned
drop table t1;
......@@ -98,6 +98,19 @@ drop view v_bug25347;
drop table t_bug25347;
drop database d_bug25347;
use test;
create view v1 as select * from information_schema.routines;
check table v1, information_schema.routines;
Table Op Msg_type Msg_text
test.v1 check status OK
information_schema.routines check note The storage engine for the table doesn't support check
drop view v1;
CREATE TABLE t1(a INT);
CREATE TABLE t2(a INT);
test.t1
Error : Incorrect information in file: './test/t1.frm'
error : Corrupt
test.t2 OK
DROP TABLE t1, t2;
End of 5.0 tests
create table t1(a int);
create view v1 as select * from t1;
......
drop table if exists t1;
CREATE TABLE t1 (id INT PRIMARY KEY, data INT) ENGINE = InnoDB
PARTITION BY RANGE(id) (
PARTITION p0 VALUES LESS THAN (5),
PARTITION p1 VALUES LESS THAN (10),
PARTITION p2 VALUES LESS THAN MAXVALUE
);
INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8),
(9,9), (10,10), (11,11);
SET @old_tx_isolation := @@session.tx_isolation;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
SET autocommit = 0;
UPDATE t1 SET DATA = data*2 WHERE id = 3;
SHOW ENGINE InnoDB STATUS;
Type Name Status
InnoDB 2 lock struct(s) 1 row lock(s)
UPDATE t1 SET data = data*2 WHERE data = 2;
SHOW ENGINE InnoDB STATUS;
Type Name Status
InnoDB 6 lock struct(s) 2 row lock(s)
SET @@session.tx_isolation = @old_tx_isolation;
DROP TABLE t1;
# Bug#37721, test of ORDER BY on PK and WHERE on INDEX
CREATE TABLE t1 (
a INT,
......
......@@ -100,19 +100,19 @@ drop table t1;
show variables like "wait_timeout%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
def VARIABLES VARIABLE_VALUE Value 253 20480 5 Y 0 0 8
def VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
Variable_name Value
wait_timeout 28800
show variables like "WAIT_timeout%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
def VARIABLES VARIABLE_VALUE Value 253 20480 5 Y 0 0 8
def VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
Variable_name Value
wait_timeout 28800
show variables like "this_doesn't_exists%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 1 0 8
def VARIABLES VARIABLE_VALUE Value 253 20480 0 Y 0 0 8
def VARIABLES VARIABLE_VALUE Value 253 1024 0 Y 0 0 8
Variable_name Value
show table status from test like "this_doesn't_exists%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
......@@ -130,7 +130,7 @@ def TABLES AUTO_INCREMENT Auto_increment 8 21 0 Y 32800 0 63
def TABLES CREATE_TIME Create_time 12 19 0 Y 128 0 63
def TABLES UPDATE_TIME Update_time 12 19 0 Y 128 0 63
def TABLES CHECK_TIME Check_time 12 19 0 Y 128 0 63
def TABLES TABLE_COLLATION Collation 253 64 0 Y 0 0 8
def TABLES TABLE_COLLATION Collation 253 32 0 Y 0 0 8
def TABLES CHECKSUM Checksum 8 21 0 Y 32800 0 63
def TABLES CREATE_OPTIONS Create_options 253 255 0 Y 0 0 8
def TABLES TABLE_COMMENT Comment 253 80 0 N 1 0 8
......@@ -858,17 +858,17 @@ set names utf8;
----------------------------------------------------------------
SHOW CHARACTER SET LIKE 'utf8';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def CHARACTER_SETS CHARACTER_SET_NAME Charset 253 192 4 N 1 0 33
def CHARACTER_SETS CHARACTER_SET_NAME Charset 253 96 4 N 1 0 33
def CHARACTER_SETS DESCRIPTION Description 253 180 13 N 1 0 33
def CHARACTER_SETS DEFAULT_COLLATE_NAME Default collation 253 192 15 N 1 0 33
def CHARACTER_SETS DEFAULT_COLLATE_NAME Default collation 253 96 15 N 1 0 33
def CHARACTER_SETS MAXLEN Maxlen 8 3 1 N 32769 0 63
Charset Description Default collation Maxlen
utf8 UTF-8 Unicode utf8_general_ci 3
----------------------------------------------------------------
SHOW COLLATION LIKE 'latin1_bin';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def COLLATIONS COLLATION_NAME Collation 253 192 10 N 1 0 33
def COLLATIONS CHARACTER_SET_NAME Charset 253 192 6 N 1 0 33
def COLLATIONS COLLATION_NAME Collation 253 96 10 N 1 0 33
def COLLATIONS CHARACTER_SET_NAME Charset 253 96 6 N 1 0 33
def COLLATIONS ID Id 8 11 2 N 32769 0 63
def COLLATIONS IS_DEFAULT Default 253 9 0 N 1 0 33
def COLLATIONS IS_COMPILED Compiled 253 9 3 N 1 0 33
......@@ -935,7 +935,7 @@ def TABLES TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
def TABLES TABLE_TYPE TABLE_TYPE 253 192 10 N 1 0 33
def TABLES ENGINE ENGINE 253 192 6 Y 0 0 33
def TABLES ROW_FORMAT ROW_FORMAT 253 30 5 Y 0 0 33
def TABLES TABLE_COLLATION TABLE_COLLATION 253 192 17 Y 0 0 33
def TABLES TABLE_COLLATION TABLE_COLLATION 253 96 17 Y 0 0 33
def TABLES CREATE_OPTIONS CREATE_OPTIONS 253 765 0 Y 0 0 33
def TABLES TABLE_COMMENT TABLE_COMMENT 253 240 0 N 1 0 33
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_COLLATION CREATE_OPTIONS TABLE_COMMENT
......@@ -966,8 +966,8 @@ def COLUMNS COLUMN_NAME COLUMN_NAME 253 192 1 N 1 0 33
def COLUMNS COLUMN_DEFAULT COLUMN_DEFAULT 252 589815 0 Y 16 0 33
def COLUMNS IS_NULLABLE IS_NULLABLE 253 9 2 N 1 0 33
def COLUMNS DATA_TYPE DATA_TYPE 253 192 3 N 1 0 33
def COLUMNS CHARACTER_SET_NAME CHARACTER_SET_NAME 253 192 0 Y 0 0 33
def COLUMNS COLLATION_NAME COLLATION_NAME 253 192 0 Y 0 0 33
def COLUMNS CHARACTER_SET_NAME CHARACTER_SET_NAME 253 96 0 Y 0 0 33
def COLUMNS COLLATION_NAME COLLATION_NAME 253 96 0 Y 0 0 33
def COLUMNS COLUMN_TYPE COLUMN_TYPE 252 589815 7 N 17 0 33
def COLUMNS COLUMN_KEY COLUMN_KEY 253 9 3 N 1 0 33
def COLUMNS EXTRA EXTRA 253 81 0 N 1 0 33
......@@ -1125,7 +1125,7 @@ def ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33
def ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33
def ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
def ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
def ROUTINES SQL_MODE SQL_MODE 252 589815 0 N 17 0 33
def ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
def ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 253 192 0 N 1 0 33
def ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER
......@@ -1180,7 +1180,7 @@ def ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33
def ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33
def ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
def ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
def ROUTINES SQL_MODE SQL_MODE 252 589815 0 N 17 0 33
def ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
def ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 253 192 0 N 1 0 33
def ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER
......
......@@ -1534,6 +1534,21 @@ select (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 *
(1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 *
1.01500000 * 1.01500000 * 0.99500000)
0.812988073953673124592306939480
create table t1 as select 5.05 / 0.014;
Warnings:
Note 1265 Data truncated for column '5.05 / 0.014' at row 1
show warnings;
Level Code Message
Note 1265 Data truncated for column '5.05 / 0.014' at row 1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`5.05 / 0.014` decimal(10,6) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t1;
5.05 / 0.014
360.714286
DROP TABLE t1;
End of 5.0 tests
select cast(143.481 as decimal(4,1));
cast(143.481 as decimal(4,1))
......
......@@ -346,6 +346,7 @@ WHERE table_name = 't1_my_tablex';
# Enforce a time difference bigger than the smallest unit (1 second).
--real_sleep 1.1
INSERT INTO db_datadict.t1_my_tablex SET f1 = 3;
FLUSH TABLES;
SELECT UPDATE_TIME > @UPDATE_TIME
AS "Is current UPDATE_TIME bigger than before last INSERT?"
FROM information_schema.tables
......
......@@ -28,22 +28,22 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.CHARACTER_SETS;
Field Type Null Key Default Extra
CHARACTER_SET_NAME varchar(64) NO
DEFAULT_COLLATE_NAME varchar(64) NO
CHARACTER_SET_NAME varchar(32) NO
DEFAULT_COLLATE_NAME varchar(32) NO
DESCRIPTION varchar(60) NO
MAXLEN bigint(3) NO 0
SHOW CREATE TABLE information_schema.CHARACTER_SETS;
Table Create Table
CHARACTER_SETS CREATE TEMPORARY TABLE `CHARACTER_SETS` (
`CHARACTER_SET_NAME` varchar(64) NOT NULL DEFAULT '',
`DEFAULT_COLLATE_NAME` varchar(64) NOT NULL DEFAULT '',
`CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '',
`DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '',
`DESCRIPTION` varchar(60) NOT NULL DEFAULT '',
`MAXLEN` bigint(3) NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.CHARACTER_SETS;
Field Type Null Key Default Extra
CHARACTER_SET_NAME varchar(64) NO
DEFAULT_COLLATE_NAME varchar(64) NO
CHARACTER_SET_NAME varchar(32) NO
DEFAULT_COLLATE_NAME varchar(32) NO
DESCRIPTION varchar(60) NO
MAXLEN bigint(3) NO 0
# Testcases 3.2.2.2 and 3.2.2.3 are checked in suite/funcs_1/t/charset_collation*.test
......
......@@ -28,18 +28,18 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.COLLATION_CHARACTER_SET_APPLICABILITY;
Field Type Null Key Default Extra
COLLATION_NAME varchar(64) NO
CHARACTER_SET_NAME varchar(64) NO
COLLATION_NAME varchar(32) NO
CHARACTER_SET_NAME varchar(32) NO
SHOW CREATE TABLE information_schema.COLLATION_CHARACTER_SET_APPLICABILITY;
Table Create Table
COLLATION_CHARACTER_SET_APPLICABILITY CREATE TEMPORARY TABLE `COLLATION_CHARACTER_SET_APPLICABILITY` (
`COLLATION_NAME` varchar(64) NOT NULL DEFAULT '',
`CHARACTER_SET_NAME` varchar(64) NOT NULL DEFAULT ''
`COLLATION_NAME` varchar(32) NOT NULL DEFAULT '',
`CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.COLLATION_CHARACTER_SET_APPLICABILITY;
Field Type Null Key Default Extra
COLLATION_NAME varchar(64) NO
CHARACTER_SET_NAME varchar(64) NO
COLLATION_NAME varchar(32) NO
CHARACTER_SET_NAME varchar(32) NO
# Testcases 3.2.4.2 and 3.2.4.3 are checked in suite/funcs_1/t/charset_collation*.test
########################################################################
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
......
......@@ -28,8 +28,8 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.COLLATIONS;
Field Type Null Key Default Extra
COLLATION_NAME varchar(64) NO
CHARACTER_SET_NAME varchar(64) NO
COLLATION_NAME varchar(32) NO
CHARACTER_SET_NAME varchar(32) NO
ID bigint(11) NO 0
IS_DEFAULT varchar(3) NO
IS_COMPILED varchar(3) NO
......@@ -37,8 +37,8 @@ SORTLEN bigint(3) NO 0
SHOW CREATE TABLE information_schema.COLLATIONS;
Table Create Table
COLLATIONS CREATE TEMPORARY TABLE `COLLATIONS` (
`COLLATION_NAME` varchar(64) NOT NULL DEFAULT '',
`CHARACTER_SET_NAME` varchar(64) NOT NULL DEFAULT '',
`COLLATION_NAME` varchar(32) NOT NULL DEFAULT '',
`CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '',
`ID` bigint(11) NOT NULL DEFAULT '0',
`IS_DEFAULT` varchar(3) NOT NULL DEFAULT '',
`IS_COMPILED` varchar(3) NOT NULL DEFAULT '',
......@@ -46,8 +46,8 @@ COLLATIONS CREATE TEMPORARY TABLE `COLLATIONS` (
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.COLLATIONS;
Field Type Null Key Default Extra
COLLATION_NAME varchar(64) NO
CHARACTER_SET_NAME varchar(64) NO
COLLATION_NAME varchar(32) NO
CHARACTER_SET_NAME varchar(32) NO
ID bigint(11) NO 0
IS_DEFAULT varchar(3) NO
IS_COMPILED varchar(3) NO
......
......@@ -40,8 +40,8 @@ CHARACTER_MAXIMUM_LENGTH bigint(21) unsigned YES NULL
CHARACTER_OCTET_LENGTH bigint(21) unsigned YES NULL
NUMERIC_PRECISION bigint(21) unsigned YES NULL
NUMERIC_SCALE bigint(21) unsigned YES NULL
CHARACTER_SET_NAME varchar(64) YES NULL
COLLATION_NAME varchar(64) YES NULL
CHARACTER_SET_NAME varchar(32) YES NULL
COLLATION_NAME varchar(32) YES NULL
COLUMN_TYPE longtext NO NULL
COLUMN_KEY varchar(3) NO
EXTRA varchar(27) NO
......@@ -62,8 +62,8 @@ COLUMNS CREATE TEMPORARY TABLE `COLUMNS` (
`CHARACTER_OCTET_LENGTH` bigint(21) unsigned DEFAULT NULL,
`NUMERIC_PRECISION` bigint(21) unsigned DEFAULT NULL,
`NUMERIC_SCALE` bigint(21) unsigned DEFAULT NULL,
`CHARACTER_SET_NAME` varchar(64) DEFAULT NULL,
`COLLATION_NAME` varchar(64) DEFAULT NULL,
`CHARACTER_SET_NAME` varchar(32) DEFAULT NULL,
`COLLATION_NAME` varchar(32) DEFAULT NULL,
`COLUMN_TYPE` longtext NOT NULL,
`COLUMN_KEY` varchar(3) NOT NULL DEFAULT '',
`EXTRA` varchar(27) NOT NULL DEFAULT '',
......@@ -84,8 +84,8 @@ CHARACTER_MAXIMUM_LENGTH bigint(21) unsigned YES NULL
CHARACTER_OCTET_LENGTH bigint(21) unsigned YES NULL
NUMERIC_PRECISION bigint(21) unsigned YES NULL
NUMERIC_SCALE bigint(21) unsigned YES NULL
CHARACTER_SET_NAME varchar(64) YES NULL
COLLATION_NAME varchar(64) YES NULL
CHARACTER_SET_NAME varchar(32) YES NULL
COLLATION_NAME varchar(32) YES NULL
COLUMN_TYPE longtext NO NULL
COLUMN_KEY varchar(3) NO
EXTRA varchar(27) NO
......
......@@ -45,7 +45,7 @@ SQL_PATH varchar(64) YES NULL
SECURITY_TYPE varchar(7) NO
CREATED datetime NO 0000-00-00 00:00:00
LAST_ALTERED datetime NO 0000-00-00 00:00:00
SQL_MODE longtext NO NULL
SQL_MODE varchar(8192) NO
ROUTINE_COMMENT varchar(64) NO
DEFINER varchar(77) NO
CHARACTER_SET_CLIENT varchar(32) NO
......@@ -71,7 +71,7 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
`SECURITY_TYPE` varchar(7) NOT NULL DEFAULT '',
`CREATED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`SQL_MODE` longtext NOT NULL,
`SQL_MODE` varchar(8192) NOT NULL DEFAULT '',
`ROUTINE_COMMENT` varchar(64) NOT NULL DEFAULT '',
`DEFINER` varchar(77) NOT NULL DEFAULT '',
`CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
......@@ -97,7 +97,7 @@ SQL_PATH varchar(64) YES NULL
SECURITY_TYPE varchar(7) NO
CREATED datetime NO 0000-00-00 00:00:00
LAST_ALTERED datetime NO 0000-00-00 00:00:00
SQL_MODE longtext NO NULL
SQL_MODE varchar(8192) NO
ROUTINE_COMMENT varchar(64) NO
DEFINER varchar(77) NO
CHARACTER_SET_CLIENT varchar(32) NO
......
......@@ -30,24 +30,24 @@ DESCRIBE information_schema.SCHEMATA;
Field Type Null Key Default Extra
CATALOG_NAME varchar(512) YES NULL
SCHEMA_NAME varchar(64) NO
DEFAULT_CHARACTER_SET_NAME varchar(64) NO
DEFAULT_COLLATION_NAME varchar(64) NO
DEFAULT_CHARACTER_SET_NAME varchar(32) NO
DEFAULT_COLLATION_NAME varchar(32) NO
SQL_PATH varchar(512) YES NULL
SHOW CREATE TABLE information_schema.SCHEMATA;
Table Create Table
SCHEMATA CREATE TEMPORARY TABLE `SCHEMATA` (
`CATALOG_NAME` varchar(512) DEFAULT NULL,
`SCHEMA_NAME` varchar(64) NOT NULL DEFAULT '',
`DEFAULT_CHARACTER_SET_NAME` varchar(64) NOT NULL DEFAULT '',
`DEFAULT_COLLATION_NAME` varchar(64) NOT NULL DEFAULT '',
`DEFAULT_CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '',
`DEFAULT_COLLATION_NAME` varchar(32) NOT NULL DEFAULT '',
`SQL_PATH` varchar(512) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.SCHEMATA;
Field Type Null Key Default Extra
CATALOG_NAME varchar(512) YES NULL
SCHEMA_NAME varchar(64) NO
DEFAULT_CHARACTER_SET_NAME varchar(64) NO
DEFAULT_COLLATION_NAME varchar(64) NO
DEFAULT_CHARACTER_SET_NAME varchar(32) NO
DEFAULT_COLLATION_NAME varchar(32) NO
SQL_PATH varchar(512) YES NULL
SELECT catalog_name, schema_name, sql_path
FROM information_schema.schemata
......
......@@ -45,7 +45,7 @@ AUTO_INCREMENT bigint(21) unsigned YES NULL
CREATE_TIME datetime YES NULL
UPDATE_TIME datetime YES NULL
CHECK_TIME datetime YES NULL
TABLE_COLLATION varchar(64) YES NULL
TABLE_COLLATION varchar(32) YES NULL
CHECKSUM bigint(21) unsigned YES NULL
CREATE_OPTIONS varchar(255) YES NULL
TABLE_COMMENT varchar(80) NO
......@@ -69,7 +69,7 @@ TABLES CREATE TEMPORARY TABLE `TABLES` (
`CREATE_TIME` datetime DEFAULT NULL,
`UPDATE_TIME` datetime DEFAULT NULL,
`CHECK_TIME` datetime DEFAULT NULL,
`TABLE_COLLATION` varchar(64) DEFAULT NULL,
`TABLE_COLLATION` varchar(32) DEFAULT NULL,
`CHECKSUM` bigint(21) unsigned DEFAULT NULL,
`CREATE_OPTIONS` varchar(255) DEFAULT NULL,
`TABLE_COMMENT` varchar(80) NOT NULL DEFAULT ''
......@@ -93,7 +93,7 @@ AUTO_INCREMENT bigint(21) unsigned YES NULL
CREATE_TIME datetime YES NULL
UPDATE_TIME datetime YES NULL
CHECK_TIME datetime YES NULL
TABLE_COLLATION varchar(64) YES NULL
TABLE_COLLATION varchar(32) YES NULL
CHECKSUM bigint(21) unsigned YES NULL
CREATE_OPTIONS varchar(255) YES NULL
TABLE_COMMENT varchar(80) NO
......@@ -310,6 +310,7 @@ SELECT UPDATE_TIME, checksum INTO @UPDATE_TIME, @checksum
FROM information_schema.tables
WHERE table_name = 't1_my_tablex';
INSERT INTO db_datadict.t1_my_tablex SET f1 = 3;
FLUSH TABLES;
SELECT UPDATE_TIME > @UPDATE_TIME
AS "Is current UPDATE_TIME bigger than before last INSERT?"
FROM information_schema.tables
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#### suite/funcs_1/t/ndb_triggers.test
# ndb tables should be used
#
# 1. Check if ndb is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
--source suite/funcs_1/triggers/triggers_0102.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
# NDB tables should be used
#
# 1. Check if NDB is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
--source suite/funcs_1/triggers/triggers_03.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
# ndb tables should be used
#
# 1. Check if ndb is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
--source suite/funcs_1/triggers/triggers_0407.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
# ndb tables should be used
#
# 1. Check if ndb is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
--source suite/funcs_1/triggers/triggers_08.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
# ndb tables should be used
#
# 1. Check if ndb is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
--source suite/funcs_1/triggers/triggers_09.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
# ndb tables should be used
#
# 1. Check if ndb is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
--source suite/funcs_1/triggers/triggers_1011ext.inc
DROP TABLE test.tb3;
......@@ -1923,6 +1923,25 @@ DROP TABLE t1;
connection master;
DROP TABLE t1;
#
# Bug #34774 key prefix on text field in federated tables can cause
# server to crash!
#
connection slave;
CREATE TABLE t1 (a TEXT, b TEXT, KEY(b(1)));
INSERT INTO t1 VALUES (NULL, NULL), (NULL, NULL), (NULL, NULL), (NULL, NULL);
connection master;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CREATE TABLE t1
(a TEXT, b TEXT, KEY(b(1))) ENGINE=FEDERATED
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
SELECT t1.a FROM t1, t1 as t2 WHERE t2.b NOT LIKE t1.b;
connection slave;
DROP TABLE t1;
connection master;
DROP TABLE t1;
connection default;
--echo End of 5.0 tests
......
source include/federated.inc;
# NOTE: Keep any include/ files that will kill / skip a test BEFORE any others
# having federated.inc before have_innodb.inc allows for an orphaned database
# that can cause other tests to fail.
# See Bug #40645 Test main.federated_innodb does not always clean up after itself
source include/have_innodb.inc;
source include/federated.inc;
#
# Bug#25513 Federated transaction failures
......
......@@ -1346,4 +1346,41 @@ explain select count(*) from information_schema.tables;
explain select count(*) from information_schema.columns;
explain select count(*) from information_schema.views;
#
# Bug#39955 SELECT on INFORMATION_SCHEMA.GLOBAL_VARIABLES takes too long
#
set global init_connect="drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;\
drop table if exists t1;drop table if exists t1;";
select * from information_schema.global_variables where variable_name='init_connect';
set global init_connect="";
#
# Bug #34517 SHOW GLOBAL STATUS does not work properly in embedded server.
#
create table t0 select * from information_schema.global_status where VARIABLE_NAME='COM_SELECT';
SELECT 1;
select a.VARIABLE_VALUE - b.VARIABLE_VALUE from t0 b, information_schema.global_status a
where a.VARIABLE_NAME = b.VARIABLE_NAME;
drop table t0;
--echo End of 5.1 tests.
......@@ -121,3 +121,13 @@ SHOW CREATE TABLE t1;
SELECT PARTITION_DESCRIPTION FROM information_schema.partitions WHERE
table_schema = "test" AND table_name = "t1";
drop table t1;
#
# Bug#38909 CREATE_OPTIONS in information_schema produces wrong results
#
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1 (f1 int key) partition by key(f1) partitions 2;
select create_options from information_schema.tables where table_schema="test";
drop table t1;
......@@ -71,6 +71,33 @@ drop table t_bug25347;
drop database d_bug25347;
use test;
#
# Bug#39541 CHECK TABLE on information_schema myisam tables produces error
#
create view v1 as select * from information_schema.routines;
check table v1, information_schema.routines;
drop view v1;
#
# Bug#37527: mysqlcheck fails to report entire database
# when frm file corruption
#
CREATE TABLE t1(a INT);
CREATE TABLE t2(a INT);
# backup then null t1.frm
--copy_file $MYSQLTEST_VARDIR/master-data/test/t1.frm $MYSQLTEST_VARDIR/master-data/test/t1.frm.bak
--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
--write_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
EOF
--exec $MYSQL_CHECK test
# restore t1.frm
--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
--copy_file $MYSQLTEST_VARDIR/master-data/test/t1.frm.bak $MYSQLTEST_VARDIR/master-data/test/t1.frm
--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm.bak
DROP TABLE t1, t2;
--echo End of 5.0 tests
#
......
--source include/have_partition.inc
--source include/have_innodb.inc
--disable_warnings
drop table if exists t1;
--enable_warnings
#
# Bug#40595: Non-matching rows not released with READ-COMMITTED on tables
# with partitions
CREATE TABLE t1 (id INT PRIMARY KEY, data INT) ENGINE = InnoDB
PARTITION BY RANGE(id) (
PARTITION p0 VALUES LESS THAN (5),
PARTITION p1 VALUES LESS THAN (10),
PARTITION p2 VALUES LESS THAN MAXVALUE
);
INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8),
(9,9), (10,10), (11,11);
SET @old_tx_isolation := @@session.tx_isolation;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
SET autocommit = 0;
UPDATE t1 SET DATA = data*2 WHERE id = 3;
# grouping/referencing in replace_regex is very slow on long strings,
# removing all before/after the interesting row before grouping/referencing
--replace_regex /.*---TRANSACTION [0-9]+ [0-9]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+ lock struct\(s\)), heap size [0-9]+, ([0-9]+ row lock\(s\)).*/\1 \2/
SHOW ENGINE InnoDB STATUS;
UPDATE t1 SET data = data*2 WHERE data = 2;
# grouping/referencing in replace_regex is very slow on long strings,
# removing all before/after the interesting row before grouping/referencing
--replace_regex /.*---TRANSACTION [0-9]+ [0-9]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+ lock struct\(s\)), heap size [0-9]+, ([0-9]+ row lock\(s\)).*/\1 \2/
SHOW ENGINE InnoDB STATUS;
SET @@session.tx_isolation = @old_tx_isolation;
DROP TABLE t1;
#
# Bug37721: ORDER BY when WHERE contains non-partitioned index column
# wrong order since it did not use pk as second compare
......
......@@ -1235,6 +1235,16 @@ DROP TABLE t1;
select (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 *
1.01500000 * 1.01500000 * 0.99500000);
#
# Bug #31616 div_precision_increment description looks wrong
#
create table t1 as select 5.05 / 0.014;
show warnings;
show create table t1;
select * from t1;
DROP TABLE t1;
--echo End of 5.0 tests
#
......
......@@ -320,8 +320,6 @@ static void my_win_init(void)
const char *targetKey = "Software\\MySQL" ;
DBUG_ENTER("my_win_init");
setlocale(LC_CTYPE, ""); /* To get right sortorder */
#if defined(_MSC_VER)
#if _MSC_VER < 1300
/*
......
......@@ -162,6 +162,7 @@ SUFFIXES = .sh
-e 's!@''CFLAGS''@!@CFLAGS@!'\
-e 's!@''CXXFLAGS''@!@CXXFLAGS@!'\
-e 's!@''LDFLAGS''@!@LDFLAGS@!'\
-e 's!@''LIBDL''@!@LIBDL@!'\
-e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \
-e 's!@''ZLIB_LIBS''@!@ZLIB_LIBS@!' \
-e 's!@''LIBS''@!@LIBS@!' \
......
......@@ -202,7 +202,7 @@ $flags->{libs} =
$flags->{libs_r} =
[@ldflags,@lib_r_opts,'@ZLIB_DEPS@','@LIBS@','@openssl_libs@'];
$flags->{embedded_libs} =
[@ldflags,@lib_e_opts,'@ZLIB_DEPS@','@LIBS@','@WRAPLIBS@','@innodb_system_libs@','@openssl_libs@'];
[@ldflags,@lib_e_opts,'@LIBDL@','@ZLIB_DEPS@','@LIBS@','@WRAPLIBS@','@innodb_system_libs@','@openssl_libs@'];
$flags->{include} = ["-I$pkgincludedir"];
$flags->{cflags} = [@{$flags->{include}},split(" ",'@CFLAGS@')];
......
......@@ -107,7 +107,7 @@ fi
libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@"
libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@ "
libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@ "
embedded_libs=" $ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@ @openssl_libs@ "
embedded_libs=" $ldflags -L$pkglibdir -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@ @openssl_libs@ "
if [ -r "$pkglibdir/libmygcc.a" ]; then
# When linking against the static library with a different version of GCC
......
......@@ -2813,8 +2813,42 @@ uint ha_partition::lock_count() const
void ha_partition::unlock_row()
{
DBUG_ENTER("ha_partition::unlock_row");
m_file[m_last_part]->unlock_row();
return;
DBUG_VOID_RETURN;
}
/**
Use semi consistent read if possible
SYNOPSIS
try_semi_consistent_read()
yes Turn on semi consistent read
RETURN VALUE
NONE
DESCRIPTION
See handler.h:
Tell the engine whether it should avoid unnecessary lock waits.
If yes, in an UPDATE or DELETE, if the row under the cursor was locked
by another transaction, the engine may try an optimistic read of
the last committed row value under the cursor.
Note: prune_partitions are already called before this call, so using
pruning is OK.
*/
void ha_partition::try_semi_consistent_read(bool yes)
{
handler **file;
DBUG_ENTER("ha_partition::try_semi_consistent_read");
for (file= m_file; *file; file++)
{
if (bitmap_is_set(&(m_part_info->used_partitions), (file - m_file)))
(*file)->try_semi_consistent_read(yes);
}
DBUG_VOID_RETURN;
}
......
......@@ -325,6 +325,10 @@ public:
Call to unlock rows not to be updated in transaction
*/
virtual void unlock_row();
/*
Call to hint about semi consistent read
*/
virtual void try_semi_consistent_read(bool);
/*
-------------------------------------------------------------------------
......
......@@ -1301,8 +1301,10 @@ my_decimal *Item_func_div::decimal_op(my_decimal *decimal_value)
void Item_func_div::result_precision()
{
uint arg_prec= args[0]->decimal_precision() + prec_increment;
uint precision=min(arg_prec, DECIMAL_MAX_PRECISION);
uint precision=min(args[0]->decimal_precision() +
args[1]->decimals + prec_increment,
DECIMAL_MAX_PRECISION);
/* Integer operations keep unsigned_flag if one of arguments is unsigned */
if (result_type() == INT_RESULT)
unsigned_flag= args[0]->unsigned_flag | args[1]->unsigned_flag;
......
......@@ -90,7 +90,6 @@ write_escaped_string(IO_CACHE *file, LEX_STRING *val_s)
@param file pointer to IO_CACHE structure for writing
@param base pointer to data structure
@param parameter pointer to parameter descriptor
@param old_version for returning back old version number value
@retval
FALSE OK
......@@ -100,8 +99,7 @@ write_escaped_string(IO_CACHE *file, LEX_STRING *val_s)
static my_bool
write_parameter(IO_CACHE *file, uchar* base, File_option *parameter,
ulonglong *old_version)
write_parameter(IO_CACHE *file, uchar* base, File_option *parameter)
{
char num_buf[20]; // buffer for numeric operations
// string for numeric operations
......@@ -129,15 +127,6 @@ write_parameter(IO_CACHE *file, uchar* base, File_option *parameter,
DBUG_RETURN(TRUE);
break;
}
case FILE_OPTIONS_REV:
{
ulonglong *val_i= (ulonglong *)(base + parameter->offset);
*old_version= (*val_i)++;
num.set(*val_i, &my_charset_bin);
if (my_b_append(file, (const uchar *)num.ptr(), num.length()))
DBUG_RETURN(TRUE);
break;
}
case FILE_OPTIONS_TIMESTAMP:
{
/* string have to be allocated already */
......@@ -207,7 +196,6 @@ write_parameter(IO_CACHE *file, uchar* base, File_option *parameter,
@param base base address for parameter reading (structure like
TABLE)
@param parameters parameters description
@param max_versions number of versions to save
@retval
FALSE OK
......@@ -219,13 +207,11 @@ write_parameter(IO_CACHE *file, uchar* base, File_option *parameter,
my_bool
sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name,
const LEX_STRING *type,
uchar* base, File_option *parameters,
uint max_versions)
uchar* base, File_option *parameters)
{
File handler;
IO_CACHE file;
char path[FN_REFLEN+1]; // +1 to put temporary file name for sure
ulonglong old_version= ULONGLONG_MAX;
int path_end;
File_option *param;
DBUG_ENTER("sql_create_definition_file");
......@@ -272,7 +258,7 @@ sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name,
if (my_b_append(&file, (const uchar *)param->name.str,
param->name.length) ||
my_b_append(&file, (const uchar *)STRING_WITH_LEN("=")) ||
write_parameter(&file, base, param, &old_version) ||
write_parameter(&file, base, param) ||
my_b_append(&file, (const uchar *)STRING_WITH_LEN("\n")))
goto err_w_cache;
}
......@@ -286,55 +272,6 @@ sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name,
}
path[path_end]='\0';
#ifdef FRM_ARCHIVE
// archive copies management: disabled unused feature (see bug #17823).
if (!access(path, F_OK))
{
if (old_version != ULONGLONG_MAX && max_versions != 0)
{
// save backup
char path_arc[FN_REFLEN];
// backup old version
char path_to[FN_REFLEN];
// check archive directory existence
fn_format(path_arc, "arc", dir->str, "", MY_UNPACK_FILENAME);
if (access(path_arc, F_OK))
{
if (my_mkdir(path_arc, 0777, MYF(MY_WME)))
{
DBUG_RETURN(TRUE);
}
}
my_snprintf(path_to, FN_REFLEN, "%s/%s-%04lu",
path_arc, file_name->str, (ulong) old_version);
if (my_rename(path, path_to, MYF(MY_WME)))
{
DBUG_RETURN(TRUE);
}
// remove very old version
if (old_version > max_versions)
{
my_snprintf(path_to, FN_REFLEN, "%s/%s-%04lu",
path_arc, file_name->str,
(ulong)(old_version - max_versions));
if (!access(path_arc, F_OK) && my_delete(path_to, MYF(MY_WME)))
{
DBUG_RETURN(TRUE);
}
}
}
else
{
if (my_delete(path, MYF(MY_WME))) // no backups
{
DBUG_RETURN(TRUE);
}
}
}
#endif//FRM_ARCHIVE
{
// rename temporary file
......@@ -361,8 +298,6 @@ err_w_file:
@param schema name of given schema
@param old_name original file name
@param new_name new file name
@param revision revision number
@param num_view_backups number of backups
@retval
0 OK
......@@ -371,8 +306,7 @@ err_w_file:
*/
my_bool rename_in_schema_file(THD *thd,
const char *schema, const char *old_name,
const char *new_name, ulonglong revision,
uint num_view_backups)
const char *new_name)
{
char old_path[FN_REFLEN], new_path[FN_REFLEN], arc_path[FN_REFLEN];
......@@ -387,28 +321,6 @@ my_bool rename_in_schema_file(THD *thd,
/* check if arc_dir exists: disabled unused feature (see bug #17823). */
build_table_filename(arc_path, sizeof(arc_path) - 1, schema, "arc", "", 0);
#ifdef FRM_ARCHIVE
if (revision > 0 && !access(arc_path, F_OK))
{
char old_name_buf[FN_REFLEN], new_name_buf[FN_REFLEN];
ulonglong limit= ((revision > num_view_backups) ?
revision - num_view_backups : 0);
VOID(tablename_to_filename(old_name, old_name_buf, sizeof(old_name_buf)));
VOID(tablename_to_filename(new_name, new_name_buf, sizeof(new_name_buf)));
for (; revision > limit ; revision--)
{
my_snprintf(old_path, FN_REFLEN, "%s/%s%s-%04lu",
arc_path, old_name_buf, reg_ext, (ulong) revision);
(void) unpack_filename(old_path, old_path);
my_snprintf(new_path, FN_REFLEN, "%s/%s%s-%04lu",
arc_path, new_name_buf, reg_ext, (ulong) revision);
(void) unpack_filename(new_path, new_path);
my_rename(old_path, new_path, MYF(0));
}
}
#else//FRM_ARCHIVE
{ // remove obsolete 'arc' directory and files if any
MY_DIR *new_dirp;
if ((new_dirp = my_dir(arc_path, MYF(MY_DONT_SORT))))
......@@ -417,7 +329,6 @@ my_bool rename_in_schema_file(THD *thd,
(void) mysql_rm_arc_files(thd, new_dirp, arc_path);
}
}
#endif//FRM_ARCHIVE
return 0;
}
......@@ -846,7 +757,6 @@ File_parser::parse(uchar* base, MEM_ROOT *mem_root,
break;
}
case FILE_OPTIONS_ULONGLONG:
case FILE_OPTIONS_REV:
if (!(eol= strchr(ptr, '\n')))
{
my_error(ER_FPARSER_ERROR_IN_PARAMETER, MYF(0),
......
......@@ -23,7 +23,6 @@ enum file_opt_type {
FILE_OPTIONS_STRING, /**< String (LEX_STRING) */
FILE_OPTIONS_ESTRING, /**< Escaped string (LEX_STRING) */
FILE_OPTIONS_ULONGLONG, /**< ulonglong parameter (ulonglong) */
FILE_OPTIONS_REV, /**< Revision version number (ulonglong) */
FILE_OPTIONS_TIMESTAMP, /**< timestamp (LEX_STRING have to be
allocated with length 20 (19+1) */
FILE_OPTIONS_STRLIST, /**< list of escaped strings
......@@ -81,11 +80,10 @@ File_parser *sql_parse_prepare(const LEX_STRING *file_name,
my_bool
sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name,
const LEX_STRING *type,
uchar* base, File_option *parameters, uint versions);
uchar* base, File_option *parameters);
my_bool rename_in_schema_file(THD *thd,
const char *schema, const char *old_name,
const char *new_name, ulonglong revision,
uint num_view_backups);
const char *new_name);
class File_parser: public Sql_alloc
{
......
......@@ -1099,7 +1099,6 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
/* .frm archive:
Those archives are obsolete, but following code should
exist to remove existent "arc" directories.
See #ifdef FRM_ARCHIVE directives for obsolete code.
*/
char newpath[FN_REFLEN];
MY_DIR *new_dirp;
......@@ -1268,7 +1267,6 @@ static my_bool rm_dir_w_symlink(const char *org_path, my_bool send_error)
NOTE
A support of "arc" directories is obsolete, however this
function should exist to remove existent "arc" directories.
See #ifdef FRM_ARCHIVE directives for obsolete code.
*/
long mysql_rm_arc_files(THD *thd, MY_DIR *dirp, const char *org_path)
{
......
This diff is collapsed.
......@@ -4293,6 +4293,12 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
goto send_result;
}
if (table->schema_table)
{
result_code= HA_ADMIN_NOT_IMPLEMENTED;
goto send_result;
}
if ((table->table->db_stat & HA_READ_ONLY) && open_for_modify)
{
/* purecov: begin inspected */
......
......@@ -682,7 +682,7 @@ bool Table_triggers_list::create_trigger(THD *thd, TABLE_LIST *tables,
trigname.trigger_table.length= tables->table_name_length;
if (sql_create_definition_file(NULL, &trigname_file, &trigname_file_type,
(uchar*)&trigname, trigname_file_parameters, 0))
(uchar*)&trigname, trigname_file_parameters))
return 1;
/*
......@@ -800,7 +800,7 @@ bool Table_triggers_list::create_trigger(THD *thd, TABLE_LIST *tables,
/* Create trigger definition file. */
if (!sql_create_definition_file(NULL, &file, &triggers_file_type,
(uchar*)this, triggers_file_parameters, 0))
(uchar*)this, triggers_file_parameters))
return 0;
err_with_cleanup:
......@@ -876,8 +876,7 @@ static bool save_trigger_file(Table_triggers_list *triggers, const char *db,
TRG_EXT, 0);
file.str= file_buff;
return sql_create_definition_file(NULL, &file, &triggers_file_type,
(uchar*)triggers, triggers_file_parameters,
0);
(uchar*)triggers, triggers_file_parameters);
}
......@@ -1806,8 +1805,7 @@ Table_triggers_list::change_table_name_in_trignames(const char *db_name,
trigname.trigger_table= *new_table_name;
if (sql_create_definition_file(NULL, &trigname_file, &trigname_file_type,
(uchar*)&trigname, trigname_file_parameters,
0))
(uchar*)&trigname, trigname_file_parameters))
return trigger;
}
......
......@@ -655,7 +655,7 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
}
VOID(pthread_mutex_unlock(&LOCK_open));
if (view->revision != 1)
if (mode != VIEW_CREATE_NEW)
query_cache_invalidate3(thd, view, 0);
start_waiting_global_read_lock(thd);
if (res)
......@@ -673,12 +673,8 @@ err:
}
/* index of revision number in following table */
static const int revision_number_position= 8;
/* number of required parameters for making view */
static const int required_view_parameters= 16;
/* number of backups */
static const int num_view_backups= 3;
static const int required_view_parameters= 14;
/*
table of VIEW .frm field descriptors
......@@ -711,9 +707,6 @@ static File_option view_parameters[]=
{{ C_STRING_WITH_LEN("with_check_option")},
my_offsetof(TABLE_LIST, with_check),
FILE_OPTIONS_ULONGLONG},
{{ C_STRING_WITH_LEN("revision")},
my_offsetof(TABLE_LIST, revision),
FILE_OPTIONS_REV},
{{ C_STRING_WITH_LEN("timestamp")},
my_offsetof(TABLE_LIST, timestamp),
FILE_OPTIONS_TIMESTAMP},
......@@ -921,18 +914,9 @@ loop_out:
}
/*
read revision number
TODO: read dependence list, too, to process cascade/restrict
TODO: special cascade/restrict procedure for alter?
*/
if (parser->parse((uchar*)view, thd->mem_root,
view_parameters + revision_number_position, 1,
&file_parser_dummy_hook))
{
error= thd->is_error() ? -1 : 0;
goto err;
}
}
else
{
......@@ -997,7 +981,7 @@ loop_out:
}
if (sql_create_definition_file(&dir, &file, view_file_type,
(uchar*)view, view_parameters, num_view_backups))
(uchar*)view, view_parameters))
{
error= thd->is_error() ? -1 : 1;
goto err;
......@@ -1963,8 +1947,7 @@ mysql_rename_view(THD *thd,
goto err;
/* rename view and it's backups */
if (rename_in_schema_file(thd, view->db, view->table_name, new_name,
view_def.revision - 1, num_view_backups))
if (rename_in_schema_file(thd, view->db, view->table_name, new_name))
goto err;
dir.str= dir_buff;
......@@ -1979,12 +1962,10 @@ mysql_rename_view(THD *thd,
file.length= pathstr.length - dir.length;
if (sql_create_definition_file(&dir, &file, view_file_type,
(uchar*)&view_def, view_parameters,
num_view_backups))
(uchar*)&view_def, view_parameters))
{
/* restore renamed view in case of error */
rename_in_schema_file(thd, view->db, new_name, view->table_name,
view_def.revision - 1, num_view_backups);
rename_in_schema_file(thd, view->db, new_name, view->table_name);
goto err;
}
} else
......
......@@ -1244,7 +1244,6 @@ struct TABLE_LIST
st_lex_user definer; /* definer of view */
ulonglong file_version; /* version of file's field set */
ulonglong updatable_view; /* VIEW can be updated */
ulonglong revision; /* revision control number */
/**
@brief The declared algorithm, if this is a view.
@details One of
......
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