Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
38d36b59
Commit
38d36b59
authored
Sep 07, 2022
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.4 into 10.5
parents
38dda1f0
c7ba2377
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
569 additions
and
315 deletions
+569
-315
mysql-test/suite/innodb/r/innodb-index-online.result
mysql-test/suite/innodb/r/innodb-index-online.result
+1
-2
mysql-test/suite/innodb/t/innodb-index-online.test
mysql-test/suite/innodb/t/innodb-index-online.test
+1
-5
mysql-test/suite/innodb_fts/r/misc_debug2.result
mysql-test/suite/innodb_fts/r/misc_debug2.result
+14
-0
mysql-test/suite/innodb_fts/t/misc_debug2.test
mysql-test/suite/innodb_fts/t/misc_debug2.test
+15
-0
mysql-test/suite/rpl/r/rpl_filter_revoke_missing_user.result
mysql-test/suite/rpl/r/rpl_filter_revoke_missing_user.result
+39
-0
mysql-test/suite/rpl/t/rpl_filter_revoke_missing_user.test
mysql-test/suite/rpl/t/rpl_filter_revoke_missing_user.test
+92
-0
plugin/disks/information_schema_disks.cc
plugin/disks/information_schema_disks.cc
+7
-7
sql/log_event_server.cc
sql/log_event_server.cc
+7
-0
sql/share/errmsg-utf8.txt
sql/share/errmsg-utf8.txt
+3
-2
sql/sql_acl.cc
sql/sql_acl.cc
+3
-1
sql/sql_class.h
sql/sql_class.h
+2
-0
storage/innobase/fts/fts0fts.cc
storage/innobase/fts/fts0fts.cc
+1
-1
storage/spider/mysql-test/spider/bugfix/r/mdev_27172.result
storage/spider/mysql-test/spider/bugfix/r/mdev_27172.result
+84
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_27172.cnf
storage/spider/mysql-test/spider/bugfix/t/mdev_27172.cnf
+3
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_27172.test
storage/spider/mysql-test/spider/bugfix/t/mdev_27172.test
+92
-0
storage/spider/spd_db_conn.cc
storage/spider/spd_db_conn.cc
+117
-126
storage/spider/spd_db_include.h
storage/spider/spd_db_include.h
+9
-8
storage/spider/spd_db_mysql.cc
storage/spider/spd_db_mysql.cc
+45
-127
storage/spider/spd_db_mysql.h
storage/spider/spd_db_mysql.h
+34
-36
No files found.
mysql-test/suite/innodb/r/innodb-index-online.result
View file @
38d36b59
...
...
@@ -358,7 +358,7 @@ SET @rowlog_decrypt_1=
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
connection con1;
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL c2f_created WAIT_FOR dml3_done';
ALTER TABLE t1 ADD INDEX c2f(c2
)
;
ALTER TABLE t1 ADD INDEX c2f(c2
2f), CHANGE c2 c22f INT
;
connection default;
SET DEBUG_SYNC = 'now WAIT_FOR c2f_created';
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
...
...
@@ -397,7 +397,6 @@ SET DEBUG_SYNC = 'now SIGNAL dml3_done';
connection con1;
Warnings:
Note 1831 Duplicate index `c2f`. This is deprecated and will be disallowed in a future release
ALTER TABLE t1 CHANGE c2 c22f INT;
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
name count
ddl_background_drop_indexes 0
...
...
mysql-test/suite/innodb/t/innodb-index-online.test
View file @
38d36b59
...
...
@@ -318,9 +318,7 @@ connection con1;
# Accumulate and apply some modification log.
SET
DEBUG_SYNC
=
'row_log_apply_before SIGNAL c2f_created WAIT_FOR dml3_done'
;
--
send
# FIXME: MDEV-13668
#ALTER TABLE t1 ADD INDEX c2f(c22f), CHANGE c2 c22f INT;
ALTER
TABLE
t1
ADD
INDEX
c2f
(
c2
);
ALTER
TABLE
t1
ADD
INDEX
c2f
(
c22f
),
CHANGE
c2
c22f
INT
;
connection
default
;
SET
DEBUG_SYNC
=
'now WAIT_FOR c2f_created'
;
...
...
@@ -345,8 +343,6 @@ SET DEBUG_SYNC = 'now SIGNAL dml3_done';
connection
con1
;
reap
;
# FIXME: MDEV-13668
ALTER
TABLE
t1
CHANGE
c2
c22f
INT
;
eval
$innodb_metrics_select
;
...
...
mysql-test/suite/innodb_fts/r/misc_debug2.result
View file @
38d36b59
...
...
@@ -6,3 +6,17 @@ INSERT INTO mdev21563 VALUES('This is a test');
ALTER TABLE mdev21563 DISCARD TABLESPACE;
# restart
DROP TABLE mdev21563;
#
# MDEV-29342 Assertion failure in file que0que.cc line 728
#
CREATE TABLE t1(f1 CHAR(100), FULLTEXT idx(f1))ENGINE=InnoDB;
INSERT INTO t1 VALUES('mysql'), ('innodb');
set debug_dbug="+d,fts_instrument_sync_debug";
INSERT INTO t1 VALUES('test');
set debug_dbug="-d,fts_instrument_sync_debug";
INSERT INTO t1 VALUES('This is a fts issue');
# restart
set debug_dbug="+d,fts_instrument_sync_debug";
UPDATE t1 SET f1="mariadb";
set debug_dbug="-d,fts_instrument_sync_debug";
DROP TABLE t1;
mysql-test/suite/innodb_fts/t/misc_debug2.test
View file @
38d36b59
...
...
@@ -10,3 +10,18 @@ INSERT INTO mdev21563 VALUES('This is a test');
ALTER
TABLE
mdev21563
DISCARD
TABLESPACE
;
--
source
include
/
restart_mysqld
.
inc
DROP
TABLE
mdev21563
;
--
echo
#
--
echo
# MDEV-29342 Assertion failure in file que0que.cc line 728
--
echo
#
CREATE
TABLE
t1
(
f1
CHAR
(
100
),
FULLTEXT
idx
(
f1
))
ENGINE
=
InnoDB
;
INSERT
INTO
t1
VALUES
(
'mysql'
),
(
'innodb'
);
set
debug_dbug
=
"+d,fts_instrument_sync_debug"
;
INSERT
INTO
t1
VALUES
(
'test'
);
set
debug_dbug
=
"-d,fts_instrument_sync_debug"
;
INSERT
INTO
t1
VALUES
(
'This is a fts issue'
);
--
source
include
/
restart_mysqld
.
inc
set
debug_dbug
=
"+d,fts_instrument_sync_debug"
;
UPDATE
t1
SET
f1
=
"mariadb"
;
set
debug_dbug
=
"-d,fts_instrument_sync_debug"
;
DROP
TABLE
t1
;
mysql-test/suite/rpl/r/rpl_filter_revoke_missing_user.result
0 → 100644
View file @
38d36b59
include/master-slave.inc
[connection master]
#
# Set replica to ignore system tables
connection slave;
include/stop_slave.inc
SET @@GLOBAL.replicate_wild_ignore_table="mysql.%";
include/start_slave.inc
#
# Trying to execute REVOKE ALL PRIVILEGES on a non-existent user and
# DROP USER on a list of users where not all users exist should error
# and be written into the binary log
connection master;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'nonexistentuser'@'%';
ERROR HY000: Can't revoke all privileges for one or more of the requested users
CREATE USER 'testuser'@'localhost' IDENTIFIED by '';
DROP USER 'testuser'@'localhost', 'nonexistentuser'@'%';
ERROR HY000: Operation DROP USER failed for 'nonexistentuser'@'%'
#
# Ensure the events exist in the primary's binary log
FLUSH BINARY LOGS;
# MYSQL_BINLOG MYSQLD_DATADIR/binlog_file > MYSQL_TMP_DIR/mysqlbinlog_out.sql
# There should be three Query events: REVOKE, CREATE USER, and DROP USER
FOUND 3 /Query/ in mysqlbinlog_out.sql
FOUND 1 /REVOKE ALL PRIVILEGES/ in mysqlbinlog_out.sql
FOUND 1 /CREATE USER/ in mysqlbinlog_out.sql
FOUND 1 /DROP USER/ in mysqlbinlog_out.sql
#
# Ensure that the replica receives the event without error
connection slave;
Last_SQL_Error =
Last_SQL_Errno = 0
#
# Clean up
connection slave;
include/stop_slave.inc
SET @@GLOBAL.replicate_wild_ignore_table="";
include/start_slave.inc
include/rpl_end.inc
mysql-test/suite/rpl/t/rpl_filter_revoke_missing_user.test
0 → 100644
View file @
38d36b59
#
# Purpose:
# This test ensures that a binlogged Query_log_event which failed on the
# primary server does not break replication if it is ignored by Grant_tables
# on the replica. The bug reported by MDEV-28530 shows this with
# REVOKE ALL PRIVILEGES.. using a non-existent user. The primary will binlog
# the REVOKE command with an error code, and the replica will think the command
# executed with success because the replication filter will ignore the command
# while accessing the Grant_tables classes. When the replica performs an error
# check, it sees the difference between the error codes, and replication
# breaks.
#
# Methodology:
# Using a replica configured with replicate_wild_ignore_table="schema.%",
# on the primary, execute REVOKE ALL PRVILEGES using a non-existent user and
# DROP USER using a list of users where not all users exist, and ensure that
# the replica acknowledges and ignores the events without erroring.
#
# References:
# MDEV-28530: Revoking privileges from a non-existing user on a master breaks
# replication on the slave in the presence of replication filters
#
source
include
/
master
-
slave
.
inc
;
source
include
/
have_binlog_format_statement
.
inc
;
--
echo
#
--
echo
# Set replica to ignore system tables
connection
slave
;
let
$old_filter
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Replicate_Wild_Ignore_Table
,
1
);
source
include
/
stop_slave
.
inc
;
SET
@@
GLOBAL
.
replicate_wild_ignore_table
=
"mysql.%"
;
source
include
/
start_slave
.
inc
;
--
echo
#
--
echo
# Trying to execute REVOKE ALL PRIVILEGES on a non-existent user and
--
echo
# DROP USER on a list of users where not all users exist should error
--
echo
# and be written into the binary log
--
connection
master
--
error
1269
REVOKE
ALL
PRIVILEGES
,
GRANT
OPTION
FROM
'nonexistentuser'
@
'%'
;
CREATE
USER
'testuser'
@
'localhost'
IDENTIFIED
by
''
;
--
error
1396
DROP
USER
'testuser'
@
'localhost'
,
'nonexistentuser'
@
'%'
;
--
save_master_pos
--
echo
#
--
echo
# Ensure the events exist in the primary's binary log
--
let
$MYSQLD_DATADIR
=
`select @@datadir`
--
let
$binlog_file
=
query_get_value
(
SHOW
MASTER
STATUS
,
File
,
1
)
FLUSH
BINARY
LOGS
;
--
echo
# MYSQL_BINLOG MYSQLD_DATADIR/binlog_file > MYSQL_TMP_DIR/mysqlbinlog_out.sql
--
exec
$MYSQL_BINLOG
$MYSQLD_DATADIR
/
$binlog_file
>
$MYSQL_TMP_DIR
/
mysqlbinlog_out
.
sql
--
echo
# There should be three Query events: REVOKE, CREATE USER, and DROP USER
--
let
SEARCH_FILE
=
$MYSQL_TMP_DIR
/
mysqlbinlog_out
.
sql
--
let
SEARCH_PATTERN
=
Query
--
source
include
/
search_pattern_in_file
.
inc
--
let
SEARCH_PATTERN
=
REVOKE
ALL
PRIVILEGES
--
source
include
/
search_pattern_in_file
.
inc
--
let
SEARCH_PATTERN
=
CREATE
USER
--
source
include
/
search_pattern_in_file
.
inc
--
let
SEARCH_PATTERN
=
DROP
USER
--
source
include
/
search_pattern_in_file
.
inc
--
echo
#
--
echo
# Ensure that the replica receives the event without error
connection
slave
;
--
sync_with_master
let
$error
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Last_SQL_Error
,
1
);
--
echo
Last_SQL_Error
=
$error
let
$errno
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Last_SQL_Errno
,
1
);
--
echo
Last_SQL_Errno
=
$errno
--
echo
#
--
echo
# Clean up
--
connection
slave
source
include
/
stop_slave
.
inc
;
--
eval
SET
@@
GLOBAL
.
replicate_wild_ignore_table
=
"
$old_filter
"
source
include
/
start_slave
.
inc
;
--
source
include
/
rpl_end
.
inc
plugin/disks/information_schema_disks.cc
View file @
38d36b59
...
...
@@ -108,7 +108,7 @@ static int disks_table_add_row_stat(
#else
if
(
info
.
f_flags
&
MNT_RDONLY
)
#endif
return
0
;
return
0
;
pTable
->
field
[
0
]
->
store
(
zDisk
,
strlen
(
zDisk
),
system_charset_info
);
pTable
->
field
[
1
]
->
store
(
zPath
,
strlen
(
zPath
),
system_charset_info
);
...
...
@@ -214,15 +214,15 @@ static int disks_fill_table(THD* pThd, TABLE_LIST* pTables, Item* pCond)
)
{
struct
stat
f
;
const
char
*
path
,
*
point
;
const
char
*
path
,
*
point
;
#ifdef HAVE_SETMNTENT
path
=
pEnt
->
mnt_dir
;
point
=
pEnt
->
mnt_fsname
;
path
=
pEnt
->
mnt_dir
;
point
=
pEnt
->
mnt_fsname
;
#else
path
=
pEnt
->
mnt_mountp
;
point
=
pEnt
->
mnt_special
;
path
=
pEnt
->
mnt_mountp
;
point
=
pEnt
->
mnt_special
;
#endif
// Try to keep to real storage by excluding
// Try to keep to real storage by excluding
// read only mounts, and mount points that aren't directories
if
(
hasmntopt
(
pEnt
,
MNTOPT_RO
)
!=
NULL
)
continue
;
...
...
sql/log_event_server.cc
View file @
38d36b59
...
...
@@ -1912,6 +1912,13 @@ int Query_log_event::do_apply_event(rpl_group_info *rgi,
thd
->
update_server_status
();
log_slow_statement
(
thd
);
thd
->
lex
->
restore_set_statement_var
();
/*
When THD::slave_expected_error gets reset inside execution stack
that is the case of to be ignored event. In this case the expected
error must change to the reset value as well.
*/
expected_error
=
thd
->
slave_expected_error
;
}
thd
->
variables
.
option_bits
&=
~
OPTION_MASTER_SQL_ERROR
;
...
...
sql/share/errmsg-utf8.txt
View file @
38d36b59
...
...
@@ -7144,8 +7144,9 @@ ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS
chi "语句不安全,因为它在访问同一事务中访问事务表后访问非事务性表"
eng "Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction"
ER_MESSAGE_AND_STATEMENT
chi "%s语句:%s"
eng "%s Statement: %s"
chi "%s.语句:%s"
eng "%s. Statement: %s"
ER_SLAVE_CONVERSION_FAILED
chi "列%d表'%-.192s.%-.192s'无法从'%-.50s'类型为'%-.50s'"
eng "Column %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'"
...
...
sql/sql_acl.cc
View file @
38d36b59
...
...
@@ -2094,9 +2094,11 @@ class Grant_tables
some kind of updates to the mysql.% tables.
*/
Rpl_filter
*
rpl_filter
=
thd
->
system_thread_info
.
rpl_sql_info
->
rpl_filter
;
if
(
rpl_filter
->
is_on
()
&&
!
rpl_filter
->
tables_ok
(
0
,
tables
))
{
thd
->
slave_expected_error
=
0
;
DBUG_RETURN
(
1
);
}
}
DBUG_RETURN
(
0
);
}
...
...
sql/sql_class.h
View file @
38d36b59
...
...
@@ -3361,6 +3361,8 @@ class THD: public THD_count, /* this must be first */
/*
In case of a slave, set to the error code the master got when executing
the query. 0 if no error on the master.
The stored into variable master error code may get reset inside
execution stack when the event turns out to be ignored.
*/
int
slave_expected_error
;
enum_sql_command
last_sql_command
;
// Last sql_command exceuted in mysql_execute_command()
...
...
storage/innobase/fts/fts0fts.cc
View file @
38d36b59
...
...
@@ -2642,7 +2642,7 @@ fts_cmp_set_sync_doc_id(
}
mutex_exit
(
&
cache
->
doc_id_lock
);
if
(
cmp_doc_id
>
*
doc_id
)
{
if
(
cmp_doc_id
&&
cmp_doc_id
>=
*
doc_id
)
{
error
=
fts_update_sync_doc_id
(
table
,
cache
->
synced_doc_id
,
trx
);
}
...
...
storage/spider/mysql-test/spider/bugfix/r/mdev_27172.result
0 → 100644
View file @
38d36b59
#
# MDEV-27172 Prefix indices on Spider tables may lead to wrong query results
#
for master_1
for child2
child2_1
child2_2
child2_3
for child3
connection child2_1;
SET @general_log_backup = @@global.general_log;
SET @log_output_backup = @@global.log_output;
SET @@global.general_log = 1;
SET @@global.log_output = "TABLE";
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
CREATE TABLE tbl_a (
id int NOT NULL,
greeting VARCHAR(255),
KEY(greeting)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE tbl_b (
id int NOT NULL,
greeting VARCHAR(255),
KEY k (greeting(5))
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE tbl_c (
id int NOT NULL,
greeting TEXT,
KEY k (greeting(5))
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
TRUNCATE TABLE mysql.general_log;
connection master_1;
CREATE DATABASE auto_test_local;
USE auto_test_local;
CREATE TABLE tbl_a (
id int NOT NULL,
greeting VARCHAR(255),
KEY k (greeting)
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
INSERT INTO tbl_a VALUES (1, "Hi!"),(2, "Aloha!"),(3, "Aloha!!!");
SELECT * FROM tbl_a WHERE greeting = "Aloha!"
AND CASE greeting WHEN "Aloha!" THEN "one" ELSE 'more' END = "one";
id greeting
2 Aloha!
CREATE TABLE tbl_b (
id int NOT NULL,
greeting VARCHAR(255),
KEY k (greeting(5))
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_b", srv "s_2_1"';
INSERT INTO tbl_b VALUES (1, "Hi!"),(2, "Aloha!"),(3, "Aloha!!!");
SELECT * FROM tbl_b WHERE greeting = "Aloha!"
AND CASE greeting WHEN "Aloha!" THEN "one" ELSE 'more' END = "one";
id greeting
2 Aloha!
CREATE TABLE tbl_c (
id int NOT NULL,
greeting TEXT,
KEY k (greeting(5))
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_c", srv "s_2_1"';
INSERT INTO tbl_c VALUES (1, "Hi!"),(2, "Aloha!"),(3, "Aloha!!!");
SELECT * FROM tbl_c WHERE greeting = "Aloha!"
AND CASE greeting WHEN "Aloha!" THEN "one" ELSE 'more' END = "one";
id greeting
2 Aloha!
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE 'select %';
argument
select `id`,`greeting` from `auto_test_remote`.`tbl_a` where `greeting` = 'Aloha!' and ((`greeting` = 'Aloha!'))
select `id`,`greeting` from `auto_test_remote`.`tbl_b` where `greeting` like 'Aloha%' and ((`greeting` = 'Aloha!'))
select `id`,`greeting` from `auto_test_remote`.`tbl_c` where `greeting` like 'Aloha%' and ((`greeting` = 'Aloha!'))
SELECT argument FROM mysql.general_log WHERE argument LIKE 'select %'
connection child2_1;
SET @@global.general_log = @general_log_backup;
SET @@global.log_output = @log_output_backup;
DROP DATABASE auto_test_remote;
connection master_1;
DROP DATABASE auto_test_local;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
storage/spider/mysql-test/spider/bugfix/t/mdev_27172.cnf
0 → 100644
View file @
38d36b59
!include include/default_mysqld.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
storage/spider/mysql-test/spider/bugfix/t/mdev_27172.test
0 → 100644
View file @
38d36b59
--
echo
#
--
echo
# MDEV-27172 Prefix indices on Spider tables may lead to wrong query results
--
echo
#
--
disable_query_log
--
disable_result_log
--
source
../../
t
/
test_init
.
inc
--
enable_result_log
--
enable_query_log
--
connection
child2_1
SET
@
general_log_backup
=
@@
global
.
general_log
;
SET
@
log_output_backup
=
@@
global
.
log_output
;
SET
@@
global
.
general_log
=
1
;
SET
@@
global
.
log_output
=
"TABLE"
;
CREATE
DATABASE
auto_test_remote
;
USE
auto_test_remote
;
eval
CREATE
TABLE
tbl_a
(
id
int
NOT
NULL
,
greeting
VARCHAR
(
255
),
KEY
(
greeting
)
)
$CHILD2_1_ENGINE
$CHILD2_1_CHARSET
;
eval
CREATE
TABLE
tbl_b
(
id
int
NOT
NULL
,
greeting
VARCHAR
(
255
),
KEY
k
(
greeting
(
5
))
)
$CHILD2_1_ENGINE
$CHILD2_1_CHARSET
;
eval
CREATE
TABLE
tbl_c
(
id
int
NOT
NULL
,
greeting
TEXT
,
KEY
k
(
greeting
(
5
))
)
$CHILD2_1_ENGINE
$CHILD2_1_CHARSET
;
TRUNCATE
TABLE
mysql
.
general_log
;
--
connection
master_1
CREATE
DATABASE
auto_test_local
;
USE
auto_test_local
;
# = (equality)
eval
CREATE
TABLE
tbl_a
(
id
int
NOT
NULL
,
greeting
VARCHAR
(
255
),
KEY
k
(
greeting
)
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
COMMENT
=
'table "tbl_a", srv "s_2_1"'
;
INSERT
INTO
tbl_a
VALUES
(
1
,
"Hi!"
),(
2
,
"Aloha!"
),(
3
,
"Aloha!!!"
);
SELECT
*
FROM
tbl_a
WHERE
greeting
=
"Aloha!"
AND
CASE
greeting
WHEN
"Aloha!"
THEN
"one"
ELSE
'more'
END
=
"one"
;
# hack to disable GBH
# LIKE
eval
CREATE
TABLE
tbl_b
(
id
int
NOT
NULL
,
greeting
VARCHAR
(
255
),
KEY
k
(
greeting
(
5
))
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
COMMENT
=
'table "tbl_b", srv "s_2_1"'
;
INSERT
INTO
tbl_b
VALUES
(
1
,
"Hi!"
),(
2
,
"Aloha!"
),(
3
,
"Aloha!!!"
);
SELECT
*
FROM
tbl_b
WHERE
greeting
=
"Aloha!"
AND
CASE
greeting
WHEN
"Aloha!"
THEN
"one"
ELSE
'more'
END
=
"one"
;
# hack to disable GBH
# LIKE
eval
CREATE
TABLE
tbl_c
(
id
int
NOT
NULL
,
greeting
TEXT
,
KEY
k
(
greeting
(
5
))
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
COMMENT
=
'table "tbl_c", srv "s_2_1"'
;
INSERT
INTO
tbl_c
VALUES
(
1
,
"Hi!"
),(
2
,
"Aloha!"
),(
3
,
"Aloha!!!"
);
SELECT
*
FROM
tbl_c
WHERE
greeting
=
"Aloha!"
AND
CASE
greeting
WHEN
"Aloha!"
THEN
"one"
ELSE
'more'
END
=
"one"
;
# hack to disable GBH
--
connection
child2_1
SELECT
argument
FROM
mysql
.
general_log
WHERE
argument
LIKE
'select %'
;
--
connection
child2_1
SET
@@
global
.
general_log
=
@
general_log_backup
;
SET
@@
global
.
log_output
=
@
log_output_backup
;
DROP
DATABASE
auto_test_remote
;
--
connection
master_1
DROP
DATABASE
auto_test_local
;
--
disable_query_log
--
disable_result_log
--
source
../../
t
/
test_deinit
.
inc
--
enable_result_log
--
enable_query_log
storage/spider/spd_db_conn.cc
View file @
38d36b59
This diff is collapsed.
Click to expand it.
storage/spider/spd_db_include.h
View file @
38d36b59
/* Copyright (C) 2008-2020 Kentoku Shiba
Copyright (C) 2019
-2020 MariaDB corp
Copyright (C) 2019
, 2022, MariaDB Corporation.
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
...
...
@@ -101,6 +101,8 @@ typedef st_spider_result SPIDER_RESULT;
#define SPIDER_SQL_DOT_STR "."
#define SPIDER_SQL_DOT_LEN (sizeof(SPIDER_SQL_DOT_STR) - 1)
#define SPIDER_SQL_PERCENT_STR "%"
#define SPIDER_SQL_PERCENT_LEN (sizeof(SPIDER_SQL_PERCENT_STR) - 1)
#define SPIDER_SQL_HYPHEN_STR "-"
#define SPIDER_SQL_HYPHEN_LEN (sizeof(SPIDER_SQL_HYPHEN_STR) - 1)
...
...
@@ -172,6 +174,8 @@ typedef st_spider_result SPIDER_RESULT;
#define SPIDER_SQL_IN_LEN (sizeof(SPIDER_SQL_IN_STR) - 1)
#define SPIDER_SQL_NOT_IN_STR "not in("
#define SPIDER_SQL_NOT_IN_LEN (sizeof(SPIDER_SQL_NOT_IN_STR) - 1)
#define SPIDER_SQL_LIKE_STR " like "
#define SPIDER_SQL_LIKE_LEN (sizeof(SPIDER_SQL_LIKE_STR) - 1)
#define SPIDER_SQL_NOT_LIKE_STR "not like"
#define SPIDER_SQL_NOT_LIKE_LEN (sizeof(SPIDER_SQL_NOT_LIKE_STR) - 1)
#define SPIDER_SQL_AS_CHAR_STR " as char"
...
...
@@ -853,13 +857,10 @@ class spider_db_util
virtual
int
append_escaped_name_quote
(
spider_string
*
str
)
=
0
;
virtual
int
append_column_value
(
ha_spider
*
spider
,
spider_string
*
str
,
Field
*
field
,
const
uchar
*
new_ptr
,
CHARSET_INFO
*
access_charset
)
=
0
;
virtual
int
append_column_value
(
ha_spider
*
spider
,
spider_string
*
str
,
Field
*
field
,
const
uchar
*
new_ptr
,
bool
is_like
,
CHARSET_INFO
*
access_charset
)
=
0
;
virtual
int
append_trx_isolation
(
spider_string
*
str
,
int
trx_isolation
...
...
storage/spider/spd_db_mysql.cc
View file @
38d36b59
This diff is collapsed.
Click to expand it.
storage/spider/spd_db_mysql.h
View file @
38d36b59
...
...
@@ -22,37 +22,33 @@ class spider_db_mbase_util: public spider_db_util
spider_string
*
str
,
const
char
*
name
,
uint
name_length
);
)
override
;
int
append_name_with_charset
(
spider_string
*
str
,
const
char
*
name
,
uint
name_length
,
CHARSET_INFO
*
name_charset
);
)
override
;
int
append_escaped_name
(
spider_string
*
str
,
const
char
*
name
,
uint
name_length
);
)
override
;
int
append_escaped_name_with_charset
(
spider_string
*
str
,
const
char
*
name
,
uint
name_length
,
CHARSET_INFO
*
name_charset
);
)
override
;
bool
is_name_quote
(
const
char
head_code
);
)
override
;
int
append_escaped_name_quote
(
spider_string
*
str
);
int
append_column_value
(
ha_spider
*
spider
,
spider_string
*
str
,
Field
*
field
,
const
uchar
*
new_ptr
,
CHARSET_INFO
*
access_charset
);
)
override
;
int
append_column_value
(
ha_spider
*
spider
,
spider_string
*
str
,
Field
*
field
,
const
uchar
*
new_ptr
,
bool
is_like
,
CHARSET_INFO
*
access_charset
)
override
;
int
append_from_with_alias
(
spider_string
*
str
,
const
char
**
table_names
,
...
...
@@ -66,19 +62,19 @@ class spider_db_mbase_util: public spider_db_util
int
append_trx_isolation
(
spider_string
*
str
,
int
trx_isolation
);
)
override
;
int
append_autocommit
(
spider_string
*
str
,
bool
autocommit
);
)
override
;
int
append_sql_log_off
(
spider_string
*
str
,
bool
sql_log_off
);
)
override
;
int
append_wait_timeout
(
spider_string
*
str
,
int
wait_timeout
);
)
override
;
virtual
int
append_sql_mode_internal
(
spider_string
*
str
,
sql_mode_t
sql_mode
...
...
@@ -86,25 +82,25 @@ class spider_db_mbase_util: public spider_db_util
int
append_sql_mode
(
spider_string
*
str
,
sql_mode_t
sql_mode
);
)
override
;
int
append_time_zone
(
spider_string
*
str
,
Time_zone
*
time_zone
);
)
override
;
int
append_loop_check
(
spider_string
*
str
,
SPIDER_CONN
*
conn
);
)
override
;
int
append_start_transaction
(
spider_string
*
str
);
)
override
;
int
append_xa_start
(
spider_string
*
str
,
XID
*
xid
);
)
override
;
int
append_lock_table_head
(
spider_string
*
str
);
)
override
;
int
append_lock_table_body
(
spider_string
*
str
,
const
char
*
db_name
,
...
...
@@ -114,13 +110,13 @@ class spider_db_mbase_util: public spider_db_util
uint
table_name_length
,
CHARSET_INFO
*
table_name_charset
,
int
lock_type
);
)
override
;
int
append_lock_table_tail
(
spider_string
*
str
);
)
override
;
int
append_unlock_table
(
spider_string
*
str
);
)
override
;
int
open_item_func
(
Item_func
*
item_func
,
ha_spider
*
spider
,
...
...
@@ -129,7 +125,7 @@ class spider_db_mbase_util: public spider_db_util
uint
alias_length
,
bool
use_fields
,
spider_fields
*
fields
);
)
override
;
#ifdef HANDLER_HAS_DIRECT_AGGREGATE
int
open_item_sum_func
(
Item_sum
*
item_sum
,
...
...
@@ -139,12 +135,12 @@ class spider_db_mbase_util: public spider_db_util
uint
alias_length
,
bool
use_fields
,
spider_fields
*
fields
);
)
override
;
#endif
int
append_escaped_util
(
spider_string
*
to
,
String
*
from
);
)
override
;
#ifdef SPIDER_HAS_GROUP_BY_HANDLER
int
append_table
(
ha_spider
*
spider
,
...
...
@@ -186,18 +182,18 @@ class spider_db_mbase_util: public spider_db_util
spider_string
*
str
,
TABLE_LIST
*
table_list
,
uint
table_count
);
)
override
;
int
reappend_tables
(
spider_fields
*
fields
,
SPIDER_LINK_IDX_CHAIN
*
link_idx_chain
,
spider_string
*
str
);
)
override
;
int
append_where
(
spider_string
*
str
);
)
override
;
int
append_having
(
spider_string
*
str
);
)
override
;
#endif
bool
append_charset_name_before_string
();
};
...
...
@@ -212,8 +208,9 @@ class spider_db_mysql_util: public spider_db_mbase_util
spider_string
*
str
,
Field
*
field
,
const
uchar
*
new_ptr
,
bool
is_like
,
CHARSET_INFO
*
access_charset
);
)
override
;
};
class
spider_db_mariadb_util
:
public
spider_db_mbase_util
...
...
@@ -224,14 +221,15 @@ class spider_db_mariadb_util: public spider_db_mbase_util
int
append_sql_mode_internal
(
spider_string
*
str
,
sql_mode_t
sql_mode
);
)
override
;
int
append_column_value
(
ha_spider
*
spider
,
spider_string
*
str
,
Field
*
field
,
const
uchar
*
new_ptr
,
bool
is_like
,
CHARSET_INFO
*
access_charset
);
)
override
;
};
class
spider_db_mbase_row
:
public
spider_db_row
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment