Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.6, 10.11, 11.4, 11.8
Description
INSTALL SONAME 'ha_spider'; |
|
|
SET spider_same_server_link = ON; |
--eval create server s foreign data wrapper mysql options (host "127.0.0.1", database "test", user "root", port $MASTER_MYPORT)
|
CREATE TABLE t (f INT); |
INSERT INTO t VALUES (1),(2); |
SET @a = 4; |
SET @a = NULL; |
CREATE TABLE t_spider LIKE t; |
ALTER TABLE t_spider ENGINE=SPIDER COMMENT = 'wrapper "mysql", srv "s", table "t"'; |
DELETE FROM t_spider WHERE f > 0 or f < @a; |
SELECT * FROM t_spider; |
On a non-debug build, SELECT returns both rows, even though they should have been deleted:
|
main 5bcc115d773caac07d4afd42252e08f3905452b0 |
Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead. |
DELETE FROM t_spider WHERE f > 0 or f < @a; |
SELECT * FROM t_spider; |
f
|
1
|
2
|
In the general log we can see that there is no DELETE from the underlying table, Spider bails out early:
3 Query DELETE FROM t_spider WHERE f > 0 or f < @a
|
6 Connect root@localhost on using SSL/TLS
|
6 Query set session time_zone = '+00:00';set @`spider_lc_./test/t` = '-74563cb22275-3ae990-./test/t_spider-'
|
6 Query SET NAMES utf8mb4
|
6 Init DB test
|
6 Query set @old_lock_wait_timeout=@@session.lock_wait_timeout;set session lock_wait_timeout=1
|
6 Query show table status from `test` like 't'
|
6 Query set session lock_wait_timeout=@old_lock_wait_timeout
|
6 Query set @old_lock_wait_timeout=@@session.lock_wait_timeout;set session lock_wait_timeout=1
|
6 Query show index from `test`.`t`
|
6 Query set session lock_wait_timeout=@old_lock_wait_timeout
|
6 Quit
|
On a debug buld, DELETE results in an assertion failure:
mariadbd: /data/bld/main-asan-ubsan/sql/protocol.cc:639: void Protocol::end_statement(): Assertion `0' failed.
|
260202 18:55:28 [ERROR] /share8t/bld/main-asan-ubsan/sql/mariadbd got signal 6 ;
|
|
|
#8 0x00007f1663645472 in __GI_abort () at ./stdlib/abort.c:79
|
#9 0x00007f1663645395 in __assert_fail_base (fmt=0x7f16637b9a90 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5653fc267da0 "0", file=file@entry=0x5653fc265d00 "/data/bld/main-asan-ubsan/sql/protocol.cc", line=line@entry=639, function=function@entry=0x5653fc267cc0 "void Protocol::end_statement()") at ./assert/assert.c:92
|
#10 0x00007f1663653eb2 in __GI___assert_fail (assertion=0x5653fc267da0 "0", file=0x5653fc265d00 "/data/bld/main-asan-ubsan/sql/protocol.cc", line=639, function=0x5653fc267cc0 "void Protocol::end_statement()") at ./assert/assert.c:101
|
#11 0x00005653f7efe3b9 in Protocol::end_statement (this=this@entry=0x62c0000b08f8) at /data/bld/main-asan-ubsan/sql/protocol.cc:639
|
#12 0x00005653f856bde3 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x62c0000b0218, packet=<optimized out>, packet@entry=0x629000140219 "DELETE FROM t_spider WHERE f > 0 or f < @a", packet_length=packet_length@entry=42, blocking=blocking@entry=true) at /data/bld/main-asan-ubsan/sql/sql_parse.cc:2446
|
#13 0x00005653f857063b in do_command (thd=thd@entry=0x62c0000b0218, blocking=blocking@entry=true) at /data/bld/main-asan-ubsan/sql/sql_parse.cc:1432
|
#14 0x00005653f8dd7146 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x6080000082b8, put_in_cache=put_in_cache@entry=true) at /data/bld/main-asan-ubsan/sql/sql_connect.cc:1503
|
#15 0x00005653f8dd82af in handle_one_connection (arg=0x6080000082b8) at /data/bld/main-asan-ubsan/sql/sql_connect.cc:1415
|
#16 0x00005653faa35dc1 in pfs_spawn_thread (arg=0x617000007798) at /data/bld/main-asan-ubsan/storage/perfschema/pfs.cc:2198
|
#17 0x00007f16636a81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
|
#18 0x00007f166372885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
|
|
|
Connection ID (thread ID): 3
|
Status: NOT_KILLED
|
Query (0x62d0000fa438): DELETE FROM t_spider WHERE f > 0 or f < @a
|
For the assertion failure, f > 0 OR is not needed, it fails with must f < @a, I added the alternative to demonstrate the wrong result.
Reproducible on all of 10.6-main, although including old 10.6 releases.