Merge 10.1 into 10.1
This is joint work with Oleksandr Byelkin.
This commit is contained in:
commit
213ece2f2e
@ -241,8 +241,14 @@ ENDIF()
|
|||||||
|
|
||||||
MY_CHECK_AND_SET_COMPILER_FLAG(-ggdb3 DEBUG)
|
MY_CHECK_AND_SET_COMPILER_FLAG(-ggdb3 DEBUG)
|
||||||
|
|
||||||
OPTION(ENABLED_LOCAL_INFILE
|
SET(ENABLED_LOCAL_INFILE "AUTO" CACHE STRING "If we should should enable LOAD DATA LOCAL by default (OFF/ON/AUTO)")
|
||||||
"If we should should enable LOAD DATA LOCAL by default" ${IF_WIN})
|
IF (ENABLED_LOCAL_INFILE MATCHES "^(0|FALSE)$")
|
||||||
|
SET(ENABLED_LOCAL_INFILE OFF)
|
||||||
|
ELSEIF(ENABLED_LOCAL_INFILE MATCHES "^(1|TRUE)$")
|
||||||
|
SET(ENABLED_LOCAL_INFILE ON)
|
||||||
|
ELSEIF (NOT ENABLED_LOCAL_INFILE MATCHES "^(ON|OFF|AUTO)$")
|
||||||
|
MESSAGE(FATAL_ERROR "ENABLED_LOCAL_INFILE must be one of OFF, ON, AUTO")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
OPTION(WITH_FAST_MUTEXES "Compile with fast mutexes" OFF)
|
OPTION(WITH_FAST_MUTEXES "Compile with fast mutexes" OFF)
|
||||||
MARK_AS_ADVANCED(WITH_FAST_MUTEXES)
|
MARK_AS_ADVANCED(WITH_FAST_MUTEXES)
|
||||||
|
@ -6075,7 +6075,6 @@ void do_connect(struct st_command *command)
|
|||||||
#endif
|
#endif
|
||||||
if (opt_compress || con_compress)
|
if (opt_compress || con_compress)
|
||||||
mysql_options(con_slot->mysql, MYSQL_OPT_COMPRESS, NullS);
|
mysql_options(con_slot->mysql, MYSQL_OPT_COMPRESS, NullS);
|
||||||
mysql_options(con_slot->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
|
||||||
mysql_options(con_slot->mysql, MYSQL_SET_CHARSET_NAME,
|
mysql_options(con_slot->mysql, MYSQL_SET_CHARSET_NAME,
|
||||||
charset_info->csname);
|
charset_info->csname);
|
||||||
if (opt_charsets_dir)
|
if (opt_charsets_dir)
|
||||||
@ -6175,6 +6174,11 @@ void do_connect(struct st_command *command)
|
|||||||
if (con_slot == next_con)
|
if (con_slot == next_con)
|
||||||
next_con++; /* if we used the next_con slot, advance the pointer */
|
next_con++; /* if we used the next_con slot, advance the pointer */
|
||||||
}
|
}
|
||||||
|
else // Failed to connect. Free the memory.
|
||||||
|
{
|
||||||
|
mysql_close(con_slot->mysql);
|
||||||
|
con_slot->mysql= NULL;
|
||||||
|
}
|
||||||
|
|
||||||
dynstr_free(&ds_connection_name);
|
dynstr_free(&ds_connection_name);
|
||||||
dynstr_free(&ds_host);
|
dynstr_free(&ds_host);
|
||||||
@ -9175,7 +9179,6 @@ int main(int argc, char **argv)
|
|||||||
(void *) &opt_connect_timeout);
|
(void *) &opt_connect_timeout);
|
||||||
if (opt_compress)
|
if (opt_compress)
|
||||||
mysql_options(con->mysql,MYSQL_OPT_COMPRESS,NullS);
|
mysql_options(con->mysql,MYSQL_OPT_COMPRESS,NullS);
|
||||||
mysql_options(con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
|
||||||
mysql_options(con->mysql, MYSQL_SET_CHARSET_NAME,
|
mysql_options(con->mysql, MYSQL_SET_CHARSET_NAME,
|
||||||
charset_info->csname);
|
charset_info->csname);
|
||||||
if (opt_charsets_dir)
|
if (opt_charsets_dir)
|
||||||
|
@ -83,7 +83,6 @@ IF(FEATURE_SET)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
OPTION(ENABLED_LOCAL_INFILE "" ON)
|
|
||||||
SET(WITH_INNODB_SNAPPY OFF CACHE STRING "")
|
SET(WITH_INNODB_SNAPPY OFF CACHE STRING "")
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
SET(WITH_LIBARCHIVE STATIC CACHE STRING "")
|
SET(WITH_LIBARCHIVE STATIC CACHE STRING "")
|
||||||
|
@ -177,12 +177,20 @@ MACRO (MYSQL_CHECK_SSL)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
INCLUDE(CheckSymbolExists)
|
INCLUDE(CheckSymbolExists)
|
||||||
|
INCLUDE(CheckCSourceCompiles)
|
||||||
SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
|
SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
|
||||||
CHECK_SYMBOL_EXISTS(SHA512_DIGEST_LENGTH "openssl/sha.h"
|
CHECK_SYMBOL_EXISTS(SHA512_DIGEST_LENGTH "openssl/sha.h"
|
||||||
HAVE_SHA512_DIGEST_LENGTH)
|
HAVE_SHA512_DIGEST_LENGTH)
|
||||||
|
CHECK_C_SOURCE_COMPILES("
|
||||||
|
#include <openssl/dh.h>
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
DH dh;
|
||||||
|
return sizeof(dh.version);
|
||||||
|
}" OLD_OPENSSL_API)
|
||||||
SET(CMAKE_REQUIRED_INCLUDES)
|
SET(CMAKE_REQUIRED_INCLUDES)
|
||||||
IF(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES AND
|
IF(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES AND
|
||||||
OPENSSL_MAJOR_VERSION STRLESS "101" AND
|
OLD_OPENSSL_API AND
|
||||||
CRYPTO_LIBRARY AND HAVE_SHA512_DIGEST_LENGTH)
|
CRYPTO_LIBRARY AND HAVE_SHA512_DIGEST_LENGTH)
|
||||||
|
|
||||||
SET(SSL_SOURCES "")
|
SET(SSL_SOURCES "")
|
||||||
|
@ -544,7 +544,11 @@
|
|||||||
/*
|
/*
|
||||||
MySQL features
|
MySQL features
|
||||||
*/
|
*/
|
||||||
#cmakedefine ENABLED_LOCAL_INFILE 1
|
#define LOCAL_INFILE_MODE_OFF 0
|
||||||
|
#define LOCAL_INFILE_MODE_ON 1
|
||||||
|
#define LOCAL_INFILE_MODE_AUTO 2
|
||||||
|
#define ENABLED_LOCAL_INFILE LOCAL_INFILE_MODE_@ENABLED_LOCAL_INFILE@
|
||||||
|
|
||||||
#cmakedefine ENABLED_PROFILING 1
|
#cmakedefine ENABLED_PROFILING 1
|
||||||
#cmakedefine EXTRA_DEBUG 1
|
#cmakedefine EXTRA_DEBUG 1
|
||||||
#cmakedefine CYBOZU 1
|
#cmakedefine CYBOZU 1
|
||||||
|
@ -42,7 +42,7 @@ https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning */
|
|||||||
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
|
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
|
||||||
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
|
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
|
||||||
#else
|
#else
|
||||||
# define MEM_UNDEFINED(a,len) ((void) 0)
|
# define MEM_UNDEFINED(a,len) ((void) (a), (void) (len))
|
||||||
# define MEM_NOACCESS(a,len) ((void) 0)
|
# define MEM_NOACCESS(a,len) ((void) 0)
|
||||||
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
|
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
|
||||||
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
|
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
|
||||||
@ -51,7 +51,7 @@ https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning */
|
|||||||
#ifndef DBUG_OFF
|
#ifndef DBUG_OFF
|
||||||
#define TRASH_FILL(A,B,C) do { const size_t trash_tmp= (B); MEM_UNDEFINED(A, trash_tmp); memset(A, C, trash_tmp); } while (0)
|
#define TRASH_FILL(A,B,C) do { const size_t trash_tmp= (B); MEM_UNDEFINED(A, trash_tmp); memset(A, C, trash_tmp); } while (0)
|
||||||
#else
|
#else
|
||||||
#define TRASH_FILL(A,B,C) do { const size_t trash_tmp __attribute__((unused))= (B); MEM_UNDEFINED(A,trash_tmp); } while (0)
|
#define TRASH_FILL(A,B,C) do { MEM_UNDEFINED((A), (B)); } while (0)
|
||||||
#endif
|
#endif
|
||||||
#define TRASH_ALLOC(A,B) do { TRASH_FILL(A,B,0xA5); MEM_UNDEFINED(A,B); } while(0)
|
#define TRASH_ALLOC(A,B) do { TRASH_FILL(A,B,0xA5); MEM_UNDEFINED(A,B); } while(0)
|
||||||
#define TRASH_FREE(A,B) do { TRASH_FILL(A,B,0x8F); MEM_NOACCESS(A,B); } while(0)
|
#define TRASH_FREE(A,B) do { TRASH_FILL(A,B,0x8F); MEM_NOACCESS(A,B); } while(0)
|
||||||
|
@ -287,7 +287,7 @@ typedef struct st_mysql
|
|||||||
|
|
||||||
/* session-wide random string */
|
/* session-wide random string */
|
||||||
char scramble[SCRAMBLE_LENGTH+1];
|
char scramble[SCRAMBLE_LENGTH+1];
|
||||||
my_bool unused1;
|
my_bool auto_local_infile;
|
||||||
void *unused2, *unused3, *unused4, *unused5;
|
void *unused2, *unused3, *unused4, *unused5;
|
||||||
|
|
||||||
LIST *stmts; /* list of all statements */
|
LIST *stmts; /* list of all statements */
|
||||||
|
@ -350,7 +350,7 @@ typedef struct st_mysql
|
|||||||
my_bool free_me;
|
my_bool free_me;
|
||||||
my_bool reconnect;
|
my_bool reconnect;
|
||||||
char scramble[20 +1];
|
char scramble[20 +1];
|
||||||
my_bool unused1;
|
my_bool auto_local_infile;
|
||||||
void *unused2, *unused3, *unused4, *unused5;
|
void *unused2, *unused3, *unused4, *unused5;
|
||||||
LIST *stmts;
|
LIST *stmts;
|
||||||
const struct st_mysql_methods *methods;
|
const struct st_mysql_methods *methods;
|
||||||
|
@ -21,3 +21,4 @@ innodb-wl5522-debug-zip : broken upstream
|
|||||||
innodb_bug12902967 : broken upstream
|
innodb_bug12902967 : broken upstream
|
||||||
file_contents : MDEV-6526 these files are not installed anymore
|
file_contents : MDEV-6526 these files are not installed anymore
|
||||||
max_statement_time : cannot possibly work, depends on timing
|
max_statement_time : cannot possibly work, depends on timing
|
||||||
|
partition_open_files_limit : open_files_limit check broken by MDEV-18360
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,124 +0,0 @@
|
|||||||
#
|
|
||||||
# Specific tests for case sensitive file systems
|
|
||||||
# i.e. lower_case_filesystem=OFF
|
|
||||||
#
|
|
||||||
-- source include/have_case_sensitive_file_system.inc
|
|
||||||
-- source include/not_embedded.inc
|
|
||||||
|
|
||||||
connect (master,localhost,root,,);
|
|
||||||
connection master;
|
|
||||||
create database d1;
|
|
||||||
grant all on d1.* to 'sample'@'localhost' identified by 'password';
|
|
||||||
flush privileges;
|
|
||||||
|
|
||||||
connect (sample,localhost,sample,password,d1);
|
|
||||||
connection sample;
|
|
||||||
select database();
|
|
||||||
--error ER_DBACCESS_DENIED_ERROR
|
|
||||||
create database d2;
|
|
||||||
--error ER_DBACCESS_DENIED_ERROR
|
|
||||||
create database D1;
|
|
||||||
disconnect sample;
|
|
||||||
--source include/wait_until_disconnected.inc
|
|
||||||
|
|
||||||
connection master;
|
|
||||||
drop user 'sample'@'localhost';
|
|
||||||
drop database if exists d1;
|
|
||||||
disconnect master;
|
|
||||||
--source include/wait_until_disconnected.inc
|
|
||||||
connection default;
|
|
||||||
|
|
||||||
# End of 4.1 tests
|
|
||||||
|
|
||||||
#
|
|
||||||
# Bug#41049 does syntax "grant" case insensitive?
|
|
||||||
#
|
|
||||||
CREATE DATABASE d1;
|
|
||||||
USE d1;
|
|
||||||
CREATE TABLE T1(f1 INT);
|
|
||||||
CREATE TABLE t1(f1 INT);
|
|
||||||
GRANT SELECT ON T1 to user_1@localhost;
|
|
||||||
|
|
||||||
connect (con1,localhost,user_1,,d1);
|
|
||||||
--error ER_TABLEACCESS_DENIED_ERROR
|
|
||||||
select * from t1;
|
|
||||||
select * from T1;
|
|
||||||
connection default;
|
|
||||||
GRANT SELECT ON t1 to user_1@localhost;
|
|
||||||
connection con1;
|
|
||||||
select * from information_schema.table_privileges;
|
|
||||||
connection default;
|
|
||||||
disconnect con1;
|
|
||||||
|
|
||||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user_1@localhost;
|
|
||||||
DROP USER user_1@localhost;
|
|
||||||
DROP DATABASE d1;
|
|
||||||
USE test;
|
|
||||||
|
|
||||||
CREATE DATABASE db1;
|
|
||||||
USE db1;
|
|
||||||
CREATE PROCEDURE p1() BEGIN END;
|
|
||||||
CREATE FUNCTION f1(i INT) RETURNS INT RETURN i+1;
|
|
||||||
|
|
||||||
GRANT USAGE ON db1.* to user_1@localhost;
|
|
||||||
GRANT EXECUTE ON PROCEDURE db1.P1 to user_1@localhost;
|
|
||||||
GRANT EXECUTE ON FUNCTION db1.f1 to user_1@localhost;
|
|
||||||
GRANT UPDATE ON db1.* to USER_1@localhost;
|
|
||||||
|
|
||||||
connect (con1,localhost,user_1,,db1);
|
|
||||||
call p1();
|
|
||||||
call P1();
|
|
||||||
select f1(1);
|
|
||||||
connect (con2,localhost,USER_1,,db1);
|
|
||||||
--error ER_PROCACCESS_DENIED_ERROR
|
|
||||||
call p1();
|
|
||||||
--error ER_PROCACCESS_DENIED_ERROR
|
|
||||||
call P1();
|
|
||||||
--error ER_PROCACCESS_DENIED_ERROR
|
|
||||||
select f1(1);
|
|
||||||
|
|
||||||
connection default;
|
|
||||||
disconnect con1;
|
|
||||||
disconnect con2;
|
|
||||||
|
|
||||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user_1@localhost;
|
|
||||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM USER_1@localhost;
|
|
||||||
DROP FUNCTION f1;
|
|
||||||
DROP PROCEDURE p1;
|
|
||||||
DROP USER user_1@localhost;
|
|
||||||
DROP USER USER_1@localhost;
|
|
||||||
DROP DATABASE db1;
|
|
||||||
use test;
|
|
||||||
|
|
||||||
# End of 5.0 tests
|
|
||||||
|
|
||||||
|
|
||||||
--echo #
|
|
||||||
--echo # Extra test coverage for Bug#56595 RENAME TABLE causes assert on OS X
|
|
||||||
--echo #
|
|
||||||
|
|
||||||
CREATE TABLE t1(a INT);
|
|
||||||
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a= 1;
|
|
||||||
RENAME TABLE t1 TO T1;
|
|
||||||
ALTER TABLE T1 RENAME t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
#
|
|
||||||
# MDEV-13912 mysql_upgrade: case (in)sensitivity for stored procedures
|
|
||||||
#
|
|
||||||
create database TEST;
|
|
||||||
create procedure TEST.pr() begin end;
|
|
||||||
create procedure test.pr() begin end;
|
|
||||||
--exec $MYSQL_UPGRADE --force 2>&1
|
|
||||||
drop procedure test.pr;
|
|
||||||
drop database TEST;
|
|
||||||
|
|
||||||
# End of 5.5 tests
|
|
||||||
|
|
||||||
#
|
|
||||||
# MDEV-9014 SHOW TRIGGERS not case sensitive
|
|
||||||
#
|
|
||||||
create table t1 (a int);
|
|
||||||
create trigger t1_bi before insert on t1 for each row set new.a= 1;
|
|
||||||
show triggers like '%T1%';
|
|
||||||
drop table t1;
|
|
@ -600,3 +600,29 @@ a
|
|||||||
2
|
2
|
||||||
drop table "a1\""b1";
|
drop table "a1\""b1";
|
||||||
set sql_mode=default;
|
set sql_mode=default;
|
||||||
|
create table t1 (a text);
|
||||||
|
select count(*) from t1;
|
||||||
|
count(*)
|
||||||
|
41
|
||||||
|
truncate table t1;
|
||||||
|
select count(*) from t1;
|
||||||
|
count(*)
|
||||||
|
41
|
||||||
|
truncate table t1;
|
||||||
|
select count(*) from t1;
|
||||||
|
count(*)
|
||||||
|
0
|
||||||
|
truncate table t1;
|
||||||
|
select count(*) from t1;
|
||||||
|
count(*)
|
||||||
|
0
|
||||||
|
truncate table t1;
|
||||||
|
select count(*) from t1;
|
||||||
|
count(*)
|
||||||
|
41
|
||||||
|
truncate table t1;
|
||||||
|
select count(*) from t1;
|
||||||
|
count(*)
|
||||||
|
0
|
||||||
|
truncate table t1;
|
||||||
|
drop table t1;
|
||||||
|
@ -85,3 +85,19 @@ checksum table t1 extended;
|
|||||||
Table Checksum
|
Table Checksum
|
||||||
test.t1 4108368782
|
test.t1 4108368782
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
#
|
||||||
|
# MDEV-17085: CHECKSUM TABLE EXTENDED does not work correctly
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 ( c1 int NOT NULL, c2 int NOT NULL, c4 varchar(20), c5 varchar(20), c6 varchar(20), c7 varchar(20), c8 varchar(20), c9 varchar(20), c10 varchar(20), c11 varchar(20), c12 varchar(20), c13 varchar(20), c14 varchar(20), c15 varchar(20), c16 varchar(20), c19 int NOT NULL, c20 int NOT NULL, c21 varchar(20), c22 VARCHAR(20), c23 varchar(20));
|
||||||
|
insert into t1 values (5,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,"dog",NULL,NULL);
|
||||||
|
# Important is that checksum is different from following
|
||||||
|
CHECKSUM TABLE t1 EXTENDED;
|
||||||
|
Table Checksum
|
||||||
|
test.t1 2514025256
|
||||||
|
UPDATE t1 SET c21='cat' WHERE c1=5;
|
||||||
|
# Important is that checksum is different from above
|
||||||
|
CHECKSUM TABLE t1 EXTENDED;
|
||||||
|
Table Checksum
|
||||||
|
test.t1 2326430205
|
||||||
|
drop table t1;
|
||||||
|
# End of 5.5 tests
|
||||||
|
@ -85,3 +85,19 @@ checksum table t1 extended;
|
|||||||
Table Checksum
|
Table Checksum
|
||||||
test.t1 3885665021
|
test.t1 3885665021
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
#
|
||||||
|
# MDEV-17085: CHECKSUM TABLE EXTENDED does not work correctly
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 ( c1 int NOT NULL, c2 int NOT NULL, c4 varchar(20), c5 varchar(20), c6 varchar(20), c7 varchar(20), c8 varchar(20), c9 varchar(20), c10 varchar(20), c11 varchar(20), c12 varchar(20), c13 varchar(20), c14 varchar(20), c15 varchar(20), c16 varchar(20), c19 int NOT NULL, c20 int NOT NULL, c21 varchar(20), c22 VARCHAR(20), c23 varchar(20));
|
||||||
|
insert into t1 values (5,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,"dog",NULL,NULL);
|
||||||
|
# Important is that checksum is different from following
|
||||||
|
CHECKSUM TABLE t1 EXTENDED;
|
||||||
|
Table Checksum
|
||||||
|
test.t1 2514025256
|
||||||
|
UPDATE t1 SET c21='cat' WHERE c1=5;
|
||||||
|
# Important is that checksum is different from above
|
||||||
|
CHECKSUM TABLE t1 EXTENDED;
|
||||||
|
Table Checksum
|
||||||
|
test.t1 2326430205
|
||||||
|
drop table t1;
|
||||||
|
# End of 5.5 tests
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -394,3 +394,25 @@ select null in (select a from t1 where a < out3.a union select a from t2 where
|
|||||||
(select a from t3) +1 < out3.a+1) from t3 out3;
|
(select a from t3) +1 < out3.a+1) from t3 out3;
|
||||||
ERROR 21000: Subquery returns more than 1 row
|
ERROR 21000: Subquery returns more than 1 row
|
||||||
drop table t1, t2, t3;
|
drop table t1, t2, t3;
|
||||||
|
CREATE TABLE t1(
|
||||||
|
q11 int, q12 int, q13 int, q14 int, q15 int, q16 int, q17 int, q18 int, q19 int,
|
||||||
|
q21 int, q22 int, q23 int, q24 int, q25 int, q26 int, q27 int, q28 int, q29 int,
|
||||||
|
f1 int
|
||||||
|
);
|
||||||
|
CREATE TABLE t2(f2 int, f21 int, f3 timestamp, f4 int, f5 int, f6 int);
|
||||||
|
INSERT INTO t1 (f1) VALUES (1),(1),(2),(2);
|
||||||
|
INSERT INTO t2 VALUES (1,1,"2004-02-29 11:11:11",0,0,0), (2,2,"2004-02-29 11:11:11",0,0,0);
|
||||||
|
SELECT f1,
|
||||||
|
(SELECT t.f21 from t2 t where max(
|
||||||
|
q11+q12+q13+q14+q15+q16+q17+q18+q19+
|
||||||
|
q21+q22+q23+q24+q25+q26+q27+q28+q29) = t.f2 UNION
|
||||||
|
SELECT t.f3 FROM t2 AS t WHERE t1.f1=t.f2 AND t.f3=MAX(t1.f1) UNION
|
||||||
|
SELECT 1 LIMIT 1) AS test
|
||||||
|
FROM t1 GROUP BY f1;
|
||||||
|
f1 test
|
||||||
|
1 1
|
||||||
|
2 1
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Incorrect datetime value: '1'
|
||||||
|
Warning 1292 Incorrect datetime value: '2'
|
||||||
|
DROP TABLE t1,t2;
|
||||||
|
@ -2865,6 +2865,22 @@ SELECT * FROM t2 WHERE f IN ( SELECT LEFT('foo',0) FROM t1 ORDER BY 1 );
|
|||||||
f
|
f
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
#
|
#
|
||||||
|
# MDEV-18255: Server crashes in Bitmap<64u>::intersect
|
||||||
|
#
|
||||||
|
create table t1 (v1 varchar(1)) engine=myisam ;
|
||||||
|
create table t2 (v1 varchar(1)) engine=myisam ;
|
||||||
|
explain
|
||||||
|
select 1 from t1 where exists
|
||||||
|
(select 1 from t1 where t1.v1 in (select t2.v1 from t2 having t2.v1 < 'j')) ;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||||
|
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
|
||||||
|
3 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
|
||||||
|
select 1 from t1 where exists
|
||||||
|
(select 1 from t1 where t1.v1 in (select t2.v1 from t2 having t2.v1 < 'j')) ;
|
||||||
|
1
|
||||||
|
drop table t1,t2;
|
||||||
|
#
|
||||||
# MDEV-9489: Assertion `0' failed in Protocol::end_statement() on
|
# MDEV-9489: Assertion `0' failed in Protocol::end_statement() on
|
||||||
# UNION ALL
|
# UNION ALL
|
||||||
#
|
#
|
||||||
|
@ -1,417 +0,0 @@
|
|||||||
# Description
|
|
||||||
# -----------
|
|
||||||
# Numeric floating point.
|
|
||||||
|
|
||||||
--disable_warnings
|
|
||||||
drop table if exists t1,t2;
|
|
||||||
--enable_warnings
|
|
||||||
|
|
||||||
SELECT 10,10.0,10.,.1e+2,100.0e-1;
|
|
||||||
SELECT 6e-16, -6e-16, --6e-16, -6e-16+1.000000;
|
|
||||||
SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1;
|
|
||||||
SELECT 0.001e+1,0.001e-1, -0.001e+01,-0.001e-01;
|
|
||||||
SELECT 123.23E+02,-123.23E-02,"123.23E+02"+0.0,"-123.23E-02"+0.0;
|
|
||||||
SELECT 2147483647E+02,21474836.47E+06;
|
|
||||||
|
|
||||||
create table t1 (f1 float(24),f2 float(52));
|
|
||||||
# We mask out Privileges column because it differs for embedded server
|
|
||||||
--replace_column 8 #
|
|
||||||
show full columns from t1;
|
|
||||||
insert into t1 values(10,10),(1e+5,1e+5),(1234567890,1234567890),(1e+10,1e+10),(1e+15,1e+15),(1e+20,1e+20),(1e+50,1e+50),(1e+150,1e+150);
|
|
||||||
insert into t1 values(-10,-10),(1e-5,1e-5),(1e-10,1e-10),(1e-15,1e-15),(1e-20,1e-20),(1e-50,1e-50),(1e-150,1e-150);
|
|
||||||
select * from t1;
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
create table t1 (datum double);
|
|
||||||
insert into t1 values (0.5),(1.0),(1.5),(2.0),(2.5);
|
|
||||||
select * from t1;
|
|
||||||
select * from t1 where datum < 1.5;
|
|
||||||
select * from t1 where datum > 1.5;
|
|
||||||
select * from t1 where datum = 1.5;
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
create table t1 (a decimal(7,3) not null, key (a));
|
|
||||||
insert into t1 values ("0"),("-0.00"),("-0.01"),("-0.002"),("1");
|
|
||||||
select a from t1 order by a;
|
|
||||||
select min(a) from t1;
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
#
|
|
||||||
# BUG#3612, BUG#4393, BUG#4356, BUG#4394
|
|
||||||
#
|
|
||||||
|
|
||||||
create table t1 (c1 double, c2 varchar(20));
|
|
||||||
insert t1 values (121,"16");
|
|
||||||
select c1 + c1 * (c2 / 100) as col from t1;
|
|
||||||
create table t2 select c1 + c1 * (c2 / 100) as col1, round(c1, 5) as col2, round(c1, 35) as col3, sqrt(c1*1e-15) col4 from t1;
|
|
||||||
# Floats are a bit different in PS
|
|
||||||
--disable_ps_protocol
|
|
||||||
select * from t2;
|
|
||||||
--enable_ps_protocol
|
|
||||||
show create table t2;
|
|
||||||
drop table t1,t2;
|
|
||||||
|
|
||||||
# Bug #1022: When a table contains a 'float' field,
|
|
||||||
# and one of the functions MAX, MIN, or AVG is used on that field,
|
|
||||||
# the system crashes.
|
|
||||||
|
|
||||||
create table t1 (a float);
|
|
||||||
insert into t1 values (1);
|
|
||||||
select max(a),min(a),avg(a) from t1;
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
#
|
|
||||||
# FLOAT/DOUBLE/DECIMAL handling
|
|
||||||
#
|
|
||||||
|
|
||||||
create table t1 (f float, f2 float(24), f3 float(6,2), d double, d2 float(53), d3 double(10,3), de decimal, de2 decimal(6), de3 decimal(5,2), n numeric, n2 numeric(8), n3 numeric(7,6));
|
|
||||||
# We mask out Privileges column because it differs for embedded server
|
|
||||||
--replace_column 8 #
|
|
||||||
show full columns from t1;
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
create table t1 (a decimal(7,3) not null, key (a));
|
|
||||||
insert into t1 values ("0"),("-0.00"),("-0.01"),("-0.002"),("1");
|
|
||||||
select a from t1 order by a;
|
|
||||||
select min(a) from t1;
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
--error 1425
|
|
||||||
create table t1 (a float(200,100), b double(200,100));
|
|
||||||
|
|
||||||
#
|
|
||||||
# float in a char(1) field
|
|
||||||
#
|
|
||||||
create table t1 (c20 char);
|
|
||||||
insert into t1 values (5000.0);
|
|
||||||
insert into t1 values (0.5e4);
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
# Errors
|
|
||||||
|
|
||||||
--error 1063
|
|
||||||
create table t1 (f float(54)); # Should give an error
|
|
||||||
--disable_warnings
|
|
||||||
drop table if exists t1;
|
|
||||||
--enable_warnings
|
|
||||||
|
|
||||||
# Don't allow 'double unsigned' to be set to a negative value (Bug #7700)
|
|
||||||
create table t1 (d1 double, d2 double unsigned);
|
|
||||||
insert into t1 set d1 = -1.0;
|
|
||||||
update t1 set d2 = d1;
|
|
||||||
select * from t1;
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
# Ensure that maximum values as the result of number of decimals
|
|
||||||
# being specified in table schema are enforced (Bug #7361)
|
|
||||||
create table t1 (f float(4,3));
|
|
||||||
insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11");
|
|
||||||
select * from t1;
|
|
||||||
drop table if exists t1;
|
|
||||||
create table t1 (f double(4,3));
|
|
||||||
insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11");
|
|
||||||
select * from t1;
|
|
||||||
drop table if exists t1;
|
|
||||||
|
|
||||||
# Check conversion of floats to character field (Bug #7774)
|
|
||||||
create table t1 (c char(20));
|
|
||||||
insert into t1 values (5e-28);
|
|
||||||
select * from t1;
|
|
||||||
drop table t1;
|
|
||||||
create table t1 (c char(6));
|
|
||||||
insert into t1 values (2e5),(2e6),(2e-4),(2e-5);
|
|
||||||
select * from t1;
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
#
|
|
||||||
# Test of comparison of integer with float-in-range (Bug #7840)
|
|
||||||
# This is needed because some ODBC applications (like Foxpro) uses
|
|
||||||
# floats for everything.
|
|
||||||
#
|
|
||||||
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
reckey int unsigned NOT NULL,
|
|
||||||
recdesc varchar(50) NOT NULL,
|
|
||||||
PRIMARY KEY (reckey)
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
|
||||||
|
|
||||||
INSERT INTO t1 VALUES (108, 'Has 108 as key');
|
|
||||||
INSERT INTO t1 VALUES (109, 'Has 109 as key');
|
|
||||||
select * from t1 where reckey=108;
|
|
||||||
select * from t1 where reckey=1.08E2;
|
|
||||||
select * from t1 where reckey=109;
|
|
||||||
select * from t1 where reckey=1.09E2;
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
#
|
|
||||||
# Bug #13372 (decimal union)
|
|
||||||
#
|
|
||||||
create table t1 (d double(10,1));
|
|
||||||
create table t2 (d double(10,9));
|
|
||||||
insert into t1 values ("100000000.0");
|
|
||||||
insert into t2 values ("1.23456780");
|
|
||||||
create table t3 select * from t2 union select * from t1;
|
|
||||||
select * from t3;
|
|
||||||
show create table t3;
|
|
||||||
drop table t1, t2, t3;
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Bug #9855 (inconsistent column type for create select
|
|
||||||
#
|
|
||||||
create table t1 select 105213674794682365.00 + 0.0 x;
|
|
||||||
show warnings;
|
|
||||||
desc t1;
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
create table t1 select 0.0 x;
|
|
||||||
desc t1;
|
|
||||||
create table t2 select 105213674794682365.00 y;
|
|
||||||
desc t2;
|
|
||||||
create table t3 select x+y a from t1,t2;
|
|
||||||
show warnings;
|
|
||||||
desc t3;
|
|
||||||
drop table t1,t2,t3;
|
|
||||||
|
|
||||||
#
|
|
||||||
# Bug #22129: A small double precision number becomes zero
|
|
||||||
#
|
|
||||||
# check if underflows are detected correctly
|
|
||||||
select 1e-308, 1.00000001e-300, 100000000e-300;
|
|
||||||
|
|
||||||
# check if overflows are detected correctly
|
|
||||||
select 10e307;
|
|
||||||
|
|
||||||
#
|
|
||||||
# Bug #19690: ORDER BY eliminates rows from the result
|
|
||||||
#
|
|
||||||
create table t1(a int, b double(8, 2));
|
|
||||||
insert into t1 values
|
|
||||||
(1, 28.50), (1, 121.85), (1, 157.23), (1, 1351.00), (1, -1965.35), (1, 81.75),
|
|
||||||
(1, 217.08), (1, 7.94), (4, 96.07), (4, 6404.65), (4, -6500.72), (2, 100.00),
|
|
||||||
(5, 5.00), (5, -2104.80), (5, 2033.80), (5, 0.07), (5, 65.93),
|
|
||||||
(3, -4986.24), (3, 5.00), (3, 4857.34), (3, 123.74), (3, 0.16),
|
|
||||||
(6, -1695.31), (6, 1003.77), (6, 499.72), (6, 191.82);
|
|
||||||
explain select sum(b) s from t1 group by a;
|
|
||||||
select sum(b) s from t1 group by a;
|
|
||||||
select sum(b) s from t1 group by a having s <> 0;
|
|
||||||
select sum(b) s from t1 group by a having s <> 0 order by s;
|
|
||||||
select sum(b) s from t1 group by a having s <=> 0;
|
|
||||||
select sum(b) s from t1 group by a having s <=> 0 order by s;
|
|
||||||
alter table t1 add key (a, b);
|
|
||||||
explain select sum(b) s from t1 group by a;
|
|
||||||
select sum(b) s from t1 group by a;
|
|
||||||
select sum(b) s from t1 group by a having s <> 0;
|
|
||||||
select sum(b) s from t1 group by a having s <> 0 order by s;
|
|
||||||
select sum(b) s from t1 group by a having s <=> 0;
|
|
||||||
select sum(b) s from t1 group by a having s <=> 0 order by s;
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
--echo End of 4.1 tests
|
|
||||||
|
|
||||||
#
|
|
||||||
# bug #12694 (float(m,d) specifications)
|
|
||||||
#
|
|
||||||
|
|
||||||
--error 1427
|
|
||||||
create table t1 (s1 float(0,2));
|
|
||||||
--error 1427
|
|
||||||
create table t1 (s1 float(1,2));
|
|
||||||
|
|
||||||
#
|
|
||||||
# MySQL Bugs: #11589: mysqltest --ps-protocol, strange output, float/double/real with zerofill
|
|
||||||
#
|
|
||||||
|
|
||||||
CREATE TABLE t1 (
|
|
||||||
f1 real zerofill,
|
|
||||||
f2 double zerofill,
|
|
||||||
f3 float zerofill);
|
|
||||||
INSERT INTO t1 VALUES ( 0.314152e+1, 0.314152e+1, 0.314152e+1);
|
|
||||||
|
|
||||||
let $my_stmt= select f1, f2, f3 FROM t1;
|
|
||||||
eval PREPARE stmt1 FROM '$my_stmt';
|
|
||||||
select f1, f2, f3 FROM t1;
|
|
||||||
eval $my_stmt;
|
|
||||||
EXECUTE stmt1;
|
|
||||||
|
|
||||||
DROP TABLE t1;
|
|
||||||
# Bug #28121 "INSERT or UPDATE into DOUBLE(200,0) field being truncated to 31 digits"
|
|
||||||
#
|
|
||||||
|
|
||||||
create table t1 (f1 double(200, 0));
|
|
||||||
insert into t1 values (1e199), (-1e199);
|
|
||||||
insert into t1 values (1e200), (-1e200);
|
|
||||||
insert into t1 values (2e200), (-2e200);
|
|
||||||
select f1 + 0e0 from t1;
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
create table t1 (f1 float(30, 0));
|
|
||||||
insert into t1 values (1e29), (-1e29);
|
|
||||||
insert into t1 values (1e30), (-1e30);
|
|
||||||
insert into t1 values (2e30), (-2e30);
|
|
||||||
select f1 + 0e0 from t1;
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
#
|
|
||||||
# Bug #12860 "Difference in zero padding of exponent between Unix and Windows"
|
|
||||||
#
|
|
||||||
|
|
||||||
create table t1 (c char(6));
|
|
||||||
insert into t1 values (2e6),(2e-5);
|
|
||||||
select * from t1;
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
#
|
|
||||||
# Bug #21497 "DOUBLE truncated to unusable value"
|
|
||||||
#
|
|
||||||
|
|
||||||
CREATE TABLE d1 (d DOUBLE);
|
|
||||||
INSERT INTO d1 VALUES (1.7976931348623157E+308);
|
|
||||||
SELECT * FROM d1;
|
|
||||||
--error ER_ILLEGAL_VALUE_FOR_TYPE
|
|
||||||
INSERT INTO d1 VALUES (1.79769313486232e+308);
|
|
||||||
SELECT * FROM d1;
|
|
||||||
DROP TABLE d1;
|
|
||||||
|
|
||||||
#
|
|
||||||
# Bug #26788 "mysqld (debug) aborts when inserting specific numbers into char
|
|
||||||
# fields"
|
|
||||||
#
|
|
||||||
|
|
||||||
create table t1 (a char(20));
|
|
||||||
insert into t1 values (1.225e-05);
|
|
||||||
select a+0 from t1;
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
#
|
|
||||||
# Bug #27483: Casting 'scientific notation type' to 'unsigned bigint' fails on
|
|
||||||
# windows.
|
|
||||||
#
|
|
||||||
|
|
||||||
create table t1(d double, u bigint unsigned);
|
|
||||||
|
|
||||||
insert into t1(d) values (9.22337203685479e18),
|
|
||||||
(1.84e19);
|
|
||||||
|
|
||||||
update t1 set u = d;
|
|
||||||
select u from t1;
|
|
||||||
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
#
|
|
||||||
# Bug #21205: Different number of digits for float/doble/real in --ps-protocol
|
|
||||||
#
|
|
||||||
|
|
||||||
CREATE TABLE t1 (f1 DOUBLE);
|
|
||||||
INSERT INTO t1 VALUES(-1.79769313486231e+308);
|
|
||||||
SELECT f1 FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
--echo #
|
|
||||||
--echo # Bug#12406055 BUFFER OVERFLOW OF VARIABLE 'BUFF' IN STRING::SET_REAL
|
|
||||||
--echo #
|
|
||||||
|
|
||||||
--echo # Ignoring output from misc. float operations
|
|
||||||
--disable_result_log
|
|
||||||
|
|
||||||
let $nine_65=
|
|
||||||
99999999999999999999999999999999999999999999999999999999999999999;
|
|
||||||
|
|
||||||
select format(-1.7976931348623157E+307,256) as foo;
|
|
||||||
select least(-1.1111111111111111111111111,
|
|
||||||
- group_concat(1.7976931348623157E+308)) as foo;
|
|
||||||
eval select concat((truncate((-1.7976931348623157E+307),(0x1e))),
|
|
||||||
($nine_65)) into @a;
|
|
||||||
--enable_result_log
|
|
||||||
|
|
||||||
--echo End of 5.0 tests
|
|
||||||
|
|
||||||
--echo #
|
|
||||||
--echo # Bug#12368853 FORMAT() CRASHES WITH LARGE NUMBERS AFTER TRUNCATE...
|
|
||||||
--echo #
|
|
||||||
|
|
||||||
select format(truncate('1.7976931348623157E+308',-12),1,'fr_BE') as foo;
|
|
||||||
|
|
||||||
|
|
||||||
--echo #
|
|
||||||
--echo # MDEV-17249 MAKETIME(-1e50,0,0) returns a wrong result
|
|
||||||
--echo #
|
|
||||||
|
|
||||||
SELECT LEFT('a',EXP(50));
|
|
||||||
SELECT LEFT('a', COALESCE(1e30));
|
|
||||||
|
|
||||||
CREATE TABLE t1 (a FLOAT);
|
|
||||||
INSERT INTO t1 VALUES (1e30);
|
|
||||||
SELECT LEFT('a',a), LEFT('a',1e30) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
PREPARE stmt FROM 'SELECT LEFT(111,?)';
|
|
||||||
SET @a=1e30;
|
|
||||||
EXECUTE stmt USING @a;
|
|
||||||
DEALLOCATE PREPARE stmt;
|
|
||||||
|
|
||||||
CREATE TABLE t1 (a INT);
|
|
||||||
INSERT INTO t1 VALUES (1),(2),(3);
|
|
||||||
SELECT LEFT('a',(SELECT 1e30 FROM t1 LIMIT 1));
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
CREATE TABLE t1 (a DOUBLE);
|
|
||||||
INSERT INTO t1 VALUES (1e30),(0);
|
|
||||||
SELECT LEFT('a', SUM(a)) FROM t1;
|
|
||||||
SELECT LEFT('a', AVG(a)) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
|
|
||||||
--echo #
|
|
||||||
--echo # Bug #13500371 63704: CONVERSION OF '1.' TO A NUMBER GIVES ERROR 1265
|
|
||||||
--echo # (WARN_DATA_TRUNCATED)
|
|
||||||
--echo #
|
|
||||||
|
|
||||||
CREATE TABLE t1 (f FLOAT);
|
|
||||||
INSERT INTO t1 VALUES ('1.');
|
|
||||||
INSERT INTO t1 VALUES ('2.0.');
|
|
||||||
INSERT INTO t1 VALUES ('.');
|
|
||||||
SELECT * FROM t1 ORDER BY f;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
|
|
||||||
--echo #
|
|
||||||
--echo # Start of 10.0 tests
|
|
||||||
--echo #
|
|
||||||
|
|
||||||
--echo #
|
|
||||||
--echo # MDEV-6950 Bad results with joins comparing DATE/DATETIME and INT/DECIMAL/DOUBLE/ENUM/VARCHAR columns
|
|
||||||
--echo #
|
|
||||||
CREATE TABLE t1 (a DATETIME PRIMARY KEY);
|
|
||||||
INSERT INTO t1 VALUES ('1999-01-01 00:00:00');
|
|
||||||
CREATE TABLE t2 (a DOUBLE);
|
|
||||||
INSERT INTO t2 VALUES (19990101000000);
|
|
||||||
INSERT INTO t2 VALUES (990101000000);
|
|
||||||
SELECT t1.* FROM t1,t2 WHERE t1.a=t2.a;
|
|
||||||
SELECT t1.* FROM t1 LEFT JOIN t2 ON t1.a=t2.a;
|
|
||||||
ALTER TABLE t2 ADD PRIMARY KEY(a);
|
|
||||||
SELECT t1.* FROM t1,t2 WHERE t1.a=t2.a;
|
|
||||||
SELECT t1.* FROM t1 LEFT JOIN t2 ON t1.a=t2.a;
|
|
||||||
--echo # t2 should NOT be eliminated
|
|
||||||
EXPLAIN SELECT t1.* FROM t1 LEFT JOIN t2 ON t1.a=t2.a;
|
|
||||||
DROP TABLE t1,t2;
|
|
||||||
|
|
||||||
--echo #
|
|
||||||
--echo # MDEV-6971 Bad results with joins comparing TIME and DOUBLE/DECIMAL columns
|
|
||||||
--echo #
|
|
||||||
CREATE TABLE t1 (a TIME(6) PRIMARY KEY);
|
|
||||||
INSERT INTO t1 VALUES ('10:20:30');
|
|
||||||
CREATE TABLE t2 (a DOUBLE);
|
|
||||||
INSERT INTO t2 VALUES (102030),(102030.000000001);
|
|
||||||
SELECT t1.* FROM t1 JOIN t2 USING(a);
|
|
||||||
SELECT t1.* FROM t1 LEFT JOIN t2 USING(a);
|
|
||||||
ALTER TABLE t2 ADD PRIMARY KEY(a);
|
|
||||||
SELECT t1.* FROM t1 JOIN t2 USING(a);
|
|
||||||
SELECT t1.* FROM t1 LEFT JOIN t2 USING(a);
|
|
||||||
--echo # t2 should NOT be elimitated
|
|
||||||
EXPLAIN SELECT t1.* FROM t1 LEFT JOIN t2 USING(a);
|
|
||||||
DROP TABLE t1,t2;
|
|
||||||
|
|
||||||
--echo #
|
|
||||||
--echo # End of 10.0 tests
|
|
||||||
--echo #
|
|
@ -49,3 +49,36 @@ INSERT INTO t3 SET a=1;
|
|||||||
kill query @id;
|
kill query @id;
|
||||||
ERROR 70100: Query execution was interrupted
|
ERROR 70100: Query execution was interrupted
|
||||||
DROP TABLE t3,t1;
|
DROP TABLE t3,t1;
|
||||||
|
#
|
||||||
|
# MDEV-18222 InnoDB: Failing assertion: heap->magic_n == MEM_BLOCK_MAGIC_N
|
||||||
|
# or ASAN heap-use-after-free in dict_foreign_remove_from_cache upon CHANGE COLUMN
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT, UNIQUE(a), KEY(a)) ENGINE=InnoDB;
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (a);
|
||||||
|
SET SESSION FOREIGN_KEY_CHECKS = OFF;
|
||||||
|
ALTER TABLE t1 CHANGE COLUMN a a TIME NOT NULL;
|
||||||
|
ALTER TABLE t1 ADD pk INT NOT NULL AUTO_INCREMENT PRIMARY KEY;
|
||||||
|
ALTER TABLE t1 CHANGE COLUMN a b TIME;
|
||||||
|
SET SESSION FOREIGN_KEY_CHECKS = ON;
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# MDEV-18256 InnoDB: Failing assertion: heap->magic_n == MEM_BLOCK_MAGIC_N
|
||||||
|
# upon DROP FOREIGN KEY
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||||
|
CREATE TABLE t2 (b INT PRIMARY KEY, FOREIGN KEY fk1 (b) REFERENCES t1 (a))
|
||||||
|
ENGINE=InnoDB;
|
||||||
|
ALTER TABLE t2 DROP FOREIGN KEY fk1, DROP FOREIGN KEY fk1;
|
||||||
|
DROP TABLE t2, t1;
|
||||||
|
CREATE TABLE t1 (f VARCHAR(256)) ENGINE=InnoDB;
|
||||||
|
SET SESSION FOREIGN_KEY_CHECKS = OFF;
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (f) REFERENCES non_existing_table (x);
|
||||||
|
SET SESSION FOREIGN_KEY_CHECKS = ON;
|
||||||
|
ALTER TABLE t1 ADD FULLTEXT INDEX ft1 (f);
|
||||||
|
Warnings:
|
||||||
|
Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
|
||||||
|
Warning 1088 failed to load FOREIGN KEY constraints
|
||||||
|
ALTER TABLE t1 ADD FULLTEXT INDEX ft2 (f);
|
||||||
|
Warnings:
|
||||||
|
Warning 1088 failed to load FOREIGN KEY constraints
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -73,3 +73,34 @@ reap;
|
|||||||
disconnect fk;
|
disconnect fk;
|
||||||
|
|
||||||
DROP TABLE t3,t1;
|
DROP TABLE t3,t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-18222 InnoDB: Failing assertion: heap->magic_n == MEM_BLOCK_MAGIC_N
|
||||||
|
--echo # or ASAN heap-use-after-free in dict_foreign_remove_from_cache upon CHANGE COLUMN
|
||||||
|
--echo #
|
||||||
|
CREATE TABLE t1 (a INT, UNIQUE(a), KEY(a)) ENGINE=InnoDB;
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (a);
|
||||||
|
SET SESSION FOREIGN_KEY_CHECKS = OFF;
|
||||||
|
ALTER TABLE t1 CHANGE COLUMN a a TIME NOT NULL;
|
||||||
|
ALTER TABLE t1 ADD pk INT NOT NULL AUTO_INCREMENT PRIMARY KEY;
|
||||||
|
ALTER TABLE t1 CHANGE COLUMN a b TIME;
|
||||||
|
SET SESSION FOREIGN_KEY_CHECKS = ON;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-18256 InnoDB: Failing assertion: heap->magic_n == MEM_BLOCK_MAGIC_N
|
||||||
|
--echo # upon DROP FOREIGN KEY
|
||||||
|
--echo #
|
||||||
|
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||||
|
CREATE TABLE t2 (b INT PRIMARY KEY, FOREIGN KEY fk1 (b) REFERENCES t1 (a))
|
||||||
|
ENGINE=InnoDB;
|
||||||
|
ALTER TABLE t2 DROP FOREIGN KEY fk1, DROP FOREIGN KEY fk1;
|
||||||
|
DROP TABLE t2, t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (f VARCHAR(256)) ENGINE=InnoDB;
|
||||||
|
SET SESSION FOREIGN_KEY_CHECKS = OFF;
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (f) REFERENCES non_existing_table (x);
|
||||||
|
SET SESSION FOREIGN_KEY_CHECKS = ON;
|
||||||
|
ALTER TABLE t1 ADD FULLTEXT INDEX ft1 (f);
|
||||||
|
ALTER TABLE t1 ADD FULLTEXT INDEX ft2 (f);
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -16,7 +16,9 @@ wait/synch/mutex/sql/LOCK_audit_mask YES YES
|
|||||||
wait/synch/mutex/sql/LOCK_binlog_state YES YES
|
wait/synch/mutex/sql/LOCK_binlog_state YES YES
|
||||||
select * from performance_schema.setup_instruments
|
select * from performance_schema.setup_instruments
|
||||||
where name like 'Wait/Synch/Rwlock/sql/%'
|
where name like 'Wait/Synch/Rwlock/sql/%'
|
||||||
and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock')
|
and name not in (
|
||||||
|
'wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock',
|
||||||
|
'wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group')
|
||||||
order by name limit 10;
|
order by name limit 10;
|
||||||
NAME ENABLED TIMED
|
NAME ENABLED TIMED
|
||||||
wait/synch/rwlock/sql/LOCK_dboptions YES YES
|
wait/synch/rwlock/sql/LOCK_dboptions YES YES
|
||||||
|
@ -22,10 +22,13 @@ select * from performance_schema.setup_instruments
|
|||||||
order by name limit 10;
|
order by name limit 10;
|
||||||
|
|
||||||
# CRYPTO_dynlock_value::lock is dependent on the build (SSL)
|
# CRYPTO_dynlock_value::lock is dependent on the build (SSL)
|
||||||
|
# LOCK_named_pipe_full_access_group is dependent on the build (Windows)
|
||||||
|
|
||||||
select * from performance_schema.setup_instruments
|
select * from performance_schema.setup_instruments
|
||||||
where name like 'Wait/Synch/Rwlock/sql/%'
|
where name like 'Wait/Synch/Rwlock/sql/%'
|
||||||
and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock')
|
and name not in (
|
||||||
|
'wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock',
|
||||||
|
'wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group')
|
||||||
order by name limit 10;
|
order by name limit 10;
|
||||||
|
|
||||||
# COND_handler_count is dependent on the build (Windows only)
|
# COND_handler_count is dependent on the build (Windows only)
|
||||||
|
@ -1214,8 +1214,8 @@
|
|||||||
COMMAND_LINE_ARGUMENT OPTIONAL
|
COMMAND_LINE_ARGUMENT OPTIONAL
|
||||||
VARIABLE_NAME INNODB_VERSION
|
VARIABLE_NAME INNODB_VERSION
|
||||||
SESSION_VALUE NULL
|
SESSION_VALUE NULL
|
||||||
-GLOBAL_VALUE 5.6.42
|
-GLOBAL_VALUE 5.6.43
|
||||||
+GLOBAL_VALUE 5.6.41-84.1
|
+GLOBAL_VALUE 5.6.42-84.2
|
||||||
GLOBAL_VALUE_ORIGIN COMPILE-TIME
|
GLOBAL_VALUE_ORIGIN COMPILE-TIME
|
||||||
DEFAULT_VALUE NULL
|
DEFAULT_VALUE NULL
|
||||||
VARIABLE_SCOPE GLOBAL
|
VARIABLE_SCOPE GLOBAL
|
||||||
|
@ -684,8 +684,8 @@
|
|||||||
COMMAND_LINE_ARGUMENT OPTIONAL
|
COMMAND_LINE_ARGUMENT OPTIONAL
|
||||||
VARIABLE_NAME INNODB_VERSION
|
VARIABLE_NAME INNODB_VERSION
|
||||||
SESSION_VALUE NULL
|
SESSION_VALUE NULL
|
||||||
-GLOBAL_VALUE 5.6.42
|
-GLOBAL_VALUE 5.6.43
|
||||||
+GLOBAL_VALUE 5.6.41-84.1
|
+GLOBAL_VALUE 5.6.42-84.2
|
||||||
GLOBAL_VALUE_ORIGIN COMPILE-TIME
|
GLOBAL_VALUE_ORIGIN COMPILE-TIME
|
||||||
DEFAULT_VALUE NULL
|
DEFAULT_VALUE NULL
|
||||||
VARIABLE_SCOPE GLOBAL
|
VARIABLE_SCOPE GLOBAL
|
||||||
|
@ -2401,7 +2401,7 @@ READ_ONLY NO
|
|||||||
COMMAND_LINE_ARGUMENT OPTIONAL
|
COMMAND_LINE_ARGUMENT OPTIONAL
|
||||||
VARIABLE_NAME INNODB_VERSION
|
VARIABLE_NAME INNODB_VERSION
|
||||||
SESSION_VALUE NULL
|
SESSION_VALUE NULL
|
||||||
GLOBAL_VALUE 5.6.42
|
GLOBAL_VALUE 5.6.43
|
||||||
GLOBAL_VALUE_ORIGIN COMPILE-TIME
|
GLOBAL_VALUE_ORIGIN COMPILE-TIME
|
||||||
DEFAULT_VALUE NULL
|
DEFAULT_VALUE NULL
|
||||||
VARIABLE_SCOPE GLOBAL
|
VARIABLE_SCOPE GLOBAL
|
||||||
|
@ -680,3 +680,25 @@ show create table "a1\""b1";
|
|||||||
select * from "a1\""b1";
|
select * from "a1\""b1";
|
||||||
drop table "a1\""b1";
|
drop table "a1\""b1";
|
||||||
set sql_mode=default;
|
set sql_mode=default;
|
||||||
|
|
||||||
|
#
|
||||||
|
# mysql --local-infile
|
||||||
|
#
|
||||||
|
--let $ldli = load data local infile '$MYSQLTEST_VARDIR/tmp/bug.sql' into table test.t1;
|
||||||
|
create table t1 (a text);
|
||||||
|
--exec $MYSQL -e "$ldli"
|
||||||
|
select count(*) from t1; truncate table t1;
|
||||||
|
--exec $MYSQL --enable-local-infile -e "$ldli"
|
||||||
|
select count(*) from t1; truncate table t1;
|
||||||
|
--error 1
|
||||||
|
--exec $MYSQL --disable-local-infile -e "$ldli"
|
||||||
|
select count(*) from t1; truncate table t1;
|
||||||
|
--error 1
|
||||||
|
--exec $MYSQL -e "/*q*/$ldli"
|
||||||
|
select count(*) from t1; truncate table t1;
|
||||||
|
--exec $MYSQL --enable-local-infile -e "/*q*/$ldli"
|
||||||
|
select count(*) from t1; truncate table t1;
|
||||||
|
--error 1
|
||||||
|
--exec $MYSQL --disable-local-infile -e "/*q*/$ldli"
|
||||||
|
select count(*) from t1; truncate table t1;
|
||||||
|
drop table t1;
|
||||||
|
@ -60,3 +60,20 @@ checksum table t1;
|
|||||||
checksum table t1 quick;
|
checksum table t1 quick;
|
||||||
checksum table t1 extended;
|
checksum table t1 extended;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-17085: CHECKSUM TABLE EXTENDED does not work correctly
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 ( c1 int NOT NULL, c2 int NOT NULL, c4 varchar(20), c5 varchar(20), c6 varchar(20), c7 varchar(20), c8 varchar(20), c9 varchar(20), c10 varchar(20), c11 varchar(20), c12 varchar(20), c13 varchar(20), c14 varchar(20), c15 varchar(20), c16 varchar(20), c19 int NOT NULL, c20 int NOT NULL, c21 varchar(20), c22 VARCHAR(20), c23 varchar(20));
|
||||||
|
|
||||||
|
insert into t1 values (5,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,"dog",NULL,NULL);
|
||||||
|
--echo # Important is that checksum is different from following
|
||||||
|
CHECKSUM TABLE t1 EXTENDED;
|
||||||
|
UPDATE t1 SET c21='cat' WHERE c1=5;
|
||||||
|
--echo # Important is that checksum is different from above
|
||||||
|
CHECKSUM TABLE t1 EXTENDED;
|
||||||
|
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
--echo # End of 5.5 tests
|
||||||
|
@ -411,3 +411,23 @@ insert into t3 select a from t1;
|
|||||||
select null in (select a from t1 where a < out3.a union select a from t2 where
|
select null in (select a from t1 where a < out3.a union select a from t2 where
|
||||||
(select a from t3) +1 < out3.a+1) from t3 out3;
|
(select a from t3) +1 < out3.a+1) from t3 out3;
|
||||||
drop table t1, t2, t3;
|
drop table t1, t2, t3;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #28499924: INCORRECT BEHAVIOR WITH UNION IN SUBQUERY
|
||||||
|
#
|
||||||
|
CREATE TABLE t1(
|
||||||
|
q11 int, q12 int, q13 int, q14 int, q15 int, q16 int, q17 int, q18 int, q19 int,
|
||||||
|
q21 int, q22 int, q23 int, q24 int, q25 int, q26 int, q27 int, q28 int, q29 int,
|
||||||
|
f1 int
|
||||||
|
);
|
||||||
|
CREATE TABLE t2(f2 int, f21 int, f3 timestamp, f4 int, f5 int, f6 int);
|
||||||
|
INSERT INTO t1 (f1) VALUES (1),(1),(2),(2);
|
||||||
|
INSERT INTO t2 VALUES (1,1,"2004-02-29 11:11:11",0,0,0), (2,2,"2004-02-29 11:11:11",0,0,0);
|
||||||
|
SELECT f1,
|
||||||
|
(SELECT t.f21 from t2 t where max(
|
||||||
|
q11+q12+q13+q14+q15+q16+q17+q18+q19+
|
||||||
|
q21+q22+q23+q24+q25+q26+q27+q28+q29) = t.f2 UNION
|
||||||
|
SELECT t.f3 FROM t2 AS t WHERE t1.f1=t.f2 AND t.f3=MAX(t1.f1) UNION
|
||||||
|
SELECT 1 LIMIT 1) AS test
|
||||||
|
FROM t1 GROUP BY f1;
|
||||||
|
DROP TABLE t1,t2;
|
||||||
|
@ -268,6 +268,19 @@ SELECT * FROM t2 WHERE f IN ( SELECT LEFT('foo',0) FROM t1 ORDER BY 1 );
|
|||||||
SELECT * FROM t2 WHERE f IN ( SELECT LEFT('foo',0) FROM t1 ORDER BY 1 );
|
SELECT * FROM t2 WHERE f IN ( SELECT LEFT('foo',0) FROM t1 ORDER BY 1 );
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-18255: Server crashes in Bitmap<64u>::intersect
|
||||||
|
--echo #
|
||||||
|
create table t1 (v1 varchar(1)) engine=myisam ;
|
||||||
|
create table t2 (v1 varchar(1)) engine=myisam ;
|
||||||
|
|
||||||
|
explain
|
||||||
|
select 1 from t1 where exists
|
||||||
|
(select 1 from t1 where t1.v1 in (select t2.v1 from t2 having t2.v1 < 'j')) ;
|
||||||
|
select 1 from t1 where exists
|
||||||
|
(select 1 from t1 where t1.v1 in (select t2.v1 from t2 having t2.v1 < 'j')) ;
|
||||||
|
drop table t1,t2;
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # MDEV-9489: Assertion `0' failed in Protocol::end_statement() on
|
--echo # MDEV-9489: Assertion `0' failed in Protocol::end_statement() on
|
||||||
--echo # UNION ALL
|
--echo # UNION ALL
|
||||||
|
@ -52,10 +52,9 @@ static uint set_max_open_files(uint max_file_limit)
|
|||||||
DBUG_PRINT("info", ("rlim_cur: %u rlim_max: %u",
|
DBUG_PRINT("info", ("rlim_cur: %u rlim_max: %u",
|
||||||
(uint) rlimit.rlim_cur,
|
(uint) rlimit.rlim_cur,
|
||||||
(uint) rlimit.rlim_max));
|
(uint) rlimit.rlim_max));
|
||||||
if ((ulonglong) rlimit.rlim_cur == (ulonglong) RLIM_INFINITY)
|
if ((ulonglong) rlimit.rlim_cur == (ulonglong) RLIM_INFINITY ||
|
||||||
rlimit.rlim_cur = max_file_limit;
|
rlimit.rlim_cur >= max_file_limit)
|
||||||
if (rlimit.rlim_cur >= max_file_limit)
|
DBUG_RETURN(max_file_limit);
|
||||||
DBUG_RETURN(rlimit.rlim_cur); /* purecov: inspected */
|
|
||||||
rlimit.rlim_cur= rlimit.rlim_max= max_file_limit;
|
rlimit.rlim_cur= rlimit.rlim_max= max_file_limit;
|
||||||
if (setrlimit(RLIMIT_NOFILE, &rlimit))
|
if (setrlimit(RLIMIT_NOFILE, &rlimit))
|
||||||
max_file_limit= old_cur; /* Use original value */
|
max_file_limit= old_cur; /* Use original value */
|
||||||
|
@ -39,6 +39,9 @@ install_params=""
|
|||||||
auth_root_authentication_method=normal
|
auth_root_authentication_method=normal
|
||||||
auth_root_socket_user='root'
|
auth_root_socket_user='root'
|
||||||
|
|
||||||
|
dirname0=`dirname $0 2>/dev/null`
|
||||||
|
dirname0=`dirname $dirname0 2>/dev/null`
|
||||||
|
|
||||||
usage()
|
usage()
|
||||||
{
|
{
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
@ -235,11 +238,6 @@ cannot_find_file()
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
|
||||||
echo "If you compiled from source, you need to either run 'make install' to"
|
|
||||||
echo "copy the software into the correct location ready for operation."
|
|
||||||
echo "If you don't want to do a full install, you can use the --srcdir"
|
|
||||||
echo "option to only install the mysql database and privilege tables"
|
|
||||||
echo
|
echo
|
||||||
echo "If you compiled from source, you need to either run 'make install' to"
|
echo "If you compiled from source, you need to either run 'make install' to"
|
||||||
echo "copy the software into the correct location ready for operation."
|
echo "copy the software into the correct location ready for operation."
|
||||||
@ -286,6 +284,9 @@ then
|
|||||||
cannot_find_file my_print_defaults $basedir/bin $basedir/extra
|
cannot_find_file my_print_defaults $basedir/bin $basedir/extra
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
elif test -n "$dirname0" -a -x "$dirname0/@bindir@/my_print_defaults"
|
||||||
|
then
|
||||||
|
print_defaults="$dirname0/@bindir@/my_print_defaults"
|
||||||
else
|
else
|
||||||
print_defaults="@bindir@/my_print_defaults"
|
print_defaults="@bindir@/my_print_defaults"
|
||||||
fi
|
fi
|
||||||
@ -339,6 +340,15 @@ then
|
|||||||
cannot_find_file fill_help_tables.sql @pkgdata_locations@
|
cannot_find_file fill_help_tables.sql @pkgdata_locations@
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
# relative from where the script was run for a relocatable install
|
||||||
|
elif test -n "$dirname0" -a -x "$dirname0/@INSTALL_SBINDIR@/mysqld"
|
||||||
|
then
|
||||||
|
basedir="$dirname0"
|
||||||
|
bindir="$basedir/@INSTALL_SBINDIR@"
|
||||||
|
resolveip="$bindir/resolveip"
|
||||||
|
mysqld="$basedir/@INSTALL_SBINDIR@/mysqld"
|
||||||
|
srcpkgdatadir="$basedir/@INSTALL_MYSQLSHAREDIR@"
|
||||||
|
buildpkgdatadir="$basedir/@INSTALL_MYSQLSHAREDIR@"
|
||||||
else
|
else
|
||||||
basedir="@prefix@"
|
basedir="@prefix@"
|
||||||
bindir="@bindir@"
|
bindir="@bindir@"
|
||||||
|
@ -110,6 +110,12 @@ my_bool net_flush(NET *net);
|
|||||||
#include <my_context.h>
|
#include <my_context.h>
|
||||||
#include <mysql_async.h>
|
#include <mysql_async.h>
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
ALWAYS_ACCEPT, /* heuristics is disabled, use CLIENT_LOCAL_FILES */
|
||||||
|
WAIT_FOR_QUERY, /* heuristics is enabled, not sending files */
|
||||||
|
ACCEPT_FILE_REQUEST /* heuristics is enabled, ready to send a file */
|
||||||
|
} auto_local_infile_state;
|
||||||
|
|
||||||
#define native_password_plugin_name "mysql_native_password"
|
#define native_password_plugin_name "mysql_native_password"
|
||||||
#define old_password_plugin_name "mysql_old_password"
|
#define old_password_plugin_name "mysql_old_password"
|
||||||
|
|
||||||
@ -1633,8 +1639,10 @@ mysql_init(MYSQL *mysql)
|
|||||||
--enable-local-infile
|
--enable-local-infile
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(ENABLED_LOCAL_INFILE) && !defined(MYSQL_SERVER)
|
#if ENABLED_LOCAL_INFILE && !defined(MYSQL_SERVER)
|
||||||
mysql->options.client_flag|= CLIENT_LOCAL_FILES;
|
mysql->options.client_flag|= CLIENT_LOCAL_FILES;
|
||||||
|
mysql->auto_local_infile= ENABLED_LOCAL_INFILE == LOCAL_INFILE_MODE_AUTO
|
||||||
|
? WAIT_FOR_QUERY : ALWAYS_ACCEPT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SMEM
|
#ifdef HAVE_SMEM
|
||||||
@ -4003,8 +4011,14 @@ static my_bool cli_read_query_result(MYSQL *mysql)
|
|||||||
ulong field_count;
|
ulong field_count;
|
||||||
MYSQL_DATA *fields;
|
MYSQL_DATA *fields;
|
||||||
ulong length;
|
ulong length;
|
||||||
|
#ifdef MYSQL_CLIENT
|
||||||
|
my_bool can_local_infile= mysql->auto_local_infile != WAIT_FOR_QUERY;
|
||||||
|
#endif
|
||||||
DBUG_ENTER("cli_read_query_result");
|
DBUG_ENTER("cli_read_query_result");
|
||||||
|
|
||||||
|
if (mysql->auto_local_infile == ACCEPT_FILE_REQUEST)
|
||||||
|
mysql->auto_local_infile= WAIT_FOR_QUERY;
|
||||||
|
|
||||||
if ((length = cli_safe_read(mysql)) == packet_error)
|
if ((length = cli_safe_read(mysql)) == packet_error)
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
free_old_query(mysql); /* Free old result */
|
free_old_query(mysql); /* Free old result */
|
||||||
@ -4041,7 +4055,8 @@ get_info:
|
|||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
if (!(mysql->options.client_flag & CLIENT_LOCAL_FILES))
|
if (!(mysql->options.client_flag & CLIENT_LOCAL_FILES) ||
|
||||||
|
!can_local_infile)
|
||||||
{
|
{
|
||||||
set_mysql_error(mysql, CR_MALFORMED_PACKET, unknown_sqlstate);
|
set_mysql_error(mysql, CR_MALFORMED_PACKET, unknown_sqlstate);
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
@ -4079,6 +4094,13 @@ int STDCALL
|
|||||||
mysql_send_query(MYSQL* mysql, const char* query, ulong length)
|
mysql_send_query(MYSQL* mysql, const char* query, ulong length)
|
||||||
{
|
{
|
||||||
DBUG_ENTER("mysql_send_query");
|
DBUG_ENTER("mysql_send_query");
|
||||||
|
if (mysql->options.client_flag & CLIENT_LOCAL_FILES &&
|
||||||
|
mysql->auto_local_infile == WAIT_FOR_QUERY &&
|
||||||
|
(*query == 'l' || *query == 'L'))
|
||||||
|
{
|
||||||
|
if (strncasecmp(query, STRING_WITH_LEN("load")) == 0)
|
||||||
|
mysql->auto_local_infile= ACCEPT_FILE_REQUEST;
|
||||||
|
}
|
||||||
DBUG_RETURN(simple_command(mysql, COM_QUERY, (uchar*) query, length, 1));
|
DBUG_RETURN(simple_command(mysql, COM_QUERY, (uchar*) query, length, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4292,10 +4314,12 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
|
|||||||
mysql->options.protocol=MYSQL_PROTOCOL_PIPE; /* Force named pipe */
|
mysql->options.protocol=MYSQL_PROTOCOL_PIPE; /* Force named pipe */
|
||||||
break;
|
break;
|
||||||
case MYSQL_OPT_LOCAL_INFILE: /* Allow LOAD DATA LOCAL ?*/
|
case MYSQL_OPT_LOCAL_INFILE: /* Allow LOAD DATA LOCAL ?*/
|
||||||
if (!arg || MY_TEST(*(uint*) arg))
|
if (!arg || *(uint*) arg)
|
||||||
mysql->options.client_flag|= CLIENT_LOCAL_FILES;
|
mysql->options.client_flag|= CLIENT_LOCAL_FILES;
|
||||||
else
|
else
|
||||||
mysql->options.client_flag&= ~CLIENT_LOCAL_FILES;
|
mysql->options.client_flag&= ~CLIENT_LOCAL_FILES;
|
||||||
|
mysql->auto_local_infile= arg && *(uint*)arg == LOCAL_INFILE_MODE_AUTO
|
||||||
|
? WAIT_FOR_QUERY : ALWAYS_ACCEPT;
|
||||||
break;
|
break;
|
||||||
case MYSQL_INIT_COMMAND:
|
case MYSQL_INIT_COMMAND:
|
||||||
add_init_command(&mysql->options,arg);
|
add_init_command(&mysql->options,arg);
|
||||||
|
@ -454,7 +454,7 @@ IF(WIN32)
|
|||||||
COMPONENT Server
|
COMPONENT Server
|
||||||
)
|
)
|
||||||
SET_TARGET_PROPERTIES(mysql_install_db PROPERTIES COMPILE_FLAGS -DINSTALL_PLUGINDIR=${INSTALL_PLUGINDIR})
|
SET_TARGET_PROPERTIES(mysql_install_db PROPERTIES COMPILE_FLAGS -DINSTALL_PLUGINDIR=${INSTALL_PLUGINDIR})
|
||||||
TARGET_LINK_LIBRARIES(mysql_install_db mysys)
|
TARGET_LINK_LIBRARIES(mysql_install_db mysys shlwapi)
|
||||||
|
|
||||||
ADD_LIBRARY(winservice STATIC winservice.c)
|
ADD_LIBRARY(winservice STATIC winservice.c)
|
||||||
TARGET_LINK_LIBRARIES(winservice shell32)
|
TARGET_LINK_LIBRARIES(winservice shell32)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
|
/* Copyright (c) 2000, 2018, Oracle and/or its affiliates.
|
||||||
Copyright (c) 2009, 2017, MariaDB
|
Copyright (c) 2009, 2019, MariaDB Corporation
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -3924,7 +3924,7 @@ int MYSQL_BIN_LOG::find_log_pos(LOG_INFO *linfo, const char *log_name,
|
|||||||
// if the log entry matches, null string matching anything
|
// if the log entry matches, null string matching anything
|
||||||
if (!log_name ||
|
if (!log_name ||
|
||||||
(log_name_len == fname_len &&
|
(log_name_len == fname_len &&
|
||||||
!memcmp(full_fname, full_log_name, log_name_len)))
|
!strncmp(full_fname, full_log_name, log_name_len)))
|
||||||
{
|
{
|
||||||
DBUG_PRINT("info", ("Found log file entry"));
|
DBUG_PRINT("info", ("Found log file entry"));
|
||||||
linfo->index_file_start_offset= offset;
|
linfo->index_file_start_offset= offset;
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
#include <accctrl.h>
|
#include <accctrl.h>
|
||||||
#include <aclapi.h>
|
#include <aclapi.h>
|
||||||
|
struct IUnknown;
|
||||||
|
#include <shlwapi.h>
|
||||||
|
|
||||||
#define USAGETEXT \
|
#define USAGETEXT \
|
||||||
"mysql_install_db.exe Ver 1.00 for Windows\n" \
|
"mysql_install_db.exe Ver 1.00 for Windows\n" \
|
||||||
@ -549,20 +551,78 @@ static int create_db_instance()
|
|||||||
DWORD cwd_len= MAX_PATH;
|
DWORD cwd_len= MAX_PATH;
|
||||||
char cmdline[3*MAX_PATH];
|
char cmdline[3*MAX_PATH];
|
||||||
FILE *in;
|
FILE *in;
|
||||||
|
bool cleanup_datadir= true;
|
||||||
|
DWORD last_error;
|
||||||
|
|
||||||
verbose("Running bootstrap");
|
verbose("Running bootstrap");
|
||||||
|
|
||||||
GetCurrentDirectory(cwd_len, cwd);
|
GetCurrentDirectory(cwd_len, cwd);
|
||||||
CreateDirectory(opt_datadir, NULL); /*ignore error, it might already exist */
|
|
||||||
|
/* Create datadir and datadir/mysql, if they do not already exist. */
|
||||||
|
|
||||||
|
if (!CreateDirectory(opt_datadir, NULL) && (GetLastError() != ERROR_ALREADY_EXISTS))
|
||||||
|
{
|
||||||
|
last_error = GetLastError();
|
||||||
|
switch(last_error)
|
||||||
|
{
|
||||||
|
case ERROR_ACCESS_DENIED:
|
||||||
|
die("Can't create data directory '%s' (access denied)\n",
|
||||||
|
opt_datadir);
|
||||||
|
break;
|
||||||
|
case ERROR_PATH_NOT_FOUND:
|
||||||
|
die("Can't create data directory '%s' "
|
||||||
|
"(one or more intermediate directories do not exist)\n",
|
||||||
|
opt_datadir);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
die("Can't create data directory '%s', last error %u\n",
|
||||||
|
opt_datadir, last_error);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!SetCurrentDirectory(opt_datadir))
|
if (!SetCurrentDirectory(opt_datadir))
|
||||||
{
|
{
|
||||||
die("Cannot set current directory to '%s'\n",opt_datadir);
|
last_error = GetLastError();
|
||||||
return -1;
|
switch (last_error)
|
||||||
|
{
|
||||||
|
case ERROR_DIRECTORY:
|
||||||
|
die("Can't set current directory to '%s', the path is not a valid directory \n",
|
||||||
|
opt_datadir);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
die("Can' set current directory to '%s', last error %u\n",
|
||||||
|
opt_datadir, last_error);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateDirectory("mysql",NULL);
|
if (PathIsDirectoryEmpty(opt_datadir))
|
||||||
CreateDirectory("test", NULL);
|
{
|
||||||
|
cleanup_datadir= false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!CreateDirectory("mysql",NULL))
|
||||||
|
{
|
||||||
|
last_error = GetLastError();
|
||||||
|
DWORD attributes;
|
||||||
|
switch(last_error)
|
||||||
|
{
|
||||||
|
case ERROR_ACCESS_DENIED:
|
||||||
|
die("Can't create subdirectory 'mysql' in '%s' (access denied)\n",opt_datadir);
|
||||||
|
break;
|
||||||
|
case ERROR_ALREADY_EXISTS:
|
||||||
|
attributes = GetFileAttributes("mysql");
|
||||||
|
|
||||||
|
if (attributes == INVALID_FILE_ATTRIBUTES)
|
||||||
|
die("GetFileAttributes() failed for existing file '%s\\mysql', last error %u",
|
||||||
|
opt_datadir, GetLastError());
|
||||||
|
else if (!(attributes & FILE_ATTRIBUTE_DIRECTORY))
|
||||||
|
die("File '%s\\mysql' exists, but it is not a directory", opt_datadir);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Set data directory permissions for both current user and
|
Set data directory permissions for both current user and
|
||||||
@ -675,7 +735,7 @@ static int create_db_instance()
|
|||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (ret)
|
if (ret && cleanup_datadir)
|
||||||
{
|
{
|
||||||
SetCurrentDirectory(cwd);
|
SetCurrentDirectory(cwd);
|
||||||
clean_directory(opt_datadir);
|
clean_directory(opt_datadir);
|
||||||
|
@ -3793,6 +3793,7 @@ bool st_select_lex::optimize_unflattened_subqueries(bool const_only)
|
|||||||
inner_join->select_options|= SELECT_DESCRIBE;
|
inner_join->select_options|= SELECT_DESCRIBE;
|
||||||
}
|
}
|
||||||
res= inner_join->optimize();
|
res= inner_join->optimize();
|
||||||
|
if (!inner_join->cleaned)
|
||||||
sl->update_used_tables();
|
sl->update_used_tables();
|
||||||
sl->update_correlated_cache();
|
sl->update_correlated_cache();
|
||||||
is_correlated_unit|= sl->is_correlated;
|
is_correlated_unit|= sl->is_correlated;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Copyright (c) 2000, 2017, Oracle and/or its affiliates.
|
/* Copyright (c) 2000, 2018, Oracle and/or its affiliates.
|
||||||
Copyright (c) 2008, 2017, MariaDB Corporation
|
Copyright (c) 2008, 2019, MariaDB Corporation
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -542,7 +542,7 @@ bool log_in_use(const char* log_name)
|
|||||||
if ((linfo = tmp->current_linfo))
|
if ((linfo = tmp->current_linfo))
|
||||||
{
|
{
|
||||||
mysql_mutex_lock(&linfo->lock);
|
mysql_mutex_lock(&linfo->lock);
|
||||||
result = !memcmp(log_name, linfo->log_file_name, log_name_len);
|
result = !strncmp(log_name, linfo->log_file_name, log_name_len);
|
||||||
mysql_mutex_unlock(&linfo->lock);
|
mysql_mutex_unlock(&linfo->lock);
|
||||||
if (result)
|
if (result)
|
||||||
break;
|
break;
|
||||||
|
@ -5717,7 +5717,8 @@ static bool is_candidate_key(KEY *key)
|
|||||||
KEY_PART_INFO *key_part;
|
KEY_PART_INFO *key_part;
|
||||||
KEY_PART_INFO *key_part_end= key->key_part + key->user_defined_key_parts;
|
KEY_PART_INFO *key_part_end= key->key_part + key->user_defined_key_parts;
|
||||||
|
|
||||||
if (!(key->flags & HA_NOSAME) || (key->flags & HA_NULL_PART_KEY))
|
if (!(key->flags & HA_NOSAME) || (key->flags & HA_NULL_PART_KEY) ||
|
||||||
|
(key->flags & HA_KEY_HAS_PART_KEY_SEG))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (key_part= key->key_part; key_part < key_part_end; key_part++)
|
for (key_part= key->key_part; key_part < key_part_end; key_part++)
|
||||||
@ -6203,9 +6204,7 @@ static int compare_uint(const uint *s, const uint *t)
|
|||||||
@retval false success
|
@retval false success
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static bool fill_alter_inplace_info(THD *thd,
|
static bool fill_alter_inplace_info(THD *thd, TABLE *table, bool varchar,
|
||||||
TABLE *table,
|
|
||||||
bool varchar,
|
|
||||||
Alter_inplace_info *ha_alter_info)
|
Alter_inplace_info *ha_alter_info)
|
||||||
{
|
{
|
||||||
Field **f_ptr, *field;
|
Field **f_ptr, *field;
|
||||||
@ -6213,7 +6212,6 @@ static bool fill_alter_inplace_info(THD *thd,
|
|||||||
Create_field *new_field;
|
Create_field *new_field;
|
||||||
KEY_PART_INFO *key_part, *new_part;
|
KEY_PART_INFO *key_part, *new_part;
|
||||||
KEY_PART_INFO *end;
|
KEY_PART_INFO *end;
|
||||||
uint candidate_key_count= 0;
|
|
||||||
Alter_info *alter_info= ha_alter_info->alter_info;
|
Alter_info *alter_info= ha_alter_info->alter_info;
|
||||||
DBUG_ENTER("fill_alter_inplace_info");
|
DBUG_ENTER("fill_alter_inplace_info");
|
||||||
|
|
||||||
@ -6489,8 +6487,13 @@ static bool fill_alter_inplace_info(THD *thd,
|
|||||||
Primary key index for the new table
|
Primary key index for the new table
|
||||||
*/
|
*/
|
||||||
const KEY* const new_pk= (ha_alter_info->key_count > 0 &&
|
const KEY* const new_pk= (ha_alter_info->key_count > 0 &&
|
||||||
is_candidate_key(ha_alter_info->key_info_buffer)) ?
|
(!my_strcasecmp(system_charset_info,
|
||||||
|
ha_alter_info->key_info_buffer->name,
|
||||||
|
primary_key_name) ||
|
||||||
|
is_candidate_key(ha_alter_info->key_info_buffer))) ?
|
||||||
ha_alter_info->key_info_buffer : NULL;
|
ha_alter_info->key_info_buffer : NULL;
|
||||||
|
const KEY *const old_pk= table->s->primary_key == MAX_KEY ? NULL :
|
||||||
|
table->key_info + table->s->primary_key;
|
||||||
|
|
||||||
DBUG_PRINT("info", ("index count old: %d new: %d",
|
DBUG_PRINT("info", ("index count old: %d new: %d",
|
||||||
table->s->keys, ha_alter_info->key_count));
|
table->s->keys, ha_alter_info->key_count));
|
||||||
@ -6572,8 +6575,7 @@ static bool fill_alter_inplace_info(THD *thd,
|
|||||||
(i) Old table doesn't have primary key, new table has it and vice-versa
|
(i) Old table doesn't have primary key, new table has it and vice-versa
|
||||||
(ii) Primary key changed to another existing index
|
(ii) Primary key changed to another existing index
|
||||||
*/
|
*/
|
||||||
if ((new_key == new_pk) !=
|
if ((new_key == new_pk) != (table_key == old_pk))
|
||||||
((uint) (table_key - table->key_info) == table->s->primary_key))
|
|
||||||
goto index_changed;
|
goto index_changed;
|
||||||
|
|
||||||
/* Check that key comment is not changed. */
|
/* Check that key comment is not changed. */
|
||||||
@ -6634,22 +6636,6 @@ static bool fill_alter_inplace_info(THD *thd,
|
|||||||
|
|
||||||
/* Now let us calculate flags for storage engine API. */
|
/* Now let us calculate flags for storage engine API. */
|
||||||
|
|
||||||
/* Count all existing candidate keys. */
|
|
||||||
for (table_key= table->key_info; table_key < table_key_end; table_key++)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
Check if key is a candidate key, This key is either already primary key
|
|
||||||
or could be promoted to primary key if the original primary key is
|
|
||||||
dropped.
|
|
||||||
In MySQL one is allowed to create primary key with partial fields (i.e.
|
|
||||||
primary key which is not considered candidate). For simplicity we count
|
|
||||||
such key as a candidate key here.
|
|
||||||
*/
|
|
||||||
if (((uint) (table_key - table->key_info) == table->s->primary_key) ||
|
|
||||||
is_candidate_key(table_key))
|
|
||||||
candidate_key_count++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Figure out what kind of indexes we are dropping. */
|
/* Figure out what kind of indexes we are dropping. */
|
||||||
KEY **dropped_key;
|
KEY **dropped_key;
|
||||||
KEY **dropped_key_end= ha_alter_info->index_drop_buffer +
|
KEY **dropped_key_end= ha_alter_info->index_drop_buffer +
|
||||||
@ -6662,21 +6648,10 @@ static bool fill_alter_inplace_info(THD *thd,
|
|||||||
|
|
||||||
if (table_key->flags & HA_NOSAME)
|
if (table_key->flags & HA_NOSAME)
|
||||||
{
|
{
|
||||||
/*
|
if (table_key == old_pk)
|
||||||
Unique key. Check for PRIMARY KEY. Also see comment about primary
|
|
||||||
and candidate keys above.
|
|
||||||
*/
|
|
||||||
if ((uint) (table_key - table->key_info) == table->s->primary_key)
|
|
||||||
{
|
|
||||||
ha_alter_info->handler_flags|= Alter_inplace_info::DROP_PK_INDEX;
|
ha_alter_info->handler_flags|= Alter_inplace_info::DROP_PK_INDEX;
|
||||||
candidate_key_count--;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
ha_alter_info->handler_flags|= Alter_inplace_info::DROP_UNIQUE_INDEX;
|
ha_alter_info->handler_flags|= Alter_inplace_info::DROP_UNIQUE_INDEX;
|
||||||
if (is_candidate_key(table_key))
|
|
||||||
candidate_key_count--;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ha_alter_info->handler_flags|= Alter_inplace_info::DROP_INDEX;
|
ha_alter_info->handler_flags|= Alter_inplace_info::DROP_INDEX;
|
||||||
@ -6689,23 +6664,10 @@ static bool fill_alter_inplace_info(THD *thd,
|
|||||||
|
|
||||||
if (new_key->flags & HA_NOSAME)
|
if (new_key->flags & HA_NOSAME)
|
||||||
{
|
{
|
||||||
bool is_pk= !my_strcasecmp(system_charset_info, new_key->name, primary_key_name);
|
if (new_key == new_pk)
|
||||||
|
|
||||||
if ((!(new_key->flags & HA_KEY_HAS_PART_KEY_SEG) &&
|
|
||||||
!(new_key->flags & HA_NULL_PART_KEY)) ||
|
|
||||||
is_pk)
|
|
||||||
{
|
|
||||||
/* Candidate key or primary key! */
|
|
||||||
if (candidate_key_count == 0 || is_pk)
|
|
||||||
ha_alter_info->handler_flags|= Alter_inplace_info::ADD_PK_INDEX;
|
ha_alter_info->handler_flags|= Alter_inplace_info::ADD_PK_INDEX;
|
||||||
else
|
else
|
||||||
ha_alter_info->handler_flags|= Alter_inplace_info::ADD_UNIQUE_INDEX;
|
ha_alter_info->handler_flags|= Alter_inplace_info::ADD_UNIQUE_INDEX;
|
||||||
candidate_key_count++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ha_alter_info->handler_flags|= Alter_inplace_info::ADD_UNIQUE_INDEX;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ha_alter_info->handler_flags|= Alter_inplace_info::ADD_INDEX;
|
ha_alter_info->handler_flags|= Alter_inplace_info::ADD_INDEX;
|
||||||
@ -9984,7 +9946,10 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables,
|
|||||||
{
|
{
|
||||||
/* calculating table's checksum */
|
/* calculating table's checksum */
|
||||||
ha_checksum crc= 0;
|
ha_checksum crc= 0;
|
||||||
uchar null_mask=256 - (1 << t->s->last_null_bit_pos);
|
DBUG_ASSERT(t->s->last_null_bit_pos < 8);
|
||||||
|
uchar null_mask= (t->s->last_null_bit_pos ?
|
||||||
|
(256 - (1 << t->s->last_null_bit_pos)):
|
||||||
|
0);
|
||||||
|
|
||||||
t->use_all_columns();
|
t->use_all_columns();
|
||||||
|
|
||||||
|
@ -15699,19 +15699,21 @@ subselect_end:
|
|||||||
lex->current_select = lex->current_select->return_after_parsing();
|
lex->current_select = lex->current_select->return_after_parsing();
|
||||||
lex->nest_level--;
|
lex->nest_level--;
|
||||||
lex->current_select->n_child_sum_items += child->n_sum_items;
|
lex->current_select->n_child_sum_items += child->n_sum_items;
|
||||||
/*
|
|
||||||
A subselect can add fields to an outer select. Reserve space for
|
|
||||||
them.
|
|
||||||
*/
|
|
||||||
lex->current_select->select_n_where_fields+=
|
|
||||||
child->select_n_where_fields;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Aggregate functions in having clause may add fields to an outer
|
A subquery (and all the subsequent query blocks in a UNION) can
|
||||||
select. Count them also.
|
add columns to an outer query block. Reserve space for them.
|
||||||
|
Aggregate functions in having clause can also add fields to an
|
||||||
|
outer select.
|
||||||
*/
|
*/
|
||||||
|
for (SELECT_LEX *temp= child->master_unit()->first_select();
|
||||||
|
temp != NULL; temp= temp->next_select())
|
||||||
|
{
|
||||||
|
lex->current_select->select_n_where_fields+=
|
||||||
|
temp->select_n_where_fields;
|
||||||
lex->current_select->select_n_having_items+=
|
lex->current_select->select_n_having_items+=
|
||||||
child->select_n_having_items;
|
temp->select_n_having_items;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -219,11 +219,11 @@ DllExport LPCSTR PlugSetPath(LPSTR to, LPCSTR prefix, LPCSTR name, LPCSTR dir);
|
|||||||
DllExport BOOL PlugIsAbsolutePath(LPCSTR path);
|
DllExport BOOL PlugIsAbsolutePath(LPCSTR path);
|
||||||
DllExport bool AllocSarea(PGLOBAL, uint);
|
DllExport bool AllocSarea(PGLOBAL, uint);
|
||||||
DllExport void FreeSarea(PGLOBAL);
|
DllExport void FreeSarea(PGLOBAL);
|
||||||
DllExport BOOL PlugSubSet(PGLOBAL, void *, uint);
|
DllExport BOOL PlugSubSet(void *, uint);
|
||||||
|
DllExport void *PlugSubAlloc(PGLOBAL, void *, size_t);
|
||||||
DllExport char *PlugDup(PGLOBAL g, const char *str);
|
DllExport char *PlugDup(PGLOBAL g, const char *str);
|
||||||
DllExport void *MakePtr(void *, OFFSET);
|
DllExport void *MakePtr(void *, OFFSET);
|
||||||
DllExport void htrc(char const *fmt, ...);
|
DllExport void htrc(char const *fmt, ...);
|
||||||
//DllExport int GetTraceValue(void);
|
|
||||||
DllExport uint GetTraceValue(void);
|
DllExport uint GetTraceValue(void);
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
@ -233,6 +233,6 @@ DllExport uint GetTraceValue(void);
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Non exported routine declarations. */
|
/* Non exported routine declarations. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
void *PlugSubAlloc(PGLOBAL, void *, size_t); // Does throw
|
//void *PlugSubAlloc(PGLOBAL, void *, size_t); // Does throw
|
||||||
|
|
||||||
/*-------------------------- End of Global.H --------------------------*/
|
/*-------------------------- End of Global.H --------------------------*/
|
||||||
|
@ -4191,7 +4191,7 @@ int ha_connect::rnd_pos(uchar *buf, uchar *pos)
|
|||||||
rc= rnd_next(buf);
|
rc= rnd_next(buf);
|
||||||
} else {
|
} else {
|
||||||
PGLOBAL g = GetPlug((table) ? table->in_use : NULL, xp);
|
PGLOBAL g = GetPlug((table) ? table->in_use : NULL, xp);
|
||||||
strcpy(g->Message, "Not supported by this table type");
|
// strcpy(g->Message, "Not supported by this table type");
|
||||||
my_message(ER_ILLEGAL_HA, g->Message, MYF(0));
|
my_message(ER_ILLEGAL_HA, g->Message, MYF(0));
|
||||||
rc= HA_ERR_INTERNAL_ERROR;
|
rc= HA_ERR_INTERNAL_ERROR;
|
||||||
} // endif SetRecpos
|
} // endif SetRecpos
|
||||||
@ -7307,7 +7307,7 @@ maria_declare_plugin(connect)
|
|||||||
PLUGIN_LICENSE_GPL,
|
PLUGIN_LICENSE_GPL,
|
||||||
connect_init_func, /* Plugin Init */
|
connect_init_func, /* Plugin Init */
|
||||||
connect_done_func, /* Plugin Deinit */
|
connect_done_func, /* Plugin Deinit */
|
||||||
0x0107, /* version number (1.05) */
|
0x0106, /* version number (1.06) */
|
||||||
NULL, /* status variables */
|
NULL, /* status variables */
|
||||||
connect_system_variables, /* system variables */
|
connect_system_variables, /* system variables */
|
||||||
"1.06.0008", /* string version */
|
"1.06.0008", /* string version */
|
||||||
|
@ -3055,7 +3055,7 @@ my_bool json_array_grp_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
|
|||||||
|
|
||||||
PGLOBAL g = (PGLOBAL)initid->ptr;
|
PGLOBAL g = (PGLOBAL)initid->ptr;
|
||||||
|
|
||||||
PlugSubSet(g, g->Sarea, g->Sarea_Size);
|
PlugSubSet(g->Sarea, g->Sarea_Size);
|
||||||
g->Activityp = (PACTIVITY)JsonNew(g, TYPE_JAR);
|
g->Activityp = (PACTIVITY)JsonNew(g, TYPE_JAR);
|
||||||
g->N = (int)n;
|
g->N = (int)n;
|
||||||
return false;
|
return false;
|
||||||
@ -3098,7 +3098,7 @@ void json_array_grp_clear(UDF_INIT *initid, char*, char*)
|
|||||||
{
|
{
|
||||||
PGLOBAL g = (PGLOBAL)initid->ptr;
|
PGLOBAL g = (PGLOBAL)initid->ptr;
|
||||||
|
|
||||||
PlugSubSet(g, g->Sarea, g->Sarea_Size);
|
PlugSubSet(g->Sarea, g->Sarea_Size);
|
||||||
g->Activityp = (PACTIVITY)JsonNew(g, TYPE_JAR);
|
g->Activityp = (PACTIVITY)JsonNew(g, TYPE_JAR);
|
||||||
g->N = GetJsonGroupSize();
|
g->N = GetJsonGroupSize();
|
||||||
} // end of json_array_grp_clear
|
} // end of json_array_grp_clear
|
||||||
@ -3132,7 +3132,7 @@ my_bool json_object_grp_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
|
|||||||
|
|
||||||
PGLOBAL g = (PGLOBAL)initid->ptr;
|
PGLOBAL g = (PGLOBAL)initid->ptr;
|
||||||
|
|
||||||
PlugSubSet(g, g->Sarea, g->Sarea_Size);
|
PlugSubSet(g->Sarea, g->Sarea_Size);
|
||||||
g->Activityp = (PACTIVITY)JsonNew(g, TYPE_JOB);
|
g->Activityp = (PACTIVITY)JsonNew(g, TYPE_JOB);
|
||||||
g->N = (int)n;
|
g->N = (int)n;
|
||||||
return false;
|
return false;
|
||||||
@ -3169,7 +3169,7 @@ void json_object_grp_clear(UDF_INIT *initid, char*, char*)
|
|||||||
{
|
{
|
||||||
PGLOBAL g = (PGLOBAL)initid->ptr;
|
PGLOBAL g = (PGLOBAL)initid->ptr;
|
||||||
|
|
||||||
PlugSubSet(g, g->Sarea, g->Sarea_Size);
|
PlugSubSet(g->Sarea, g->Sarea_Size);
|
||||||
g->Activityp = (PACTIVITY)JsonNew(g, TYPE_JOB);
|
g->Activityp = (PACTIVITY)JsonNew(g, TYPE_JOB);
|
||||||
g->N = GetJsonGroupSize();
|
g->N = GetJsonGroupSize();
|
||||||
} // end of json_object_grp_clear
|
} // end of json_object_grp_clear
|
||||||
@ -4418,7 +4418,7 @@ char *json_file(UDF_INIT *initid, UDF_ARGS *args, char *result,
|
|||||||
} else if (initid->const_item)
|
} else if (initid->const_item)
|
||||||
g->N = 1;
|
g->N = 1;
|
||||||
|
|
||||||
PlugSubSet(g, g->Sarea, g->Sarea_Size);
|
PlugSubSet(g->Sarea, g->Sarea_Size);
|
||||||
fn = MakePSZ(g, args, 0);
|
fn = MakePSZ(g, args, 0);
|
||||||
|
|
||||||
if (args->arg_count > 1) {
|
if (args->arg_count > 1) {
|
||||||
@ -5662,7 +5662,7 @@ char *jbin_file(UDF_INIT *initid, UDF_ARGS *args, char *result,
|
|||||||
if (bsp && !bsp->Changed)
|
if (bsp && !bsp->Changed)
|
||||||
goto fin;
|
goto fin;
|
||||||
|
|
||||||
PlugSubSet(g, g->Sarea, g->Sarea_Size);
|
PlugSubSet(g->Sarea, g->Sarea_Size);
|
||||||
g->Xchk = NULL;
|
g->Xchk = NULL;
|
||||||
fn = MakePSZ(g, args, 0);
|
fn = MakePSZ(g, args, 0);
|
||||||
pretty = (args->arg_count > 2 && args->args[2]) ? (int)*(longlong*)args->args[2] : 3;
|
pretty = (args->arg_count > 2 && args->args[2]) ? (int)*(longlong*)args->args[2] : 3;
|
||||||
|
@ -8,12 +8,19 @@ SELECT * FROM t2 WHERE command = 'drop table employee';
|
|||||||
command number message
|
command number message
|
||||||
drop table employee 0 Execute: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
|
drop table employee 0 Execute: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
|
||||||
|
|
||||||
|
Warnings:
|
||||||
|
Warning 1105 Execute: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
|
||||||
|
|
||||||
SELECT * FROM t2 WHERE command = 'create table employee (id int not null, name varchar(32), title char(16), salary number(8,2))';
|
SELECT * FROM t2 WHERE command = 'create table employee (id int not null, name varchar(32), title char(16), salary number(8,2))';
|
||||||
command number message
|
command number message
|
||||||
create table employee (id int not null, name varchar(32), title char(16), salary number(8,2)) 0 Affected rows
|
create table employee (id int not null, name varchar(32), title char(16), salary number(8,2)) 0 Affected rows
|
||||||
|
Warnings:
|
||||||
|
Warning 1105 Affected rows
|
||||||
SELECT * FROM t2 WHERE command = "insert into employee values(4567,'Johnson', 'Engineer', 12560.50)";
|
SELECT * FROM t2 WHERE command = "insert into employee values(4567,'Johnson', 'Engineer', 12560.50)";
|
||||||
command number message
|
command number message
|
||||||
insert into employee values(4567,'Johnson', 'Engineer', 12560.50) 1 Affected rows
|
insert into employee values(4567,'Johnson', 'Engineer', 12560.50) 1 Affected rows
|
||||||
|
Warnings:
|
||||||
|
Warning 1105 Affected rows
|
||||||
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables
|
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables
|
||||||
CONNECTION='jdbc:oracle:thin:@localhost:1521:xe'
|
CONNECTION='jdbc:oracle:thin:@localhost:1521:xe'
|
||||||
OPTION_LIST='User=system,Password=manager';
|
OPTION_LIST='User=system,Password=manager';
|
||||||
@ -27,8 +34,8 @@ OPTION_LIST='User=system,Password=manager';
|
|||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
|
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
|
||||||
NULL SYSTEM EMPLOYEE ID 3 NUMBER 38 0 0 10 0 NULL
|
NULL SYSTEM EMPLOYEE ID 3 NUMBER 38 0 0 10 0 NULL
|
||||||
NULL SYSTEM EMPLOYEE NAME 12 VARCHAR2 32 0 0 10 1 NULL
|
NULL SYSTEM EMPLOYEE NAME 12 VARCHAR2 32 0 NULL 10 1 NULL
|
||||||
NULL SYSTEM EMPLOYEE TITLE 1 CHAR 16 0 0 10 1 NULL
|
NULL SYSTEM EMPLOYEE TITLE 1 CHAR 16 0 NULL 10 1 NULL
|
||||||
NULL SYSTEM EMPLOYEE SALARY 3 NUMBER 8 0 2 10 1 NULL
|
NULL SYSTEM EMPLOYEE SALARY 3 NUMBER 8 0 2 10 1 NULL
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE SERVER 'oracle' FOREIGN DATA WRAPPER 'oracle.jdbc.driver.OracleDriver' OPTIONS (
|
CREATE SERVER 'oracle' FOREIGN DATA WRAPPER 'oracle.jdbc.driver.OracleDriver' OPTIONS (
|
||||||
@ -52,7 +59,7 @@ Note 1105 EMPLOYEE: 1 affected rows
|
|||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
ID NAME TITLE SALARY
|
ID NAME TITLE SALARY
|
||||||
4567 Trump Engineer 12560.50
|
4567 Trump Engineer 12560.50
|
||||||
6214 Clinton Retired 0.00
|
6214 Clinton Retired NULL
|
||||||
DELETE FROM t1 WHERE id = 6214;
|
DELETE FROM t1 WHERE id = 6214;
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1105 EMPLOYEE: 1 affected rows
|
Note 1105 EMPLOYEE: 1 affected rows
|
||||||
@ -63,8 +70,7 @@ DROP TABLE t1;
|
|||||||
SELECT * FROM t2 WHERE command = 'drop table employee';
|
SELECT * FROM t2 WHERE command = 'drop table employee';
|
||||||
command number message
|
command number message
|
||||||
drop table employee 0 Affected rows
|
drop table employee 0 Affected rows
|
||||||
|
Warnings:
|
||||||
|
Warning 1105 Affected rows
|
||||||
DROP TABLE t2;
|
DROP TABLE t2;
|
||||||
DROP SERVER 'oracle';
|
DROP SERVER 'oracle';
|
||||||
SET GLOBAL connect_jvm_path=NULL;
|
|
||||||
SET GLOBAL connect_class_path=NULL;
|
|
||||||
SET GLOBAL time_zone = SYSTEM;
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
SET GLOBAL connect_class_path='C:/MariaDB-10.2/MariaDB/storage/connect/mysql-test/connect/std_data/JavaWrappers.jar;C:/Jconnectors/postgresql-42.2.1.jar';
|
SET GLOBAL connect_class_path='C:/MariaDB-10.0/MariaDB/storage/connect/mysql-test/connect/std_data/JavaWrappers.jar;C:/Jconnectors/postgresql-42.2.1.jar';
|
||||||
CREATE TABLE t2 (
|
CREATE TABLE t2 (
|
||||||
command varchar(128) not null,
|
command varchar(128) not null,
|
||||||
number int(5) not null flag=1,
|
number int(5) not null flag=1,
|
||||||
@ -9,12 +9,18 @@ OPTION_LIST='Execsrc=1';
|
|||||||
SELECT * FROM t2 WHERE command='drop table employee';
|
SELECT * FROM t2 WHERE command='drop table employee';
|
||||||
command number message
|
command number message
|
||||||
drop table employee 0 Execute: org.postgresql.util.PSQLException: ERREUR: la table « employee » n'existe pas
|
drop table employee 0 Execute: org.postgresql.util.PSQLException: ERREUR: la table « employee » n'existe pas
|
||||||
|
Warnings:
|
||||||
|
Warning 1105 Execute: org.postgresql.util.PSQLException: ERREUR: la table « employee » n'existe pas
|
||||||
SELECT * FROM t2 WHERE command = 'create table employee (id int not null, name varchar(32), title char(16), salary decimal(8,2))';
|
SELECT * FROM t2 WHERE command = 'create table employee (id int not null, name varchar(32), title char(16), salary decimal(8,2))';
|
||||||
command number message
|
command number message
|
||||||
create table employee (id int not null, name varchar(32), title char(16), salary decimal(8,2)) 0 Affected rows
|
create table employee (id int not null, name varchar(32), title char(16), salary decimal(8,2)) 0 Affected rows
|
||||||
|
Warnings:
|
||||||
|
Warning 1105 Affected rows
|
||||||
SELECT * FROM t2 WHERE command = "insert into employee values(4567,'Johnson', 'Engineer', 12560.50)";
|
SELECT * FROM t2 WHERE command = "insert into employee values(4567,'Johnson', 'Engineer', 12560.50)";
|
||||||
command number message
|
command number message
|
||||||
insert into employee values(4567,'Johnson', 'Engineer', 12560.50) 1 Affected rows
|
insert into employee values(4567,'Johnson', 'Engineer', 12560.50) 1 Affected rows
|
||||||
|
Warnings:
|
||||||
|
Warning 1105 Affected rows
|
||||||
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables
|
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables
|
||||||
CONNECTION='jdbc:postgresql://localhost/test?user=postgres&password=tinono'
|
CONNECTION='jdbc:postgresql://localhost/test?user=postgres&password=tinono'
|
||||||
OPTION_LIST='Tabtype=TABLE,Maxres=10';
|
OPTION_LIST='Tabtype=TABLE,Maxres=10';
|
||||||
@ -63,4 +69,6 @@ DROP SERVER 'postgresql';
|
|||||||
SELECT * FROM t2 WHERE command='drop table employee';
|
SELECT * FROM t2 WHERE command='drop table employee';
|
||||||
command number message
|
command number message
|
||||||
drop table employee 0 Affected rows
|
drop table employee 0 Affected rows
|
||||||
|
Warnings:
|
||||||
|
Warning 1105 Affected rows
|
||||||
DROP TABLE t2;
|
DROP TABLE t2;
|
||||||
|
@ -23,7 +23,7 @@ id msg
|
|||||||
CREATE TABLE xt3 (
|
CREATE TABLE xt3 (
|
||||||
id INT KEY NOT NULL,
|
id INT KEY NOT NULL,
|
||||||
msg VARCHAR(32))
|
msg VARCHAR(32))
|
||||||
ENGINE=CONNECT TABLE_TYPE=CSV AVG_ROW_LENGTH=10;
|
ENGINE=CONNECT TABLE_TYPE=CSV AVG_ROW_LENGTH=6;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1105 No file name. Table will use xt3.csv
|
Warning 1105 No file name. Table will use xt3.csv
|
||||||
INSERT INTO xt3 VALUES(60,'sixty'),(81,'eighty one'),(72,'seventy two');
|
INSERT INTO xt3 VALUES(60,'sixty'),(81,'eighty one'),(72,'seventy two');
|
||||||
@ -92,7 +92,7 @@ id msg
|
|||||||
EXPLAIN PARTITIONS
|
EXPLAIN PARTITIONS
|
||||||
SELECT * FROM t1 WHERE id = 81;
|
SELECT * FROM t1 WHERE id = 81;
|
||||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 3 ALL NULL NULL NULL NULL 4 Using where
|
1 SIMPLE t1 3 ALL NULL NULL NULL NULL 6 Using where
|
||||||
DELETE FROM t1;
|
DELETE FROM t1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1105 xt1: 4 affected rows
|
Note 1105 xt1: 4 affected rows
|
||||||
|
@ -22,7 +22,7 @@ SELECT * FROM xt2;
|
|||||||
CREATE TABLE xt3 (
|
CREATE TABLE xt3 (
|
||||||
id INT KEY NOT NULL,
|
id INT KEY NOT NULL,
|
||||||
msg VARCHAR(32))
|
msg VARCHAR(32))
|
||||||
ENGINE=CONNECT TABLE_TYPE=CSV AVG_ROW_LENGTH=10;
|
ENGINE=CONNECT TABLE_TYPE=CSV AVG_ROW_LENGTH=6;
|
||||||
INSERT INTO xt3 VALUES(60,'sixty'),(81,'eighty one'),(72,'seventy two');
|
INSERT INTO xt3 VALUES(60,'sixty'),(81,'eighty one'),(72,'seventy two');
|
||||||
SELECT * FROM xt3;
|
SELECT * FROM xt3;
|
||||||
|
|
||||||
|
@ -514,23 +514,27 @@ void FreeSarea(PGLOBAL g)
|
|||||||
/* Here there should be some verification done such as validity of */
|
/* Here there should be some verification done such as validity of */
|
||||||
/* the address and size not larger than memory size. */
|
/* the address and size not larger than memory size. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
BOOL PlugSubSet(PGLOBAL g __attribute__((unused)), void *memp, uint size)
|
BOOL PlugSubSet(void *memp, uint size)
|
||||||
{
|
{
|
||||||
PPOOLHEADER pph = (PPOOLHEADER)memp;
|
PPOOLHEADER pph = (PPOOLHEADER)memp;
|
||||||
|
|
||||||
pph->To_Free = (OFFSET)sizeof(POOLHEADER);
|
pph->To_Free = (OFFSET)sizeof(POOLHEADER);
|
||||||
pph->FreeBlk = size - pph->To_Free;
|
pph->FreeBlk = size - pph->To_Free;
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} /* end of PlugSubSet */
|
} /* end of PlugSubSet */
|
||||||
|
|
||||||
|
/***********************************************************************/
|
||||||
|
/* Use it to export a function that do throwing. */
|
||||||
|
/***********************************************************************/
|
||||||
|
void *DoThrow(int n)
|
||||||
|
{
|
||||||
|
throw n;
|
||||||
|
} /* end of DoThrow */
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Program for sub-allocating one item in a storage area. */
|
/* Program for sub-allocating one item in a storage area. */
|
||||||
/* Note: SubAlloc routines of OS/2 are no more used to increase the */
|
/* The simple way things are done here is based on the fact */
|
||||||
/* code portability and avoid problems when a grammar compiled under */
|
/* that no freeing of suballocated blocks is permitted in CONNECT. */
|
||||||
/* one version of OS/2 is used under another version. */
|
|
||||||
/* The simple way things are done here is also based on the fact */
|
|
||||||
/* that no freeing of suballocated blocks is permitted in Plug. */
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
void *PlugSubAlloc(PGLOBAL g, void *memp, size_t size)
|
void *PlugSubAlloc(PGLOBAL g, void *memp, size_t size)
|
||||||
{
|
{
|
||||||
@ -559,7 +563,7 @@ void *PlugSubAlloc(PGLOBAL g, void *memp, size_t size)
|
|||||||
if (trace(1))
|
if (trace(1))
|
||||||
htrc("PlugSubAlloc: %s\n", g->Message);
|
htrc("PlugSubAlloc: %s\n", g->Message);
|
||||||
|
|
||||||
throw 1234;
|
DoThrow(1234);
|
||||||
} /* endif size OS32 code */
|
} /* endif size OS32 code */
|
||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
|
@ -522,7 +522,14 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g)
|
|||||||
|
|
||||||
// Get the function returning an instance of the external DEF class
|
// Get the function returning an instance of the external DEF class
|
||||||
if (!(getdef = (XGETDEF)GetProcAddress((HINSTANCE)Hdll, getname))) {
|
if (!(getdef = (XGETDEF)GetProcAddress((HINSTANCE)Hdll, getname))) {
|
||||||
sprintf(g->Message, MSG(PROCADD_ERROR), GetLastError(), getname);
|
char buf[256];
|
||||||
|
DWORD rc = GetLastError();
|
||||||
|
|
||||||
|
sprintf(g->Message, MSG(PROCADD_ERROR), rc, getname);
|
||||||
|
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
|
||||||
|
FORMAT_MESSAGE_IGNORE_INSERTS, NULL, rc, 0,
|
||||||
|
(LPTSTR)buf, sizeof(buf), NULL);
|
||||||
|
strcat(strcat(g->Message, ": "), buf);
|
||||||
FreeLibrary((HMODULE)Hdll);
|
FreeLibrary((HMODULE)Hdll);
|
||||||
return NULL;
|
return NULL;
|
||||||
} // endif getdef
|
} // endif getdef
|
||||||
|
@ -13,7 +13,7 @@ typedef class TDBFMT *PTDBFMT;
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Functions used externally. */
|
/* Functions used externally. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
PQRYRES CSVColumns(PGLOBAL g, PCSZ dp, PTOS topt, bool info);
|
DllExport PQRYRES CSVColumns(PGLOBAL g, PCSZ dp, PTOS topt, bool info);
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* CSV table. */
|
/* CSV table. */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/************* tabjson C++ Program Source Code File (.CPP) *************/
|
/************* tabjson C++ Program Source Code File (.CPP) *************/
|
||||||
/* PROGRAM NAME: tabjson Version 1.5 */
|
/* PROGRAM NAME: tabjson Version 1.6 */
|
||||||
/* (C) Copyright to the author Olivier BERTRAND 2014 - 2017 */
|
/* (C) Copyright to the author Olivier BERTRAND 2014 - 2018 */
|
||||||
/* This program are the JSON class DB execution routines. */
|
/* This program are the JSON class DB execution routines. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
|
||||||
@ -173,6 +173,7 @@ JSONDISC::JSONDISC(PGLOBAL g, uint *lg)
|
|||||||
|
|
||||||
int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
|
int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
|
||||||
{
|
{
|
||||||
|
char filename[_MAX_PATH];
|
||||||
bool mgo = (GetTypeID(topt->type) == TAB_MONGO);
|
bool mgo = (GetTypeID(topt->type) == TAB_MONGO);
|
||||||
PCSZ level = GetStringTableOption(g, topt, "Level", NULL);
|
PCSZ level = GetStringTableOption(g, topt, "Level", NULL);
|
||||||
|
|
||||||
@ -209,6 +210,12 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
|
|||||||
return 0;
|
return 0;
|
||||||
} // endif Fn
|
} // endif Fn
|
||||||
|
|
||||||
|
if (tdp->Fn) {
|
||||||
|
// We used the file name relative to recorded datapath
|
||||||
|
PlugSetPath(filename, tdp->Fn, tdp->GetPath());
|
||||||
|
tdp->Fn = PlugDup(g, filename);
|
||||||
|
} // endif Fn
|
||||||
|
|
||||||
if (trace(1))
|
if (trace(1))
|
||||||
htrc("File %s objname=%s pretty=%d lvl=%d\n",
|
htrc("File %s objname=%s pretty=%d lvl=%d\n",
|
||||||
tdp->Fn, tdp->Objname, tdp->Pretty, lvl);
|
tdp->Fn, tdp->Objname, tdp->Pretty, lvl);
|
||||||
@ -299,7 +306,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
|
|||||||
memset(G, 0, sizeof(GLOBAL));
|
memset(G, 0, sizeof(GLOBAL));
|
||||||
G->Sarea_Size = tdp->Lrecl * 10;
|
G->Sarea_Size = tdp->Lrecl * 10;
|
||||||
G->Sarea = PlugSubAlloc(g, NULL, G->Sarea_Size);
|
G->Sarea = PlugSubAlloc(g, NULL, G->Sarea_Size);
|
||||||
PlugSubSet(G, G->Sarea, G->Sarea_Size);
|
PlugSubSet(G->Sarea, G->Sarea_Size);
|
||||||
G->jump_level = 0;
|
G->jump_level = 0;
|
||||||
tjnp->SetG(G);
|
tjnp->SetG(G);
|
||||||
|
|
||||||
@ -342,7 +349,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
|
|||||||
strncpy(colname, jpp->GetKey(), 64);
|
strncpy(colname, jpp->GetKey(), 64);
|
||||||
fmt[bf] = 0;
|
fmt[bf] = 0;
|
||||||
|
|
||||||
if (Find(g, jpp->GetVal(), MY_MIN(lvl, 0)))
|
if (Find(g, jpp->GetVal(), colname, MY_MIN(lvl, 0)))
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
} // endfor jpp
|
} // endfor jpp
|
||||||
@ -385,7 +392,7 @@ err:
|
|||||||
return 0;
|
return 0;
|
||||||
} // end of GetColumns
|
} // end of GetColumns
|
||||||
|
|
||||||
bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, int j)
|
bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, PCSZ key, int j)
|
||||||
{
|
{
|
||||||
char *p, *pc = colname + strlen(colname);
|
char *p, *pc = colname + strlen(colname);
|
||||||
int ars;
|
int ars;
|
||||||
@ -413,12 +420,14 @@ bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, int j)
|
|||||||
job = (PJOB)jsp;
|
job = (PJOB)jsp;
|
||||||
|
|
||||||
for (PJPR jrp = job->GetFirst(); jrp; jrp = jrp->GetNext()) {
|
for (PJPR jrp = job->GetFirst(); jrp; jrp = jrp->GetNext()) {
|
||||||
if (*jrp->GetKey() != '$') {
|
PCSZ k = jrp->GetKey();
|
||||||
strncat(strncat(fmt, sep, 128), jrp->GetKey(), 128);
|
|
||||||
strncat(strncat(colname, "_", 64), jrp->GetKey(), 64);
|
if (*k != '$') {
|
||||||
|
strncat(strncat(fmt, sep, 128), k, 128);
|
||||||
|
strncat(strncat(colname, "_", 64), k, 64);
|
||||||
} // endif Key
|
} // endif Key
|
||||||
|
|
||||||
if (Find(g, jrp->GetVal(), j + 1))
|
if (Find(g, jrp->GetVal(), k, j + 1))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
*p = *pc = 0;
|
*p = *pc = 0;
|
||||||
@ -428,13 +437,13 @@ bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, int j)
|
|||||||
case TYPE_JAR:
|
case TYPE_JAR:
|
||||||
jar = (PJAR)jsp;
|
jar = (PJAR)jsp;
|
||||||
|
|
||||||
if (all || (tdp->Xcol && !stricmp(tdp->Xcol, colname)))
|
if (all || (tdp->Xcol && !stricmp(tdp->Xcol, key)))
|
||||||
ars = jar->GetSize(false);
|
ars = jar->GetSize(false);
|
||||||
else
|
else
|
||||||
ars = MY_MIN(jar->GetSize(false), 1);
|
ars = MY_MIN(jar->GetSize(false), 1);
|
||||||
|
|
||||||
for (int k = 0; k < ars; k++) {
|
for (int k = 0; k < ars; k++) {
|
||||||
if (!tdp->Xcol || stricmp(tdp->Xcol, colname)) {
|
if (!tdp->Xcol || stricmp(tdp->Xcol, key)) {
|
||||||
sprintf(buf, "%d", k);
|
sprintf(buf, "%d", k);
|
||||||
|
|
||||||
if (tdp->Uri)
|
if (tdp->Uri)
|
||||||
@ -448,7 +457,7 @@ bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, int j)
|
|||||||
} else
|
} else
|
||||||
strncat(fmt, (tdp->Uri ? sep : "[*]"), 128);
|
strncat(fmt, (tdp->Uri ? sep : "[*]"), 128);
|
||||||
|
|
||||||
if (Find(g, jar->GetValue(k), j))
|
if (Find(g, jar->GetValue(k), "", j))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
*p = *pc = 0;
|
*p = *pc = 0;
|
||||||
@ -522,7 +531,9 @@ void JSONDISC::AddColumn(PGLOBAL g)
|
|||||||
n++;
|
n++;
|
||||||
} // endif jcp
|
} // endif jcp
|
||||||
|
|
||||||
|
if (jcp)
|
||||||
pjcp = jcp;
|
pjcp = jcp;
|
||||||
|
|
||||||
} // end of AddColumn
|
} // end of AddColumn
|
||||||
|
|
||||||
|
|
||||||
@ -549,7 +560,7 @@ JSONDEF::JSONDEF(void)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* DefineAM: define specific AM block values. */
|
/* DefineAM: define specific AM block values. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool JSONDEF::DefineAM(PGLOBAL g, LPCSTR, int poff)
|
bool JSONDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
|
||||||
{
|
{
|
||||||
Schema = GetStringCatInfo(g, "DBname", Schema);
|
Schema = GetStringCatInfo(g, "DBname", Schema);
|
||||||
Jmode = (JMODE)GetIntCatInfo("Jmode", MODE_OBJECT);
|
Jmode = (JMODE)GetIntCatInfo("Jmode", MODE_OBJECT);
|
||||||
@ -561,7 +572,8 @@ bool JSONDEF::DefineAM(PGLOBAL g, LPCSTR, int poff)
|
|||||||
Sep = *GetStringCatInfo(g, "Separator", ".");
|
Sep = *GetStringCatInfo(g, "Separator", ".");
|
||||||
Accept = GetBoolCatInfo("Accept", false);
|
Accept = GetBoolCatInfo("Accept", false);
|
||||||
|
|
||||||
if (Uri = GetStringCatInfo(g, "Connect", NULL)) {
|
// Don't use url as uri when called from REST OEM module
|
||||||
|
if (stricmp(am, "REST") && (Uri = GetStringCatInfo(g, "Connect", NULL))) {
|
||||||
#if defined(JAVA_SUPPORT) || defined(CMGO_SUPPORT)
|
#if defined(JAVA_SUPPORT) || defined(CMGO_SUPPORT)
|
||||||
Collname = GetStringCatInfo(g, "Name",
|
Collname = GetStringCatInfo(g, "Name",
|
||||||
(Catfunc & (FNC_TABLE | FNC_COL)) ? NULL : Name);
|
(Catfunc & (FNC_TABLE | FNC_COL)) ? NULL : Name);
|
||||||
@ -670,7 +682,7 @@ PTDB JSONDEF::GetTable(PGLOBAL g, MODE m)
|
|||||||
memset(G, 0, sizeof(GLOBAL));
|
memset(G, 0, sizeof(GLOBAL));
|
||||||
G->Sarea_Size = Lrecl * 10;
|
G->Sarea_Size = Lrecl * 10;
|
||||||
G->Sarea = PlugSubAlloc(g, NULL, G->Sarea_Size);
|
G->Sarea = PlugSubAlloc(g, NULL, G->Sarea_Size);
|
||||||
PlugSubSet(G, G->Sarea, G->Sarea_Size);
|
PlugSubSet(G->Sarea, G->Sarea_Size);
|
||||||
G->jump_level = 0;
|
G->jump_level = 0;
|
||||||
((TDBJSN*)tdbp)->G = G;
|
((TDBJSN*)tdbp)->G = G;
|
||||||
} else {
|
} else {
|
||||||
@ -963,7 +975,7 @@ int TDBJSN::ReadDB(PGLOBAL g)
|
|||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
// Recover the memory used for parsing
|
// Recover the memory used for parsing
|
||||||
PlugSubSet(G, G->Sarea, G->Sarea_Size);
|
PlugSubSet(G->Sarea, G->Sarea_Size);
|
||||||
|
|
||||||
if ((Row = ParseJson(G, To_Line, strlen(To_Line), &Pretty, &Comma))) {
|
if ((Row = ParseJson(G, To_Line, strlen(To_Line), &Pretty, &Comma))) {
|
||||||
Row = FindRow(g);
|
Row = FindRow(g);
|
||||||
@ -1079,13 +1091,13 @@ int TDBJSN::MakeTopTree(PGLOBAL g, PJSON jsp)
|
|||||||
} // end of PrepareWriting
|
} // end of PrepareWriting
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* WriteDB: Data Base write routine for DOS access method. */
|
/* WriteDB: Data Base write routine for JSON access method. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
int TDBJSN::WriteDB(PGLOBAL g)
|
int TDBJSN::WriteDB(PGLOBAL g)
|
||||||
{
|
{
|
||||||
int rc = TDBDOS::WriteDB(g);
|
int rc = TDBDOS::WriteDB(g);
|
||||||
|
|
||||||
PlugSubSet(G, G->Sarea, G->Sarea_Size);
|
PlugSubSet(G->Sarea, G->Sarea_Size);
|
||||||
Row->Clear();
|
Row->Clear();
|
||||||
return rc;
|
return rc;
|
||||||
} // end of WriteDB
|
} // end of WriteDB
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
/*************** tabjson H Declares Source Code File (.H) **************/
|
/*************** tabjson H Declares Source Code File (.H) **************/
|
||||||
/* Name: tabjson.h Version 1.3 */
|
/* Name: tabjson.h Version 1.3 */
|
||||||
/* */
|
/* */
|
||||||
/* (C) Copyright to the author Olivier BERTRAND 2014 - 2017 */
|
/* (C) Copyright to the author Olivier BERTRAND 2014 - 2018 */
|
||||||
/* */
|
/* */
|
||||||
/* This file contains the JSON classes declares. */
|
/* This file contains the JSON classes declares. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
#include "osutil.h"
|
//#include "osutil.h" // Unuseful and bad for OEM
|
||||||
#include "block.h"
|
#include "block.h"
|
||||||
#include "colblk.h"
|
#include "colblk.h"
|
||||||
#include "json.h"
|
#include "json.h"
|
||||||
@ -16,7 +16,7 @@ typedef class JSONDEF *PJDEF;
|
|||||||
typedef class TDBJSON *PJTDB;
|
typedef class TDBJSON *PJTDB;
|
||||||
typedef class JSONCOL *PJCOL;
|
typedef class JSONCOL *PJCOL;
|
||||||
class TDBJSN;
|
class TDBJSN;
|
||||||
PQRYRES JSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info);
|
DllExport PQRYRES JSONColumns(PGLOBAL, PCSZ, PCSZ, PTOS, bool);
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* The JSON tree node. Can be an Object or an Array. */
|
/* The JSON tree node. Can be an Object or an Array. */
|
||||||
@ -52,7 +52,7 @@ public:
|
|||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
int GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt);
|
int GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt);
|
||||||
bool Find(PGLOBAL g, PJVAL jvp, int j);
|
bool Find(PGLOBAL g, PJVAL jvp, PCSZ key, int j);
|
||||||
void AddColumn(PGLOBAL g);
|
void AddColumn(PGLOBAL g);
|
||||||
|
|
||||||
// Members
|
// Members
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/* COPYRIGHT: */
|
/* COPYRIGHT: */
|
||||||
/* ---------- */
|
/* ---------- */
|
||||||
/* (C) Copyright to the author Olivier BERTRAND 2000-2017 */
|
/* (C) Copyright to the author Olivier BERTRAND 2000-2018 */
|
||||||
/* */
|
/* */
|
||||||
/* WHAT THIS PROGRAM DOES: */
|
/* WHAT THIS PROGRAM DOES: */
|
||||||
/* ----------------------- */
|
/* ----------------------- */
|
||||||
@ -593,7 +593,7 @@ bool TDBODBC::OpenDB(PGLOBAL g)
|
|||||||
Use = USE_OPEN; // Do it now in case we are recursively called
|
Use = USE_OPEN; // Do it now in case we are recursively called
|
||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
/* Make the command and allocate whatever is used for getting results. */
|
/* Make the command and allocate whatever is used for getting results*/
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
if (Mode == MODE_READ || Mode == MODE_READX) {
|
if (Mode == MODE_READ || Mode == MODE_READX) {
|
||||||
if (Memory > 1 && !Srcdef) {
|
if (Memory > 1 && !Srcdef) {
|
||||||
@ -696,7 +696,8 @@ bool TDBODBC::SetRecpos(PGLOBAL g, int recpos)
|
|||||||
} // endif recpos
|
} // endif recpos
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
strcpy(g->Message, "This action requires a scrollable cursor");
|
strcpy(g->Message,
|
||||||
|
"This action requires Memory setting or a scrollable cursor");
|
||||||
return true;
|
return true;
|
||||||
} // endif's
|
} // endif's
|
||||||
|
|
||||||
@ -1283,7 +1284,7 @@ int TDBXDBC::ReadDB(PGLOBAL g)
|
|||||||
} // end of ReadDB
|
} // end of ReadDB
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Data Base delete line routine for ODBC access method. */
|
/* Data Base write line routine for XDBC access method. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
int TDBXDBC::WriteDB(PGLOBAL g)
|
int TDBXDBC::WriteDB(PGLOBAL g)
|
||||||
{
|
{
|
||||||
@ -1292,7 +1293,7 @@ int TDBXDBC::WriteDB(PGLOBAL g)
|
|||||||
} // end of DeleteDB
|
} // end of DeleteDB
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Data Base delete line routine for ODBC access method. */
|
/* Data Base delete line routine for XDBC access method. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
int TDBXDBC::DeleteDB(PGLOBAL g, int irc)
|
int TDBXDBC::DeleteDB(PGLOBAL g, int irc)
|
||||||
{
|
{
|
||||||
|
@ -163,8 +163,11 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
tdp->Tabname = tab;
|
tdp->Tabname = tab;
|
||||||
|
tdp->Tabname = (char*)GetStringTableOption(g, topt, "Tabname", tab);
|
||||||
|
tdp->Rowname = (char*)GetStringTableOption(g, topt, "Rownode", NULL);
|
||||||
tdp->Zipped = GetBooleanTableOption(g, topt, "Zipped", false);
|
tdp->Zipped = GetBooleanTableOption(g, topt, "Zipped", false);
|
||||||
tdp->Entry = GetStringTableOption(g, topt, "Entry", NULL);
|
tdp->Entry = GetStringTableOption(g, topt, "Entry", NULL);
|
||||||
|
tdp->Skip = GetBooleanTableOption(g, topt, "Skipnull", false);
|
||||||
|
|
||||||
if (!(op = GetStringTableOption(g, topt, "Xmlsup", NULL)))
|
if (!(op = GetStringTableOption(g, topt, "Xmlsup", NULL)))
|
||||||
#if defined(__WIN__)
|
#if defined(__WIN__)
|
||||||
@ -280,7 +283,9 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
|
|||||||
if (!vp->atp)
|
if (!vp->atp)
|
||||||
node = vp->nl->GetItem(g, vp->k++, tdp->Usedom ? node : NULL);
|
node = vp->nl->GetItem(g, vp->k++, tdp->Usedom ? node : NULL);
|
||||||
|
|
||||||
|
if (!j)
|
||||||
strncat(fmt, colname, XLEN(fmt));
|
strncat(fmt, colname, XLEN(fmt));
|
||||||
|
|
||||||
strncat(fmt, "/", XLEN(fmt));
|
strncat(fmt, "/", XLEN(fmt));
|
||||||
strncat(xcol->Name, "_", XLEN(xcol->Name));
|
strncat(xcol->Name, "_", XLEN(xcol->Name));
|
||||||
j++;
|
j++;
|
||||||
@ -302,6 +307,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
|
|||||||
case RC_INFO:
|
case RC_INFO:
|
||||||
PushWarning(g, txmp);
|
PushWarning(g, txmp);
|
||||||
case RC_OK:
|
case RC_OK:
|
||||||
|
xcol->Cbn = !strlen(buf);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
goto err;
|
goto err;
|
||||||
@ -327,9 +333,9 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
|
|||||||
|
|
||||||
xcp->Len = MY_MAX(xcp->Len, xcol->Len);
|
xcp->Len = MY_MAX(xcp->Len, xcol->Len);
|
||||||
xcp->Scale = MY_MAX(xcp->Scale, xcol->Scale);
|
xcp->Scale = MY_MAX(xcp->Scale, xcol->Scale);
|
||||||
xcp->Cbn |= xcol->Cbn;
|
xcp->Cbn |= (xcol->Cbn || !xcol->Len);
|
||||||
xcp->Found = true;
|
xcp->Found = true;
|
||||||
} else {
|
} else if(xcol->Len || !tdp->Skip) {
|
||||||
// New column
|
// New column
|
||||||
xcp = new(g) XMCOL(g, xcol, fmt, i);
|
xcp = new(g) XMCOL(g, xcol, fmt, i);
|
||||||
length[0] = MY_MAX(length[0], strlen(xcol->Name));
|
length[0] = MY_MAX(length[0], strlen(xcol->Name));
|
||||||
@ -344,6 +350,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
|
|||||||
n++;
|
n++;
|
||||||
} // endif xcp
|
} // endif xcp
|
||||||
|
|
||||||
|
if (xcp)
|
||||||
pxcp = xcp;
|
pxcp = xcp;
|
||||||
|
|
||||||
if (vp->atp)
|
if (vp->atp)
|
||||||
@ -445,6 +452,7 @@ XMLDEF::XMLDEF(void)
|
|||||||
Usedom = false;
|
Usedom = false;
|
||||||
Zipped = false;
|
Zipped = false;
|
||||||
Mulentries = false;
|
Mulentries = false;
|
||||||
|
Skip = false;
|
||||||
} // end of XMLDEF constructor
|
} // end of XMLDEF constructor
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
@ -681,6 +689,14 @@ PTDB TDBXML::Clone(PTABS t)
|
|||||||
return tp;
|
return tp;
|
||||||
} // end of Clone
|
} // end of Clone
|
||||||
|
|
||||||
|
/***********************************************************************/
|
||||||
|
/* Must not be in tabxml.h because of OEM tables */
|
||||||
|
/***********************************************************************/
|
||||||
|
const CHARSET_INFO *TDBXML::data_charset()
|
||||||
|
{
|
||||||
|
return &my_charset_utf8_general_ci;
|
||||||
|
} // end of data_charset
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Allocate XML column description block. */
|
/* Allocate XML column description block. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
@ -863,8 +879,10 @@ bool TDBXML::Initialize(PGLOBAL g)
|
|||||||
} // endif TabNode
|
} // endif TabNode
|
||||||
|
|
||||||
DBnode->AddText(g, "\n");
|
DBnode->AddText(g, "\n");
|
||||||
} else
|
} else {
|
||||||
TabNode = Root; // Try this ?
|
TabNode = Root; // Try this ?
|
||||||
|
Tabname = TabNode->GetName(g);
|
||||||
|
} // endif's
|
||||||
|
|
||||||
} else if (rc == RC_NF || rc == RC_EF) {
|
} else if (rc == RC_NF || rc == RC_EF) {
|
||||||
// The XML file does not exist or is void
|
// The XML file does not exist or is void
|
||||||
@ -918,11 +936,23 @@ bool TDBXML::Initialize(PGLOBAL g)
|
|||||||
} else // (rc == RC_FX)
|
} else // (rc == RC_FX)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
if (!Rowname) {
|
||||||
|
for (PXNODE n = TabNode->GetChild(g); n; n = n->GetNext(g))
|
||||||
|
if (n->GetType() == XML_ELEMENT_NODE) {
|
||||||
|
Rowname = n->GetName(g);
|
||||||
|
break;
|
||||||
|
} // endif Type
|
||||||
|
|
||||||
|
if (!Rowname)
|
||||||
|
Rowname = TabNode->GetName(g);
|
||||||
|
} // endif Rowname
|
||||||
|
|
||||||
// Get row node list
|
// Get row node list
|
||||||
if (Rowname)
|
if (strcmp(Rowname, Tabname))
|
||||||
Nlist = TabNode->SelectNodes(g, Rowname);
|
Nlist = TabNode->SelectNodes(g, Rowname);
|
||||||
else
|
else
|
||||||
Nlist = TabNode->GetChildElements(g);
|
Nrow = 1;
|
||||||
|
|
||||||
|
|
||||||
Docp->SetNofree(true); // For libxml2
|
Docp->SetNofree(true); // For libxml2
|
||||||
#if defined(__WIN__)
|
#if defined(__WIN__)
|
||||||
@ -1213,11 +1243,15 @@ int TDBXML::ReadDB(PGLOBAL g)
|
|||||||
htrc("TDBXML ReadDB: Irow=%d RowNode=%p\n", Irow, RowNode);
|
htrc("TDBXML ReadDB: Irow=%d RowNode=%p\n", Irow, RowNode);
|
||||||
|
|
||||||
// Get the new row node
|
// Get the new row node
|
||||||
|
if (Nlist) {
|
||||||
if ((RowNode = Nlist->GetItem(g, Irow, RowNode)) == NULL) {
|
if ((RowNode = Nlist->GetItem(g, Irow, RowNode)) == NULL) {
|
||||||
sprintf(g->Message, MSG(MISSING_ROWNODE), Irow);
|
sprintf(g->Message, MSG(MISSING_ROWNODE), Irow);
|
||||||
return RC_FX;
|
return RC_FX;
|
||||||
} // endif RowNode
|
} // endif RowNode
|
||||||
|
|
||||||
|
} else
|
||||||
|
RowNode = TabNode;
|
||||||
|
|
||||||
if (Colname && Coltype == 2)
|
if (Colname && Coltype == 2)
|
||||||
Clist = RowNode->SelectNodes(g, Colname, Clist);
|
Clist = RowNode->SelectNodes(g, Colname, Clist);
|
||||||
|
|
||||||
@ -1271,6 +1305,7 @@ int TDBXML::WriteDB(PGLOBAL g)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
int TDBXML::DeleteDB(PGLOBAL g, int irc)
|
int TDBXML::DeleteDB(PGLOBAL g, int irc)
|
||||||
{
|
{
|
||||||
|
// TODO: Handle null Nlist
|
||||||
if (irc == RC_FX) {
|
if (irc == RC_FX) {
|
||||||
// Delete all rows
|
// Delete all rows
|
||||||
for (Irow = 0; Irow < Nrow; Irow++)
|
for (Irow = 0; Irow < Nrow; Irow++)
|
||||||
@ -2209,7 +2244,8 @@ void XPOSCOL::WriteColumn(PGLOBAL g)
|
|||||||
TDBXCT::TDBXCT(PXMLDEF tdp) : TDBCAT(tdp)
|
TDBXCT::TDBXCT(PXMLDEF tdp) : TDBCAT(tdp)
|
||||||
{
|
{
|
||||||
Topt = tdp->GetTopt();
|
Topt = tdp->GetTopt();
|
||||||
Db = (char*)tdp->GetDB();
|
//Db = (char*)tdp->GetDB();
|
||||||
|
Db = (char*)tdp->Schema;
|
||||||
Tabn = tdp->Tabname;
|
Tabn = tdp->Tabname;
|
||||||
} // end of TDBXCT constructor
|
} // end of TDBXCT constructor
|
||||||
|
|
||||||
|
@ -9,6 +9,8 @@ typedef class XMLDEF *PXMLDEF;
|
|||||||
typedef class TDBXML *PTDBXML;
|
typedef class TDBXML *PTDBXML;
|
||||||
typedef class XMLCOL *PXMLCOL;
|
typedef class XMLCOL *PXMLCOL;
|
||||||
|
|
||||||
|
DllExport PQRYRES XMLColumns(PGLOBAL, char *, char *, PTOS, bool);
|
||||||
|
|
||||||
/* --------------------------- XML classes --------------------------- */
|
/* --------------------------- XML classes --------------------------- */
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
@ -50,6 +52,7 @@ class DllExport XMLDEF : public TABDEF { /* Logical table description */
|
|||||||
bool Usedom; /* True: DOM, False: libxml2 */
|
bool Usedom; /* True: DOM, False: libxml2 */
|
||||||
bool Zipped; /* True: Zipped XML file(s) */
|
bool Zipped; /* True: Zipped XML file(s) */
|
||||||
bool Mulentries; /* True: multiple entries in zip file*/
|
bool Mulentries; /* True: multiple entries in zip file*/
|
||||||
|
bool Skip; /* Skip null columns */
|
||||||
}; // end of XMLDEF
|
}; // end of XMLDEF
|
||||||
|
|
||||||
#if defined(INCLUDE_TDBXML)
|
#if defined(INCLUDE_TDBXML)
|
||||||
@ -100,8 +103,7 @@ class DllExport TDBXML : public TDBASE {
|
|||||||
virtual int DeleteDB(PGLOBAL g, int irc);
|
virtual int DeleteDB(PGLOBAL g, int irc);
|
||||||
virtual void CloseDB(PGLOBAL g);
|
virtual void CloseDB(PGLOBAL g);
|
||||||
virtual int CheckWrite(PGLOBAL g) {Checked = true; return 0;}
|
virtual int CheckWrite(PGLOBAL g) {Checked = true; return 0;}
|
||||||
virtual const CHARSET_INFO *data_charset()
|
virtual const CHARSET_INFO *data_charset();
|
||||||
{return &my_charset_utf8_general_ci;}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Members
|
// Members
|
||||||
|
@ -107,7 +107,7 @@ bool user_connect::user_init()
|
|||||||
g= PlugInit(NULL, worksize);
|
g= PlugInit(NULL, worksize);
|
||||||
|
|
||||||
// Check whether the initialization is complete
|
// Check whether the initialization is complete
|
||||||
if (!g || !g->Sarea || PlugSubSet(g, g->Sarea, g->Sarea_Size)
|
if (!g || !g->Sarea || PlugSubSet(g->Sarea, g->Sarea_Size)
|
||||||
|| !(dup= PlgMakeUser(g))) {
|
|| !(dup= PlgMakeUser(g))) {
|
||||||
if (g)
|
if (g)
|
||||||
printf("%s\n", g->Message);
|
printf("%s\n", g->Message);
|
||||||
@ -172,7 +172,7 @@ bool user_connect::CheckCleanup(bool force)
|
|||||||
|
|
||||||
} // endif worksize
|
} // endif worksize
|
||||||
|
|
||||||
PlugSubSet(g, g->Sarea, g->Sarea_Size);
|
PlugSubSet(g->Sarea, g->Sarea_Size);
|
||||||
g->Xchk = NULL;
|
g->Xchk = NULL;
|
||||||
g->Createas = 0;
|
g->Createas = 0;
|
||||||
g->Alchecked = 0;
|
g->Alchecked = 0;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
Copyright (c) 2005, 2018, Oracle and/or its affiliates. All Rights Reserved.
|
Copyright (c) 2005, 2018, Oracle and/or its affiliates. All Rights Reserved.
|
||||||
Copyright (c) 2013, 2018, MariaDB Corporation.
|
Copyright (c) 2013, 2019, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
the terms of the GNU General Public License as published by the Free Software
|
the terms of the GNU General Public License as published by the Free Software
|
||||||
@ -3795,12 +3795,14 @@ check_if_ok_to_rename:
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dict_foreign_t* foreign;
|
||||||
|
|
||||||
for (dict_foreign_set::iterator it
|
for (dict_foreign_set::iterator it
|
||||||
= prebuilt->table->foreign_set.begin();
|
= prebuilt->table->foreign_set.begin();
|
||||||
it != prebuilt->table->foreign_set.end();
|
it != prebuilt->table->foreign_set.end();
|
||||||
++it) {
|
++it) {
|
||||||
|
|
||||||
dict_foreign_t* foreign = *it;
|
foreign = *it;
|
||||||
const char* fid = strchr(foreign->id, '/');
|
const char* fid = strchr(foreign->id, '/');
|
||||||
|
|
||||||
DBUG_ASSERT(fid);
|
DBUG_ASSERT(fid);
|
||||||
@ -3811,7 +3813,6 @@ check_if_ok_to_rename:
|
|||||||
|
|
||||||
if (!my_strcasecmp(system_charset_info,
|
if (!my_strcasecmp(system_charset_info,
|
||||||
fid, drop->name)) {
|
fid, drop->name)) {
|
||||||
drop_fk[n_drop_fk++] = foreign;
|
|
||||||
goto found_fk;
|
goto found_fk;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3820,12 +3821,19 @@ check_if_ok_to_rename:
|
|||||||
drop->name);
|
drop->name);
|
||||||
goto err_exit;
|
goto err_exit;
|
||||||
found_fk:
|
found_fk:
|
||||||
|
for (ulint i = n_drop_fk; i--; ) {
|
||||||
|
if (drop_fk[i] == foreign) {
|
||||||
|
goto dup_fk;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
drop_fk[n_drop_fk++] = foreign;
|
||||||
|
dup_fk:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
DBUG_ASSERT(n_drop_fk > 0);
|
DBUG_ASSERT(n_drop_fk > 0);
|
||||||
DBUG_ASSERT(n_drop_fk
|
DBUG_ASSERT(n_drop_fk
|
||||||
== ha_alter_info->alter_info->drop_list.elements);
|
<= ha_alter_info->alter_info->drop_list.elements);
|
||||||
} else {
|
} else {
|
||||||
drop_fk = NULL;
|
drop_fk = NULL;
|
||||||
}
|
}
|
||||||
@ -4696,7 +4704,7 @@ err_exit:
|
|||||||
rename_foreign:
|
rename_foreign:
|
||||||
trx->op_info = "renaming column in SYS_FOREIGN_COLS";
|
trx->op_info = "renaming column in SYS_FOREIGN_COLS";
|
||||||
|
|
||||||
std::list<dict_foreign_t*> fk_evict;
|
std::set<dict_foreign_t*> fk_evict;
|
||||||
bool foreign_modified;
|
bool foreign_modified;
|
||||||
|
|
||||||
for (dict_foreign_set::const_iterator it = user_table->foreign_set.begin();
|
for (dict_foreign_set::const_iterator it = user_table->foreign_set.begin();
|
||||||
@ -4736,7 +4744,7 @@ rename_foreign:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (foreign_modified) {
|
if (foreign_modified) {
|
||||||
fk_evict.push_back(foreign);
|
fk_evict.insert(foreign);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4778,7 +4786,7 @@ rename_foreign:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (foreign_modified) {
|
if (foreign_modified) {
|
||||||
fk_evict.push_back(foreign);
|
fk_evict.insert(foreign);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5174,7 +5182,7 @@ commit_try_rebuild(
|
|||||||
& Alter_inplace_info::DROP_FOREIGN_KEY)
|
& Alter_inplace_info::DROP_FOREIGN_KEY)
|
||||||
|| ctx->num_to_drop_fk > 0);
|
|| ctx->num_to_drop_fk > 0);
|
||||||
DBUG_ASSERT(ctx->num_to_drop_fk
|
DBUG_ASSERT(ctx->num_to_drop_fk
|
||||||
== ha_alter_info->alter_info->drop_list.elements);
|
<= ha_alter_info->alter_info->drop_list.elements);
|
||||||
|
|
||||||
for (dict_index_t* index = dict_table_get_first_index(rebuilt_table);
|
for (dict_index_t* index = dict_table_get_first_index(rebuilt_table);
|
||||||
index;
|
index;
|
||||||
@ -5426,7 +5434,7 @@ commit_try_norebuild(
|
|||||||
& Alter_inplace_info::DROP_FOREIGN_KEY)
|
& Alter_inplace_info::DROP_FOREIGN_KEY)
|
||||||
|| ctx->num_to_drop_fk > 0);
|
|| ctx->num_to_drop_fk > 0);
|
||||||
DBUG_ASSERT(ctx->num_to_drop_fk
|
DBUG_ASSERT(ctx->num_to_drop_fk
|
||||||
== ha_alter_info->alter_info->drop_list.elements);
|
<= ha_alter_info->alter_info->drop_list.elements);
|
||||||
|
|
||||||
for (ulint i = 0; i < ctx->num_to_add_index; i++) {
|
for (ulint i = 0; i < ctx->num_to_add_index; i++) {
|
||||||
dict_index_t* index = ctx->add_index[i];
|
dict_index_t* index = ctx->add_index[i];
|
||||||
@ -5747,7 +5755,6 @@ ha_innobase::commit_inplace_alter_table(
|
|||||||
Alter_inplace_info* ha_alter_info,
|
Alter_inplace_info* ha_alter_info,
|
||||||
bool commit)
|
bool commit)
|
||||||
{
|
{
|
||||||
dberr_t error;
|
|
||||||
ha_innobase_inplace_ctx* ctx0
|
ha_innobase_inplace_ctx* ctx0
|
||||||
= static_cast<ha_innobase_inplace_ctx*>
|
= static_cast<ha_innobase_inplace_ctx*>
|
||||||
(ha_alter_info->handler_ctx);
|
(ha_alter_info->handler_ctx);
|
||||||
@ -5827,7 +5834,7 @@ ha_innobase::commit_inplace_alter_table(
|
|||||||
transactions collected during crash recovery could be
|
transactions collected during crash recovery could be
|
||||||
holding InnoDB locks only, not MySQL locks. */
|
holding InnoDB locks only, not MySQL locks. */
|
||||||
|
|
||||||
error = row_merge_lock_table(
|
dberr_t error = row_merge_lock_table(
|
||||||
prebuilt->trx, ctx->old_table, LOCK_X);
|
prebuilt->trx, ctx->old_table, LOCK_X);
|
||||||
|
|
||||||
if (error != DB_SUCCESS) {
|
if (error != DB_SUCCESS) {
|
||||||
@ -6012,9 +6019,9 @@ rollback_trx:
|
|||||||
file operations that will be performed in
|
file operations that will be performed in
|
||||||
commit_cache_rebuild(), and if none, generate
|
commit_cache_rebuild(), and if none, generate
|
||||||
the redo log for these operations. */
|
the redo log for these operations. */
|
||||||
error = fil_mtr_rename_log(ctx->old_table,
|
dberr_t error = fil_mtr_rename_log(
|
||||||
ctx->new_table,
|
ctx->old_table, ctx->new_table, ctx->tmp_name,
|
||||||
ctx->tmp_name, &mtr);
|
&mtr);
|
||||||
if (error != DB_SUCCESS) {
|
if (error != DB_SUCCESS) {
|
||||||
/* Out of memory or a problem will occur
|
/* Out of memory or a problem will occur
|
||||||
when renaming files. */
|
when renaming files. */
|
||||||
@ -6139,39 +6146,30 @@ rollback_trx:
|
|||||||
/* Rename the tablespace files. */
|
/* Rename the tablespace files. */
|
||||||
commit_cache_rebuild(ctx);
|
commit_cache_rebuild(ctx);
|
||||||
|
|
||||||
error = innobase_update_foreign_cache(ctx, user_thd);
|
if (innobase_update_foreign_cache(ctx, user_thd)
|
||||||
if (error != DB_SUCCESS) {
|
!= DB_SUCCESS
|
||||||
goto foreign_fail;
|
&& prebuilt->trx->check_foreigns) {
|
||||||
}
|
|
||||||
} else {
|
|
||||||
error = innobase_update_foreign_cache(ctx, user_thd);
|
|
||||||
|
|
||||||
if (error != DB_SUCCESS) {
|
|
||||||
foreign_fail:
|
foreign_fail:
|
||||||
/* The data dictionary cache
|
push_warning_printf(
|
||||||
should be corrupted now. The
|
user_thd,
|
||||||
best solution should be to
|
Sql_condition::WARN_LEVEL_WARN,
|
||||||
kill and restart the server,
|
ER_ALTER_INFO,
|
||||||
but the *.frm file has not
|
"failed to load FOREIGN KEY"
|
||||||
been replaced yet. */
|
" constraints");
|
||||||
my_error(ER_CANNOT_ADD_FOREIGN,
|
}
|
||||||
MYF(0));
|
|
||||||
sql_print_error(
|
|
||||||
"InnoDB: dict_load_foreigns()"
|
|
||||||
" returned %u for %s",
|
|
||||||
(unsigned) error,
|
|
||||||
thd_query_string(user_thd)
|
|
||||||
->str);
|
|
||||||
ut_ad(0);
|
|
||||||
} else {
|
} else {
|
||||||
if (!commit_cache_norebuild(
|
bool fk_fail = innobase_update_foreign_cache(
|
||||||
ctx, table, trx)) {
|
ctx, user_thd) != DB_SUCCESS;
|
||||||
ut_a(!prebuilt->trx->check_foreigns);
|
|
||||||
|
if (!commit_cache_norebuild(ctx, table, trx)) {
|
||||||
|
fk_fail = true;
|
||||||
|
ut_ad(!prebuilt->trx->check_foreigns);
|
||||||
}
|
}
|
||||||
|
|
||||||
innobase_rename_columns_cache(
|
innobase_rename_columns_cache(ha_alter_info, table,
|
||||||
ha_alter_info, table,
|
|
||||||
ctx->new_table);
|
ctx->new_table);
|
||||||
|
if (fk_fail && prebuilt->trx->check_foreigns) {
|
||||||
|
goto foreign_fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DBUG_INJECT_CRASH("ib_commit_inplace_crash",
|
DBUG_INJECT_CRASH("ib_commit_inplace_crash",
|
||||||
|
@ -45,7 +45,7 @@ Created 1/20/1994 Heikki Tuuri
|
|||||||
|
|
||||||
#define INNODB_VERSION_MAJOR 5
|
#define INNODB_VERSION_MAJOR 5
|
||||||
#define INNODB_VERSION_MINOR 6
|
#define INNODB_VERSION_MINOR 6
|
||||||
#define INNODB_VERSION_BUGFIX 42
|
#define INNODB_VERSION_BUGFIX 43
|
||||||
|
|
||||||
/* The following is the InnoDB version as shown in
|
/* The following is the InnoDB version as shown in
|
||||||
SELECT plugin_version FROM information_schema.plugins;
|
SELECT plugin_version FROM information_schema.plugins;
|
||||||
|
@ -5279,9 +5279,6 @@ row_rename_table_for_mysql(
|
|||||||
" = TO_BINARY(:old_table_name);\n"
|
" = TO_BINARY(:old_table_name);\n"
|
||||||
"END;\n"
|
"END;\n"
|
||||||
, FALSE, trx);
|
, FALSE, trx);
|
||||||
if (err != DB_SUCCESS) {
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (n_constraints_to_drop > 0) {
|
} else if (n_constraints_to_drop > 0) {
|
||||||
/* Drop some constraints of tmp tables. */
|
/* Drop some constraints of tmp tables. */
|
||||||
|
174
storage/tokudb/PerconaFT/COPYING.APACHEv2
Normal file
174
storage/tokudb/PerconaFT/COPYING.APACHEv2
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
@ -104,11 +104,14 @@ All source code and test contributions must be provided under a [BSD 2-Clause][b
|
|||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
Portions of the PerconaFT library (the 'locktree' and 'omt') are available under the Apache version 2 license.
|
||||||
PerconaFT is available under the GPL version 2, and AGPL version 3.
|
PerconaFT is available under the GPL version 2, and AGPL version 3.
|
||||||
See [COPYING.AGPLv3][agpllicense],
|
See [COPYING.APACHEv2][apachelicense],
|
||||||
|
[COPYING.AGPLv3][agpllicense],
|
||||||
[COPYING.GPLv2][gpllicense], and
|
[COPYING.GPLv2][gpllicense], and
|
||||||
[PATENTS][patents].
|
[PATENTS][patents].
|
||||||
|
|
||||||
|
[apachelicense]: http://github.com/Percona/PerconaFT/blob/master/COPYING.APACHEv2
|
||||||
[agpllicense]: http://github.com/Percona/PerconaFT/blob/master/COPYING.AGPLv3
|
[agpllicense]: http://github.com/Percona/PerconaFT/blob/master/COPYING.AGPLv3
|
||||||
[gpllicense]: http://github.com/Percona/PerconaFT/blob/master/COPYING.GPLv2
|
[gpllicense]: http://github.com/Percona/PerconaFT/blob/master/COPYING.GPLv2
|
||||||
[patents]: http://github.com/Percona/PerconaFT/blob/master/PATENTS
|
[patents]: http://github.com/Percona/PerconaFT/blob/master/PATENTS
|
||||||
|
@ -46,11 +46,11 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
void set_test_txn_sync_callback(void (*) (pthread_t, void*), void*);
|
void set_test_txn_sync_callback(void (*) (pthread_t, void*), void*);
|
||||||
#define toku_test_txn_sync_callback(a) ((test_txn_sync_callback)? test_txn_sync_callback( a,test_txn_sync_callback_extra) : (void) 0)
|
#define toku_test_txn_sync_callback(a) ((test_txn_sync_callback)? test_txn_sync_callback( a,test_txn_sync_callback_extra) : (void) 0)
|
||||||
|
|
||||||
#if TOKU_DEBUG_TXN_SYNC
|
#if defined(TOKU_DEBUG_TXN_SYNC)
|
||||||
#define toku_debug_txn_sync(a) toku_test_txn_sync_callback(a)
|
#define toku_debug_txn_sync(a) toku_test_txn_sync_callback(a)
|
||||||
#else
|
#else
|
||||||
#define toku_debug_txn_sync(a) ((void) 0)
|
#define toku_debug_txn_sync(a) ((void) 0)
|
||||||
#endif
|
#endif // defined(TOKU_DEBUG_TXN_SYNC)
|
||||||
|
|
||||||
typedef struct txn_manager *TXN_MANAGER;
|
typedef struct txn_manager *TXN_MANAGER;
|
||||||
|
|
||||||
|
@ -32,6 +32,20 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
======= */
|
======= */
|
||||||
|
|
||||||
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
||||||
|
@ -32,6 +32,20 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
======= */
|
======= */
|
||||||
|
|
||||||
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
||||||
|
@ -32,6 +32,19 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
======= */
|
======= */
|
||||||
|
|
||||||
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
||||||
|
@ -32,6 +32,19 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
======= */
|
======= */
|
||||||
|
|
||||||
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
||||||
|
@ -32,6 +32,19 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
======= */
|
======= */
|
||||||
|
|
||||||
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
||||||
|
@ -32,6 +32,19 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
======= */
|
======= */
|
||||||
|
|
||||||
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
||||||
|
@ -32,6 +32,19 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
======= */
|
======= */
|
||||||
|
|
||||||
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
||||||
|
@ -32,6 +32,19 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
======= */
|
======= */
|
||||||
|
|
||||||
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
||||||
|
@ -32,6 +32,19 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
======= */
|
======= */
|
||||||
|
|
||||||
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
||||||
|
@ -32,6 +32,19 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
======= */
|
======= */
|
||||||
|
|
||||||
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
||||||
|
@ -32,6 +32,19 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
======= */
|
======= */
|
||||||
|
|
||||||
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
||||||
|
@ -32,6 +32,19 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
======= */
|
======= */
|
||||||
|
|
||||||
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
||||||
|
@ -32,6 +32,19 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
======= */
|
======= */
|
||||||
|
|
||||||
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
||||||
|
@ -32,6 +32,19 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
======= */
|
======= */
|
||||||
|
|
||||||
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
||||||
|
@ -32,6 +32,19 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
======= */
|
======= */
|
||||||
|
|
||||||
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
||||||
|
@ -32,6 +32,19 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
======= */
|
======= */
|
||||||
|
|
||||||
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
||||||
|
@ -32,6 +32,19 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
======= */
|
======= */
|
||||||
|
|
||||||
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
||||||
|
@ -184,9 +184,9 @@ void toku_instr_file_io_end(toku_io_instrumentation &io_instr, ssize_t count) {
|
|||||||
|
|
||||||
void toku_instr_mutex_init(const toku_instr_key &key, toku_mutex_t &mutex) {
|
void toku_instr_mutex_init(const toku_instr_key &key, toku_mutex_t &mutex) {
|
||||||
mutex.psi_mutex = PSI_MUTEX_CALL(init_mutex)(key.id(), &mutex.pmutex);
|
mutex.psi_mutex = PSI_MUTEX_CALL(init_mutex)(key.id(), &mutex.pmutex);
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
mutex.instr_key_id = key.id();
|
mutex.instr_key_id = key.id();
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
}
|
}
|
||||||
|
|
||||||
void toku_instr_mutex_destroy(PSI_mutex *&mutex_instr) {
|
void toku_instr_mutex_destroy(PSI_mutex *&mutex_instr) {
|
||||||
@ -242,9 +242,9 @@ void toku_instr_mutex_unlock(PSI_mutex *mutex_instr) {
|
|||||||
|
|
||||||
void toku_instr_cond_init(const toku_instr_key &key, toku_cond_t &cond) {
|
void toku_instr_cond_init(const toku_instr_key &key, toku_cond_t &cond) {
|
||||||
cond.psi_cond = PSI_COND_CALL(init_cond)(key.id(), &cond.pcond);
|
cond.psi_cond = PSI_COND_CALL(init_cond)(key.id(), &cond.pcond);
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
cond.instr_key_id = key.id();
|
cond.instr_key_id = key.id();
|
||||||
#endif
|
#endif // // defined(TOKU_PTHREAD_DEBUG)
|
||||||
}
|
}
|
||||||
|
|
||||||
void toku_instr_cond_destroy(PSI_cond *&cond_instr) {
|
void toku_instr_cond_destroy(PSI_cond *&cond_instr) {
|
||||||
@ -295,9 +295,9 @@ void toku_instr_cond_broadcast(const toku_cond_t &cond) {
|
|||||||
void toku_instr_rwlock_init(const toku_instr_key &key,
|
void toku_instr_rwlock_init(const toku_instr_key &key,
|
||||||
toku_pthread_rwlock_t &rwlock) {
|
toku_pthread_rwlock_t &rwlock) {
|
||||||
rwlock.psi_rwlock = PSI_RWLOCK_CALL(init_rwlock)(key.id(), &rwlock.rwlock);
|
rwlock.psi_rwlock = PSI_RWLOCK_CALL(init_rwlock)(key.id(), &rwlock.rwlock);
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
rwlock.instr_key_id = key.id();
|
rwlock.instr_key_id = key.id();
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
}
|
}
|
||||||
|
|
||||||
void toku_instr_rwlock_destroy(PSI_rwlock *&rwlock_instr) {
|
void toku_instr_rwlock_destroy(PSI_rwlock *&rwlock_instr) {
|
||||||
|
@ -12,8 +12,15 @@
|
|||||||
// undefine them here to avoid compilation errors.
|
// undefine them here to avoid compilation errors.
|
||||||
#undef __STDC_FORMAT_MACROS
|
#undef __STDC_FORMAT_MACROS
|
||||||
#undef __STDC_LIMIT_MACROS
|
#undef __STDC_LIMIT_MACROS
|
||||||
#include <mysql/psi/mysql_file.h> // PSI_file
|
#include "mysql/psi/mysql_file.h" // PSI_file
|
||||||
#include <mysql/psi/mysql_thread.h> // PSI_mutex
|
#include "mysql/psi/mysql_thread.h" // PSI_mutex
|
||||||
|
#include "mysql/psi/mysql_stage.h" // PSI_stage
|
||||||
|
|
||||||
|
#if (MYSQL_VERSION_ID >= 80000) && ( MYSQL_VERSION_ID <= 100000)
|
||||||
|
#include "mysql/psi/mysql_cond.h"
|
||||||
|
#include "mysql/psi/mysql_mutex.h"
|
||||||
|
#include "mysql/psi/mysql_rwlock.h"
|
||||||
|
#endif // (MYSQL_VERSION_ID >= nn)
|
||||||
|
|
||||||
#ifndef HAVE_PSI_MUTEX_INTERFACE
|
#ifndef HAVE_PSI_MUTEX_INTERFACE
|
||||||
#error HAVE_PSI_MUTEX_INTERFACE required
|
#error HAVE_PSI_MUTEX_INTERFACE required
|
||||||
|
@ -64,23 +64,23 @@ struct toku_mutex_t {
|
|||||||
pthread_mutex_t pmutex;
|
pthread_mutex_t pmutex;
|
||||||
struct PSI_mutex
|
struct PSI_mutex
|
||||||
*psi_mutex; /* The performance schema instrumentation hook */
|
*psi_mutex; /* The performance schema instrumentation hook */
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
pthread_t owner; // = pthread_self(); // for debugging
|
pthread_t owner; // = pthread_self(); // for debugging
|
||||||
bool locked;
|
bool locked;
|
||||||
bool valid;
|
bool valid;
|
||||||
pfs_key_t instr_key_id;
|
pfs_key_t instr_key_id;
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
};
|
};
|
||||||
|
|
||||||
struct toku_cond_t {
|
struct toku_cond_t {
|
||||||
pthread_cond_t pcond;
|
pthread_cond_t pcond;
|
||||||
struct PSI_cond *psi_cond;
|
struct PSI_cond *psi_cond;
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
pfs_key_t instr_key_id;
|
pfs_key_t instr_key_id;
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
#define TOKU_COND_INITIALIZER \
|
#define TOKU_COND_INITIALIZER \
|
||||||
{ \
|
{ \
|
||||||
.pcond = PTHREAD_COND_INITIALIZER, .psi_cond = nullptr, \
|
.pcond = PTHREAD_COND_INITIALIZER, .psi_cond = nullptr, \
|
||||||
@ -89,14 +89,14 @@ struct toku_cond_t {
|
|||||||
#else
|
#else
|
||||||
#define TOKU_COND_INITIALIZER \
|
#define TOKU_COND_INITIALIZER \
|
||||||
{ .pcond = PTHREAD_COND_INITIALIZER, .psi_cond = nullptr }
|
{ .pcond = PTHREAD_COND_INITIALIZER, .psi_cond = nullptr }
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
|
|
||||||
struct toku_pthread_rwlock_t {
|
struct toku_pthread_rwlock_t {
|
||||||
pthread_rwlock_t rwlock;
|
pthread_rwlock_t rwlock;
|
||||||
struct PSI_rwlock *psi_rwlock;
|
struct PSI_rwlock *psi_rwlock;
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
pfs_key_t instr_key_id;
|
pfs_key_t instr_key_id;
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct toku_mutex_aligned {
|
typedef struct toku_mutex_aligned {
|
||||||
@ -117,7 +117,7 @@ typedef struct toku_mutex_aligned {
|
|||||||
#define ZERO_MUTEX_INITIALIZER \
|
#define ZERO_MUTEX_INITIALIZER \
|
||||||
{}
|
{}
|
||||||
|
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
#define TOKU_MUTEX_INITIALIZER \
|
#define TOKU_MUTEX_INITIALIZER \
|
||||||
{ \
|
{ \
|
||||||
.pmutex = PTHREAD_MUTEX_INITIALIZER, .psi_mutex = nullptr, .owner = 0, \
|
.pmutex = PTHREAD_MUTEX_INITIALIZER, .psi_mutex = nullptr, .owner = 0, \
|
||||||
@ -126,12 +126,12 @@ typedef struct toku_mutex_aligned {
|
|||||||
#else
|
#else
|
||||||
#define TOKU_MUTEX_INITIALIZER \
|
#define TOKU_MUTEX_INITIALIZER \
|
||||||
{ .pmutex = PTHREAD_MUTEX_INITIALIZER, .psi_mutex = nullptr }
|
{ .pmutex = PTHREAD_MUTEX_INITIALIZER, .psi_mutex = nullptr }
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
|
|
||||||
// Darwin doesn't provide adaptive mutexes
|
// Darwin doesn't provide adaptive mutexes
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
#define TOKU_MUTEX_ADAPTIVE PTHREAD_MUTEX_DEFAULT
|
#define TOKU_MUTEX_ADAPTIVE PTHREAD_MUTEX_DEFAULT
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
#define TOKU_ADAPTIVE_MUTEX_INITIALIZER \
|
#define TOKU_ADAPTIVE_MUTEX_INITIALIZER \
|
||||||
{ \
|
{ \
|
||||||
.pmutex = PTHREAD_MUTEX_INITIALIZER, .psi_mutex = nullptr, .owner = 0, \
|
.pmutex = PTHREAD_MUTEX_INITIALIZER, .psi_mutex = nullptr, .owner = 0, \
|
||||||
@ -140,10 +140,10 @@ typedef struct toku_mutex_aligned {
|
|||||||
#else
|
#else
|
||||||
#define TOKU_ADAPTIVE_MUTEX_INITIALIZER \
|
#define TOKU_ADAPTIVE_MUTEX_INITIALIZER \
|
||||||
{ .pmutex = PTHREAD_MUTEX_INITIALIZER, .psi_mutex = nullptr }
|
{ .pmutex = PTHREAD_MUTEX_INITIALIZER, .psi_mutex = nullptr }
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
#else // __FreeBSD__, __linux__, at least
|
#else // __FreeBSD__, __linux__, at least
|
||||||
#define TOKU_MUTEX_ADAPTIVE PTHREAD_MUTEX_ADAPTIVE_NP
|
#define TOKU_MUTEX_ADAPTIVE PTHREAD_MUTEX_ADAPTIVE_NP
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
#define TOKU_ADAPTIVE_MUTEX_INITIALIZER \
|
#define TOKU_ADAPTIVE_MUTEX_INITIALIZER \
|
||||||
{ \
|
{ \
|
||||||
.pmutex = PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP, .psi_mutex = nullptr, \
|
.pmutex = PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP, .psi_mutex = nullptr, \
|
||||||
@ -152,8 +152,8 @@ typedef struct toku_mutex_aligned {
|
|||||||
#else
|
#else
|
||||||
#define TOKU_ADAPTIVE_MUTEX_INITIALIZER \
|
#define TOKU_ADAPTIVE_MUTEX_INITIALIZER \
|
||||||
{ .pmutex = PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP, .psi_mutex = nullptr }
|
{ .pmutex = PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP, .psi_mutex = nullptr }
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
#endif
|
#endif // defined(__APPLE__)
|
||||||
|
|
||||||
// Different OSes implement mutexes as different amounts of nested structs.
|
// Different OSes implement mutexes as different amounts of nested structs.
|
||||||
// C++ will fill out all missing values with zeroes if you provide at least one
|
// C++ will fill out all missing values with zeroes if you provide at least one
|
||||||
@ -198,7 +198,7 @@ toku_mutexattr_destroy(toku_pthread_mutexattr_t *attr) {
|
|||||||
assert_zero(r);
|
assert_zero(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
static inline void toku_mutex_assert_locked(const toku_mutex_t *mutex) {
|
static inline void toku_mutex_assert_locked(const toku_mutex_t *mutex) {
|
||||||
invariant(mutex->locked);
|
invariant(mutex->locked);
|
||||||
invariant(mutex->owner == pthread_self());
|
invariant(mutex->owner == pthread_self());
|
||||||
@ -207,7 +207,7 @@ static inline void toku_mutex_assert_locked(const toku_mutex_t *mutex) {
|
|||||||
static inline void
|
static inline void
|
||||||
toku_mutex_assert_locked(const toku_mutex_t *mutex __attribute__((unused))) {
|
toku_mutex_assert_locked(const toku_mutex_t *mutex __attribute__((unused))) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
|
|
||||||
// asserting that a mutex is unlocked only makes sense
|
// asserting that a mutex is unlocked only makes sense
|
||||||
// if the calling thread can guaruntee that no other threads
|
// if the calling thread can guaruntee that no other threads
|
||||||
@ -217,7 +217,7 @@ toku_mutex_assert_locked(const toku_mutex_t *mutex __attribute__((unused))) {
|
|||||||
// when a node is locked the caller knows that no other threads
|
// when a node is locked the caller knows that no other threads
|
||||||
// can be trying to lock its childrens' mutexes. the children
|
// can be trying to lock its childrens' mutexes. the children
|
||||||
// are in one of two fixed states: locked or unlocked.
|
// are in one of two fixed states: locked or unlocked.
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
static inline void
|
static inline void
|
||||||
toku_mutex_assert_unlocked(toku_mutex_t *mutex) {
|
toku_mutex_assert_unlocked(toku_mutex_t *mutex) {
|
||||||
invariant(mutex->owner == 0);
|
invariant(mutex->owner == 0);
|
||||||
@ -226,7 +226,7 @@ toku_mutex_assert_unlocked(toku_mutex_t *mutex) {
|
|||||||
#else
|
#else
|
||||||
static inline void toku_mutex_assert_unlocked(toku_mutex_t *mutex
|
static inline void toku_mutex_assert_unlocked(toku_mutex_t *mutex
|
||||||
__attribute__((unused))) {}
|
__attribute__((unused))) {}
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
|
|
||||||
#define toku_mutex_lock(M) \
|
#define toku_mutex_lock(M) \
|
||||||
toku_mutex_lock_with_source_location(M, __FILE__, __LINE__)
|
toku_mutex_lock_with_source_location(M, __FILE__, __LINE__)
|
||||||
@ -241,13 +241,13 @@ static inline void toku_cond_init(toku_cond_t *cond,
|
|||||||
toku_mutex_trylock_with_source_location(M, __FILE__, __LINE__)
|
toku_mutex_trylock_with_source_location(M, __FILE__, __LINE__)
|
||||||
|
|
||||||
inline void toku_mutex_unlock(toku_mutex_t *mutex) {
|
inline void toku_mutex_unlock(toku_mutex_t *mutex) {
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
invariant(mutex->owner == pthread_self());
|
invariant(mutex->owner == pthread_self());
|
||||||
invariant(mutex->valid);
|
invariant(mutex->valid);
|
||||||
invariant(mutex->locked);
|
invariant(mutex->locked);
|
||||||
mutex->locked = false;
|
mutex->locked = false;
|
||||||
mutex->owner = 0;
|
mutex->owner = 0;
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
toku_instr_mutex_unlock(mutex->psi_mutex);
|
toku_instr_mutex_unlock(mutex->psi_mutex);
|
||||||
int r = pthread_mutex_unlock(&mutex->pmutex);
|
int r = pthread_mutex_unlock(&mutex->pmutex);
|
||||||
assert_zero(r);
|
assert_zero(r);
|
||||||
@ -264,13 +264,13 @@ inline void toku_mutex_lock_with_source_location(toku_mutex_t *mutex,
|
|||||||
toku_instr_mutex_lock_end(mutex_instr, r);
|
toku_instr_mutex_lock_end(mutex_instr, r);
|
||||||
|
|
||||||
assert_zero(r);
|
assert_zero(r);
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
invariant(mutex->valid);
|
invariant(mutex->valid);
|
||||||
invariant(!mutex->locked);
|
invariant(!mutex->locked);
|
||||||
invariant(mutex->owner == 0);
|
invariant(mutex->owner == 0);
|
||||||
mutex->locked = true;
|
mutex->locked = true;
|
||||||
mutex->owner = pthread_self();
|
mutex->owner = pthread_self();
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int toku_mutex_trylock_with_source_location(toku_mutex_t *mutex,
|
inline int toku_mutex_trylock_with_source_location(toku_mutex_t *mutex,
|
||||||
@ -283,7 +283,7 @@ inline int toku_mutex_trylock_with_source_location(toku_mutex_t *mutex,
|
|||||||
const int r = pthread_mutex_lock(&mutex->pmutex);
|
const int r = pthread_mutex_lock(&mutex->pmutex);
|
||||||
toku_instr_mutex_lock_end(mutex_instr, r);
|
toku_instr_mutex_lock_end(mutex_instr, r);
|
||||||
|
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
if (r == 0) {
|
if (r == 0) {
|
||||||
invariant(mutex->valid);
|
invariant(mutex->valid);
|
||||||
invariant(!mutex->locked);
|
invariant(!mutex->locked);
|
||||||
@ -291,7 +291,7 @@ inline int toku_mutex_trylock_with_source_location(toku_mutex_t *mutex,
|
|||||||
mutex->locked = true;
|
mutex->locked = true;
|
||||||
mutex->owner = pthread_self();
|
mutex->owner = pthread_self();
|
||||||
}
|
}
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,11 +320,11 @@ inline void toku_cond_wait_with_source_location(toku_cond_t *cond,
|
|||||||
const char *src_file,
|
const char *src_file,
|
||||||
uint src_line) {
|
uint src_line) {
|
||||||
|
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
invariant(mutex->locked);
|
invariant(mutex->locked);
|
||||||
mutex->locked = false;
|
mutex->locked = false;
|
||||||
mutex->owner = 0;
|
mutex->owner = 0;
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
|
|
||||||
/* Instrumentation start */
|
/* Instrumentation start */
|
||||||
toku_cond_instrumentation cond_instr;
|
toku_cond_instrumentation cond_instr;
|
||||||
@ -342,11 +342,11 @@ inline void toku_cond_wait_with_source_location(toku_cond_t *cond,
|
|||||||
toku_instr_cond_wait_end(cond_instr, r);
|
toku_instr_cond_wait_end(cond_instr, r);
|
||||||
|
|
||||||
assert_zero(r);
|
assert_zero(r);
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
invariant(!mutex->locked);
|
invariant(!mutex->locked);
|
||||||
mutex->locked = true;
|
mutex->locked = true;
|
||||||
mutex->owner = pthread_self();
|
mutex->owner = pthread_self();
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int toku_cond_timedwait_with_source_location(toku_cond_t *cond,
|
inline int toku_cond_timedwait_with_source_location(toku_cond_t *cond,
|
||||||
@ -354,11 +354,11 @@ inline int toku_cond_timedwait_with_source_location(toku_cond_t *cond,
|
|||||||
toku_timespec_t *wakeup_at,
|
toku_timespec_t *wakeup_at,
|
||||||
const char *src_file,
|
const char *src_file,
|
||||||
uint src_line) {
|
uint src_line) {
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
invariant(mutex->locked);
|
invariant(mutex->locked);
|
||||||
mutex->locked = false;
|
mutex->locked = false;
|
||||||
mutex->owner = 0;
|
mutex->owner = 0;
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
|
|
||||||
/* Instrumentation start */
|
/* Instrumentation start */
|
||||||
toku_cond_instrumentation cond_instr;
|
toku_cond_instrumentation cond_instr;
|
||||||
@ -376,11 +376,11 @@ inline int toku_cond_timedwait_with_source_location(toku_cond_t *cond,
|
|||||||
/* Instrumentation end */
|
/* Instrumentation end */
|
||||||
toku_instr_cond_wait_end(cond_instr, r);
|
toku_instr_cond_wait_end(cond_instr, r);
|
||||||
|
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
invariant(!mutex->locked);
|
invariant(!mutex->locked);
|
||||||
mutex->locked = true;
|
mutex->locked = true;
|
||||||
mutex->owner = pthread_self();
|
mutex->owner = pthread_self();
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -399,26 +399,26 @@ inline void toku_cond_broadcast(toku_cond_t *cond) {
|
|||||||
inline void toku_mutex_init(const toku_instr_key &key,
|
inline void toku_mutex_init(const toku_instr_key &key,
|
||||||
toku_mutex_t *mutex,
|
toku_mutex_t *mutex,
|
||||||
const toku_pthread_mutexattr_t *attr) {
|
const toku_pthread_mutexattr_t *attr) {
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
mutex->valid = true;
|
mutex->valid = true;
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
toku_instr_mutex_init(key, *mutex);
|
toku_instr_mutex_init(key, *mutex);
|
||||||
const int r = pthread_mutex_init(&mutex->pmutex, attr);
|
const int r = pthread_mutex_init(&mutex->pmutex, attr);
|
||||||
assert_zero(r);
|
assert_zero(r);
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
mutex->locked = false;
|
mutex->locked = false;
|
||||||
invariant(mutex->valid);
|
invariant(mutex->valid);
|
||||||
mutex->valid = true;
|
mutex->valid = true;
|
||||||
mutex->owner = 0;
|
mutex->owner = 0;
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void toku_mutex_destroy(toku_mutex_t *mutex) {
|
inline void toku_mutex_destroy(toku_mutex_t *mutex) {
|
||||||
#if TOKU_PTHREAD_DEBUG
|
#if defined(TOKU_PTHREAD_DEBUG)
|
||||||
invariant(mutex->valid);
|
invariant(mutex->valid);
|
||||||
mutex->valid = false;
|
mutex->valid = false;
|
||||||
invariant(!mutex->locked);
|
invariant(!mutex->locked);
|
||||||
#endif
|
#endif // defined(TOKU_PTHREAD_DEBUG)
|
||||||
toku_instr_mutex_destroy(mutex->psi_mutex);
|
toku_instr_mutex_destroy(mutex->psi_mutex);
|
||||||
int r = pthread_mutex_destroy(&mutex->pmutex);
|
int r = pthread_mutex_destroy(&mutex->pmutex);
|
||||||
assert_zero(r);
|
assert_zero(r);
|
||||||
|
@ -32,6 +32,19 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
======= */
|
======= */
|
||||||
|
|
||||||
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -32,6 +32,19 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
|
|||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
======= */
|
======= */
|
||||||
|
|
||||||
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
|
||||||
|
@ -7254,6 +7254,16 @@ int ha_tokudb::create(
|
|||||||
tokudb_trx_data *trx = NULL;
|
tokudb_trx_data *trx = NULL;
|
||||||
THD* thd = ha_thd();
|
THD* thd = ha_thd();
|
||||||
|
|
||||||
|
String database_name, table_name, dictionary_name;
|
||||||
|
tokudb_split_dname(name, database_name, table_name, dictionary_name);
|
||||||
|
if (database_name.is_empty() || table_name.is_empty()) {
|
||||||
|
push_warning_printf(thd,
|
||||||
|
Sql_condition::WARN_LEVEL_WARN,
|
||||||
|
ER_TABLE_NAME,
|
||||||
|
"TokuDB: Table Name or Database Name is empty");
|
||||||
|
DBUG_RETURN(ER_TABLE_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
memset(&kc_info, 0, sizeof(kc_info));
|
memset(&kc_info, 0, sizeof(kc_info));
|
||||||
|
|
||||||
#if 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100999
|
#if 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100999
|
||||||
|
@ -571,10 +571,10 @@ static int tokudb_init_func(void *p) {
|
|||||||
|
|
||||||
db_env->set_update(db_env, tokudb_update_fun);
|
db_env->set_update(db_env, tokudb_update_fun);
|
||||||
|
|
||||||
db_env_set_direct_io(tokudb::sysvars::directio == TRUE);
|
db_env_set_direct_io(tokudb::sysvars::directio);
|
||||||
|
|
||||||
db_env_set_compress_buffers_before_eviction(
|
db_env_set_compress_buffers_before_eviction(
|
||||||
tokudb::sysvars::compress_buffers_before_eviction == TRUE);
|
tokudb::sysvars::compress_buffers_before_eviction);
|
||||||
|
|
||||||
db_env->change_fsync_log_period(db_env, tokudb::sysvars::fsync_log_period);
|
db_env->change_fsync_log_period(db_env, tokudb::sysvars::fsync_log_period);
|
||||||
|
|
||||||
|
@ -190,7 +190,6 @@ inline bool tokudb_killed_thd_callback(void* extra,
|
|||||||
return thd_kill_level(thd) != 0;
|
return thd_kill_level(thd) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern HASH tokudb_open_tables;
|
|
||||||
extern const char* tokudb_hton_name;
|
extern const char* tokudb_hton_name;
|
||||||
extern int tokudb_hton_initialized;
|
extern int tokudb_hton_initialized;
|
||||||
extern tokudb::thread::rwlock_t tokudb_hton_initialized_lock;
|
extern tokudb::thread::rwlock_t tokudb_hton_initialized_lock;
|
||||||
|
2
storage/tokudb/mysql-test/tokudb_bugs/r/PS-4979.result
Normal file
2
storage/tokudb/mysql-test/tokudb_bugs/r/PS-4979.result
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
CREATE TABLE `#mysql50#q.q`(f1 INT KEY) ENGINE=TOKUDB;
|
||||||
|
ERROR 42000: Incorrect table name '#mysql50#q.q'
|
13
storage/tokudb/mysql-test/tokudb_bugs/t/PS-4979.test
Normal file
13
storage/tokudb/mysql-test/tokudb_bugs/t/PS-4979.test
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
--source include/have_tokudb.inc
|
||||||
|
# PS-4979 : Dropping TokuDB table with non-alphanumeric characters could lead
|
||||||
|
# to a crash
|
||||||
|
#
|
||||||
|
# `#mysql50#q.q` is an invalid table name, but the server side doesn't detect it
|
||||||
|
# and complain. Instead it passes in an empty table name to the engine. The
|
||||||
|
# engine expects a table name in the form of a relative path like
|
||||||
|
# "./databasename/tablename". InnoDB detects this in parsing the table name
|
||||||
|
# during the creation and returns an error.
|
||||||
|
# MariaDB server detect above error.
|
||||||
|
|
||||||
|
--error ER_WRONG_TABLE_NAME
|
||||||
|
CREATE TABLE `#mysql50#q.q`(f1 INT KEY) ENGINE=TOKUDB;
|
@ -182,14 +182,14 @@ void* job_manager_t::real_thread_func() {
|
|||||||
if (res == tokudb::thread::semaphore_t::E_INTERRUPTED || _shutdown) {
|
if (res == tokudb::thread::semaphore_t::E_INTERRUPTED || _shutdown) {
|
||||||
break;
|
break;
|
||||||
} else if (res == tokudb::thread::semaphore_t::E_SIGNALLED) {
|
} else if (res == tokudb::thread::semaphore_t::E_SIGNALLED) {
|
||||||
#if TOKUDB_DEBUG
|
#if defined(TOKUDB_DEBUG)
|
||||||
if (TOKUDB_UNLIKELY(
|
if (TOKUDB_UNLIKELY(
|
||||||
tokudb::sysvars::debug_pause_background_job_manager)) {
|
tokudb::sysvars::debug_pause_background_job_manager)) {
|
||||||
_sem.signal();
|
_sem.signal();
|
||||||
tokudb::time::sleep_microsec(250000);
|
tokudb::time::sleep_microsec(250000);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif // TOKUDB_DEBUG
|
#endif // defined(TOKUDB_DEBUG)
|
||||||
|
|
||||||
mutex_t_lock(_mutex);
|
mutex_t_lock(_mutex);
|
||||||
assert_debug(_background_jobs.size() > 0);
|
assert_debug(_background_jobs.size() > 0);
|
||||||
|
@ -661,9 +661,9 @@ static MYSQL_THDVAR_ULONGLONG(
|
|||||||
~0ULL,
|
~0ULL,
|
||||||
1);
|
1);
|
||||||
|
|
||||||
static MYSQL_THDVAR_STR(
|
static MYSQL_THDVAR_STR(last_lock_timeout,
|
||||||
last_lock_timeout,
|
PLUGIN_VAR_MEMALLOC | PLUGIN_VAR_NOCMDOPT |
|
||||||
PLUGIN_VAR_MEMALLOC,
|
PLUGIN_VAR_READONLY,
|
||||||
"last lock timeout",
|
"last lock timeout",
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -113,10 +113,10 @@ extern my_bool gdb_on_fatal;
|
|||||||
|
|
||||||
extern my_bool check_jemalloc;
|
extern my_bool check_jemalloc;
|
||||||
|
|
||||||
#if TOKUDB_DEBUG
|
#if defined(TOKUDB_DEBUG)
|
||||||
// used to control background job manager
|
// used to control background job manager
|
||||||
extern my_bool debug_pause_background_job_manager;
|
extern my_bool debug_pause_background_job_manager;
|
||||||
#endif // TOKUDB_DEBUG
|
#endif // defined(TOKUDB_DEBUG)
|
||||||
|
|
||||||
// session/thread
|
// session/thread
|
||||||
my_bool alter_print_error(THD* thd);
|
my_bool alter_print_error(THD* thd);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
Copyright (c) 2005, 2018, Oracle and/or its affiliates. All Rights Reserved.
|
Copyright (c) 2005, 2018, Oracle and/or its affiliates. All Rights Reserved.
|
||||||
Copyright (c) 2013, 2018, MariaDB Corporation.
|
Copyright (c) 2017, 2019, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
the terms of the GNU General Public License as published by the Free Software
|
the terms of the GNU General Public License as published by the Free Software
|
||||||
@ -3811,12 +3811,14 @@ check_if_ok_to_rename:
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dict_foreign_t* foreign;
|
||||||
|
|
||||||
for (dict_foreign_set::iterator it
|
for (dict_foreign_set::iterator it
|
||||||
= prebuilt->table->foreign_set.begin();
|
= prebuilt->table->foreign_set.begin();
|
||||||
it != prebuilt->table->foreign_set.end();
|
it != prebuilt->table->foreign_set.end();
|
||||||
++it) {
|
++it) {
|
||||||
|
|
||||||
dict_foreign_t* foreign = *it;
|
foreign = *it;
|
||||||
const char* fid = strchr(foreign->id, '/');
|
const char* fid = strchr(foreign->id, '/');
|
||||||
|
|
||||||
DBUG_ASSERT(fid);
|
DBUG_ASSERT(fid);
|
||||||
@ -3827,7 +3829,6 @@ check_if_ok_to_rename:
|
|||||||
|
|
||||||
if (!my_strcasecmp(system_charset_info,
|
if (!my_strcasecmp(system_charset_info,
|
||||||
fid, drop->name)) {
|
fid, drop->name)) {
|
||||||
drop_fk[n_drop_fk++] = foreign;
|
|
||||||
goto found_fk;
|
goto found_fk;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3836,12 +3837,19 @@ check_if_ok_to_rename:
|
|||||||
drop->name);
|
drop->name);
|
||||||
goto err_exit;
|
goto err_exit;
|
||||||
found_fk:
|
found_fk:
|
||||||
|
for (ulint i = n_drop_fk; i--; ) {
|
||||||
|
if (drop_fk[i] == foreign) {
|
||||||
|
goto dup_fk;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
drop_fk[n_drop_fk++] = foreign;
|
||||||
|
dup_fk:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
DBUG_ASSERT(n_drop_fk > 0);
|
DBUG_ASSERT(n_drop_fk > 0);
|
||||||
DBUG_ASSERT(n_drop_fk
|
DBUG_ASSERT(n_drop_fk
|
||||||
== ha_alter_info->alter_info->drop_list.elements);
|
<= ha_alter_info->alter_info->drop_list.elements);
|
||||||
} else {
|
} else {
|
||||||
drop_fk = NULL;
|
drop_fk = NULL;
|
||||||
}
|
}
|
||||||
@ -4712,7 +4720,7 @@ err_exit:
|
|||||||
rename_foreign:
|
rename_foreign:
|
||||||
trx->op_info = "renaming column in SYS_FOREIGN_COLS";
|
trx->op_info = "renaming column in SYS_FOREIGN_COLS";
|
||||||
|
|
||||||
std::list<dict_foreign_t*> fk_evict;
|
std::set<dict_foreign_t*> fk_evict;
|
||||||
bool foreign_modified;
|
bool foreign_modified;
|
||||||
|
|
||||||
for (dict_foreign_set::const_iterator it = user_table->foreign_set.begin();
|
for (dict_foreign_set::const_iterator it = user_table->foreign_set.begin();
|
||||||
@ -4752,7 +4760,7 @@ rename_foreign:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (foreign_modified) {
|
if (foreign_modified) {
|
||||||
fk_evict.push_back(foreign);
|
fk_evict.insert(foreign);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4794,7 +4802,7 @@ rename_foreign:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (foreign_modified) {
|
if (foreign_modified) {
|
||||||
fk_evict.push_back(foreign);
|
fk_evict.insert(foreign);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5190,7 +5198,7 @@ commit_try_rebuild(
|
|||||||
& Alter_inplace_info::DROP_FOREIGN_KEY)
|
& Alter_inplace_info::DROP_FOREIGN_KEY)
|
||||||
|| ctx->num_to_drop_fk > 0);
|
|| ctx->num_to_drop_fk > 0);
|
||||||
DBUG_ASSERT(ctx->num_to_drop_fk
|
DBUG_ASSERT(ctx->num_to_drop_fk
|
||||||
== ha_alter_info->alter_info->drop_list.elements);
|
<= ha_alter_info->alter_info->drop_list.elements);
|
||||||
|
|
||||||
for (dict_index_t* index = dict_table_get_first_index(rebuilt_table);
|
for (dict_index_t* index = dict_table_get_first_index(rebuilt_table);
|
||||||
index;
|
index;
|
||||||
@ -5444,7 +5452,7 @@ commit_try_norebuild(
|
|||||||
& Alter_inplace_info::DROP_FOREIGN_KEY)
|
& Alter_inplace_info::DROP_FOREIGN_KEY)
|
||||||
|| ctx->num_to_drop_fk > 0);
|
|| ctx->num_to_drop_fk > 0);
|
||||||
DBUG_ASSERT(ctx->num_to_drop_fk
|
DBUG_ASSERT(ctx->num_to_drop_fk
|
||||||
== ha_alter_info->alter_info->drop_list.elements);
|
<= ha_alter_info->alter_info->drop_list.elements);
|
||||||
|
|
||||||
for (ulint i = 0; i < ctx->num_to_add_index; i++) {
|
for (ulint i = 0; i < ctx->num_to_add_index; i++) {
|
||||||
dict_index_t* index = ctx->add_index[i];
|
dict_index_t* index = ctx->add_index[i];
|
||||||
@ -5765,7 +5773,6 @@ ha_innobase::commit_inplace_alter_table(
|
|||||||
Alter_inplace_info* ha_alter_info,
|
Alter_inplace_info* ha_alter_info,
|
||||||
bool commit)
|
bool commit)
|
||||||
{
|
{
|
||||||
dberr_t error;
|
|
||||||
ha_innobase_inplace_ctx* ctx0
|
ha_innobase_inplace_ctx* ctx0
|
||||||
= static_cast<ha_innobase_inplace_ctx*>
|
= static_cast<ha_innobase_inplace_ctx*>
|
||||||
(ha_alter_info->handler_ctx);
|
(ha_alter_info->handler_ctx);
|
||||||
@ -5845,7 +5852,7 @@ ha_innobase::commit_inplace_alter_table(
|
|||||||
transactions collected during crash recovery could be
|
transactions collected during crash recovery could be
|
||||||
holding InnoDB locks only, not MySQL locks. */
|
holding InnoDB locks only, not MySQL locks. */
|
||||||
|
|
||||||
error = row_merge_lock_table(
|
dberr_t error = row_merge_lock_table(
|
||||||
prebuilt->trx, ctx->old_table, LOCK_X);
|
prebuilt->trx, ctx->old_table, LOCK_X);
|
||||||
|
|
||||||
if (error != DB_SUCCESS) {
|
if (error != DB_SUCCESS) {
|
||||||
@ -6030,9 +6037,9 @@ rollback_trx:
|
|||||||
file operations that will be performed in
|
file operations that will be performed in
|
||||||
commit_cache_rebuild(), and if none, generate
|
commit_cache_rebuild(), and if none, generate
|
||||||
the redo log for these operations. */
|
the redo log for these operations. */
|
||||||
error = fil_mtr_rename_log(ctx->old_table,
|
dberr_t error = fil_mtr_rename_log(
|
||||||
ctx->new_table,
|
ctx->old_table, ctx->new_table, ctx->tmp_name,
|
||||||
ctx->tmp_name, &mtr);
|
&mtr);
|
||||||
if (error != DB_SUCCESS) {
|
if (error != DB_SUCCESS) {
|
||||||
/* Out of memory or a problem will occur
|
/* Out of memory or a problem will occur
|
||||||
when renaming files. */
|
when renaming files. */
|
||||||
@ -6157,39 +6164,30 @@ rollback_trx:
|
|||||||
/* Rename the tablespace files. */
|
/* Rename the tablespace files. */
|
||||||
commit_cache_rebuild(ctx);
|
commit_cache_rebuild(ctx);
|
||||||
|
|
||||||
error = innobase_update_foreign_cache(ctx, user_thd);
|
if (innobase_update_foreign_cache(ctx, user_thd)
|
||||||
if (error != DB_SUCCESS) {
|
!= DB_SUCCESS
|
||||||
goto foreign_fail;
|
&& prebuilt->trx->check_foreigns) {
|
||||||
}
|
|
||||||
} else {
|
|
||||||
error = innobase_update_foreign_cache(ctx, user_thd);
|
|
||||||
|
|
||||||
if (error != DB_SUCCESS) {
|
|
||||||
foreign_fail:
|
foreign_fail:
|
||||||
/* The data dictionary cache
|
push_warning_printf(
|
||||||
should be corrupted now. The
|
user_thd,
|
||||||
best solution should be to
|
Sql_condition::WARN_LEVEL_WARN,
|
||||||
kill and restart the server,
|
ER_ALTER_INFO,
|
||||||
but the *.frm file has not
|
"failed to load FOREIGN KEY"
|
||||||
been replaced yet. */
|
" constraints");
|
||||||
my_error(ER_CANNOT_ADD_FOREIGN,
|
}
|
||||||
MYF(0));
|
|
||||||
sql_print_error(
|
|
||||||
"InnoDB: dict_load_foreigns()"
|
|
||||||
" returned %u for %s",
|
|
||||||
(unsigned) error,
|
|
||||||
thd_query_string(user_thd)
|
|
||||||
->str);
|
|
||||||
ut_ad(0);
|
|
||||||
} else {
|
} else {
|
||||||
if (!commit_cache_norebuild(
|
bool fk_fail = innobase_update_foreign_cache(
|
||||||
ctx, table, trx)) {
|
ctx, user_thd) != DB_SUCCESS;
|
||||||
ut_a(!prebuilt->trx->check_foreigns);
|
|
||||||
|
if (!commit_cache_norebuild(ctx, table, trx)) {
|
||||||
|
fk_fail = true;
|
||||||
|
ut_ad(!prebuilt->trx->check_foreigns);
|
||||||
}
|
}
|
||||||
|
|
||||||
innobase_rename_columns_cache(
|
innobase_rename_columns_cache(ha_alter_info, table,
|
||||||
ha_alter_info, table,
|
|
||||||
ctx->new_table);
|
ctx->new_table);
|
||||||
|
if (fk_fail && prebuilt->trx->check_foreigns) {
|
||||||
|
goto foreign_fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DBUG_INJECT_CRASH("ib_commit_inplace_crash",
|
DBUG_INJECT_CRASH("ib_commit_inplace_crash",
|
||||||
|
@ -45,10 +45,10 @@ Created 1/20/1994 Heikki Tuuri
|
|||||||
|
|
||||||
#define INNODB_VERSION_MAJOR 5
|
#define INNODB_VERSION_MAJOR 5
|
||||||
#define INNODB_VERSION_MINOR 6
|
#define INNODB_VERSION_MINOR 6
|
||||||
#define INNODB_VERSION_BUGFIX 41
|
#define INNODB_VERSION_BUGFIX 42
|
||||||
|
|
||||||
#ifndef PERCONA_INNODB_VERSION
|
#ifndef PERCONA_INNODB_VERSION
|
||||||
#define PERCONA_INNODB_VERSION 84.1
|
#define PERCONA_INNODB_VERSION 84.2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Enable UNIV_LOG_ARCHIVE in XtraDB */
|
/* Enable UNIV_LOG_ARCHIVE in XtraDB */
|
||||||
|
@ -1864,6 +1864,8 @@ log_online_purge_changed_page_bitmaps(
|
|||||||
|
|
||||||
for (i = 0; i < bitmap_files.count; i++) {
|
for (i = 0; i < bitmap_files.count; i++) {
|
||||||
|
|
||||||
|
char full_bmp_file_name[2 * FN_REFLEN + 2];
|
||||||
|
|
||||||
/* We consider the end LSN of the current bitmap, derived from
|
/* We consider the end LSN of the current bitmap, derived from
|
||||||
the start LSN of the subsequent bitmap file, to determine
|
the start LSN of the subsequent bitmap file, to determine
|
||||||
whether to remove the current bitmap. Note that bitmap_files
|
whether to remove the current bitmap. Note that bitmap_files
|
||||||
@ -1879,8 +1881,45 @@ log_online_purge_changed_page_bitmaps(
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* In some non-trivial cases the sequence of .xdb files may
|
||||||
|
have gaps. For instance:
|
||||||
|
ib_modified_log_1_0.xdb
|
||||||
|
ib_modified_log_2_<mmm>.xdb
|
||||||
|
ib_modified_log_4_<nnn>.xdb
|
||||||
|
Adding this check as a safety precaution. */
|
||||||
|
if (bitmap_files.files[i].name[0] == '\0')
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* If redo log tracking is enabled, reuse 'bmp_file_home'
|
||||||
|
from 'log_bmp_sys'. Otherwise, compose the full '.xdb' file
|
||||||
|
path from 'srv_data_home', adding a path separator if
|
||||||
|
necessary. */
|
||||||
|
if (log_bmp_sys != NULL) {
|
||||||
|
ut_snprintf(full_bmp_file_name,
|
||||||
|
sizeof(full_bmp_file_name),
|
||||||
|
"%s%s", log_bmp_sys->bmp_file_home,
|
||||||
|
bitmap_files.files[i].name);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
char separator[2] = {0, 0};
|
||||||
|
const size_t srv_data_home_len =
|
||||||
|
strlen(srv_data_home);
|
||||||
|
|
||||||
|
ut_a(srv_data_home_len < FN_REFLEN);
|
||||||
|
if (srv_data_home_len != 0 &&
|
||||||
|
srv_data_home[srv_data_home_len - 1] !=
|
||||||
|
SRV_PATH_SEPARATOR) {
|
||||||
|
separator[0] = SRV_PATH_SEPARATOR;
|
||||||
|
}
|
||||||
|
ut_snprintf(full_bmp_file_name,
|
||||||
|
sizeof(full_bmp_file_name), "%s%s%s",
|
||||||
|
srv_data_home, separator,
|
||||||
|
bitmap_files.files[i].name);
|
||||||
|
}
|
||||||
|
|
||||||
if (!os_file_delete_if_exists(innodb_file_bmp_key,
|
if (!os_file_delete_if_exists(innodb_file_bmp_key,
|
||||||
bitmap_files.files[i].name)) {
|
full_bmp_file_name)) {
|
||||||
|
|
||||||
os_file_get_last_error(TRUE);
|
os_file_get_last_error(TRUE);
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
|
@ -5132,18 +5132,6 @@ row_rename_table_for_mysql(
|
|||||||
goto funct_exit;
|
goto funct_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wait for background fts sync to finish */
|
|
||||||
for (retry = 1; dict_fts_index_syncing(table); ++retry) {
|
|
||||||
DICT_BG_YIELD(trx);
|
|
||||||
if (retry % 100 == 0) {
|
|
||||||
ib_logf(IB_LOG_LEVEL_INFO,
|
|
||||||
"Unable to rename table %s to new name"
|
|
||||||
" %s because FTS sync is running on table."
|
|
||||||
" Retrying\n",
|
|
||||||
old_name, new_name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* We use the private SQL parser of Innobase to generate the query
|
/* We use the private SQL parser of Innobase to generate the query
|
||||||
graphs needed in updating the dictionary data from system tables. */
|
graphs needed in updating the dictionary data from system tables. */
|
||||||
|
|
||||||
|
@ -185,7 +185,11 @@ fi
|
|||||||
user='@MYSQLD_USER@'
|
user='@MYSQLD_USER@'
|
||||||
|
|
||||||
su_kill() {
|
su_kill() {
|
||||||
|
if test "$USER" = "$user"; then
|
||||||
|
kill $* >/dev/null 2>&1
|
||||||
|
else
|
||||||
su - $user -s /bin/sh -c "kill $*" >/dev/null 2>&1
|
su - $user -s /bin/sh -c "kill $*" >/dev/null 2>&1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -34,7 +34,7 @@ void test_concurrently(const char *test, pthread_handler handler, int n, int m)
|
|||||||
bad= 0;
|
bad= 0;
|
||||||
|
|
||||||
diag("Testing %s with %d threads, %d iterations... ", test, n, m);
|
diag("Testing %s with %d threads, %d iterations... ", test, n, m);
|
||||||
for (i= n; i; i--)
|
for (i= 0; i < n; i++)
|
||||||
{
|
{
|
||||||
if (pthread_create(&threads[i], 0, handler, &m) != 0)
|
if (pthread_create(&threads[i], 0, handler, &m) != 0)
|
||||||
{
|
{
|
||||||
@ -43,7 +43,7 @@ void test_concurrently(const char *test, pthread_handler handler, int n, int m)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i= n; i; i--)
|
for (i= 0; i < n; i++)
|
||||||
pthread_join(threads[i], 0);
|
pthread_join(threads[i], 0);
|
||||||
|
|
||||||
now= my_interval_timer() - now;
|
now= my_interval_timer() - now;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user