mysqltest: At line 1380: query 'insert into v3(a,b) select * from t2' failed with wrong errno 2013: 'Lost connection to MySQL server during query', instead of 1393...
The result from queries just before the failure was:
< snip >
select * from v3;
a b
2 1
300 1
2 3
300 3
deallocate prepare stmt1;
drop view v3,v2;
drop tables t1,t2;
create table t1 (a int, primary key (a), b int);
create table t2 (a int, primary key (a), b int);
insert into t2 values (1000, 2000);
create view v3 (a,b) as select t1.a as a, t2.a as b from t1, t2;
insert into v3 values (1,2);
ERROR HY000: Can not insert into join view 'test.v3' without fields list
insert into v3 select * from t2;
ERROR HY000: Can not insert into join view 'test.v3' without fields list
insert into v3(a,b) values (1,2);
ERROR HY000: Can not modify more than one base table through a join view 'test.v3'
insert into v3(a,b) select * from t2;
Server version: 10.2.14-MariaDB-debug-log
key_buffer_size=1048576
read_buffer_size=131072
max_used_connections=1
max_threads=153
thread_count=2
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 63177 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x7f3c5c000a98
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
Writing a core file at /home/alice/git/10.2/mysql-test/var/mysqld.1/data/
----------SERVER LOG END-------------
Thread 1 (Thread 0x7f3c782d0700 (LWP 31990)):
#0 __pthread_kill (threadid=<optimized out>, signo=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
#1 0x000055c9f9d96bea in my_write_core (sig=11) at /home/alice/git/10.2/mysys/stacktrace.c:477
#2 0x000055c9f962945f in handle_fatal_signal (sig=11) at /home/alice/git/10.2/sql/signal_handler.cc:305
#3 <signal handler called>
#4 0x000055c9f9c9f217 in maria_end_bulk_insert (info=0x0) at /home/alice/git/10.2/storage/maria/ma_write.c:1793
#5 0x000055c9f9c2706d in ha_maria::end_bulk_insert (this=0x7f3c5c1d8110) at /home/alice/git/10.2/storage/maria/ha_maria.cc:2222
#6 0x000055c9f939df6b in handler::ha_end_bulk_insert (this=0x7f3c5c1d8110) at /home/alice/git/10.2/sql/handler.h:2905
#7 0x000055c9f939bb98 in select_insert::abort_result_set (this=0x7f3c5c1d8930) at /home/alice/git/10.2/sql/sql_insert.cc:3932
#8 0x000055c9f93f68eb in handle_select (thd=0x7f3c5c000a98, lex=0x7f3c5c004578, result=0x7f3c5c1d8930, setup_tables_done_option=1073741824) at /home/alice/git/10.2/sql/sql_select.cc:382
#9 0x000055c9f93bb692 in mysql_execute_command (thd=0x7f3c5c000a98) at /home/alice/git/10.2/sql/sql_parse.cc:4525
#10 0x000055c9f93c61e0 in mysql_parse (thd=0x7f3c5c000a98, rawbuf=0x7f3c5c1bdc80 "insert into v3(a,b) select * from t2", length=36, parser_state=0x7f3c782cf1f0, is_com_multi=false, is_next_command=false) at /home/alice/git/10.2/sql/sql_parse.cc:7902
#11 0x000055c9f93b3e0f in dispatch_command (command=COM_QUERY, thd=0x7f3c5c000a98, packet=0x7f3c5c082089 "insert into v3(a,b) select * from t2", packet_length=36, is_com_multi=false, is_next_command=false) at /home/alice/git/10.2/sql/sql_parse.cc:1806
#12 0x000055c9f93b276b in do_command (thd=0x7f3c5c000a98) at /home/alice/git/10.2/sql/sql_parse.cc:1360
#13 0x000055c9f9500ee9 in do_handle_one_connection (connect=0x55c9fbca1ba8) at /home/alice/git/10.2/sql/sql_connect.cc:1335
#14 0x000055c9f9500c69 in handle_one_connection (arg=0x55c9fbca1ba8) at /home/alice/git/10.2/sql/sql_connect.cc:1241
#15 0x000055c9f985e8ce in pfs_spawn_thread (arg=0x55c9fbc46ee8) at /home/alice/git/10.2/storage/perfschema/pfs.cc:1862
#16 0x00007f3c7e4396ba in start_thread (arg=0x7f3c782d0700) at pthread_create.c:333
#17 0x00007f3c7d8ce41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
Attachments
Issue Links
is duplicated by
MDEV-18148Server crashes in ha_maria::end_bulk_insert
Closed
MDEV-19420Server crashes in ha_maria::extra upon erroneous INSERT
Closed
relates to
MDEV-18451Server crashes in maria_create_trn_for_mysql upon ALTER TABLE
CREATETABLE t1 ( f1 int , f2 int , f3 int , f4 int);
CREATETABLE t2 ( f1 int , f2 int , f3 int , f4 int);
CREATEVIEW v1 AS
SELECT t2.f1, t1.f2, t2.f3, t2.f4 FROM (t1 JOIN t2);
REPLACEINTO v1 (f1, f2, f3, f4)
SELECT f1, f2, f3, f4 FROM t1;
Alice Sherepa
added a comment - test case from MDEV-18148 :
set big_tables= ON ;
CREATE TABLE t1 ( f1 int , f2 int , f3 int , f4 int );
CREATE TABLE t2 ( f1 int , f2 int , f3 int , f4 int );
CREATE VIEW v1 AS
SELECT t2.f1, t1.f2, t2.f3, t2.f4 FROM (t1 JOIN t2);
REPLACE INTO v1 (f1, f2, f3, f4)
SELECT f1, f2, f3, f4 FROM t1;
CREATE TRIGGER tr BEFORE UPDATE ON t2 FOR EACH ROW SET @a = 1;
CREATE VIEW v AS SELECT a, b FROM t1 JOIN t2;
--error ER_BAD_FIELD_ERROR
INSERT INTO v (x) SELECT 1;
# Cleanup
DROP VIEW v;
DROP TABLE t1, t2;
Oleksandr Byelkin
added a comment - test suite for 10.2 and above
CREATE TABLE t1 (a INT, b BLOB);
CREATE TABLE t2 (c INT);
CREATE TRIGGER tr BEFORE UPDATE ON t2 FOR EACH ROW SET @a = 1;
CREATE VIEW v AS SELECT a, b FROM t1 JOIN t2;
--error ER_BAD_FIELD_ERROR
INSERT INTO v (x) SELECT 1;
# Cleanup
DROP VIEW v;
DROP TABLE t1, t2;
will be NULL. In that case, we still need to execute the rollback
and the end of the function.
*/
- if (table)
+ if (table && table->query_id)
{
bool changed, transactional_table;
/*
"official" way of getting known that TABLE is not opened should be found or the check should be used with check of being internal temporary table.
Oleksandr Byelkin
added a comment - The problem is that we are trying to deal with not opened table of view dummy.
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 4005153cb64..3bcff7bdd56 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -3945,7 +3945,7 @@ void select_insert::abort_result_set() {
will be NULL. In that case, we still need to execute the rollback
and the end of the function.
*/
- if (table)
+ if (table && table->query_id)
{
bool changed, transactional_table;
/*
"official" way of getting known that TABLE is not opened should be found or the check should be used with check of being internal temporary table.
Still reproducible.