[MDEV-14869] Server 10.2.11 Crash when running an stored procedured recurring event, that uses an ODBC table via CONNECT Table engine Created: 2018-01-04  Updated: 2018-01-07

Status: Open
Project: MariaDB Server
Component/s: Data Definition - Alter Table, Data Manipulation - Insert, Data Manipulation - Update, Events, Storage Engine - Connect
Affects Version/s: 10.2.11
Fix Version/s: 10.2

Type: Bug Priority: Major
Reporter: Francisco Dueñas Assignee: Olivier Bertrand
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Windows 10 64 bit, DBISAM ODBC


Attachments: File ServerWEB.err     File evERPActualizaDatosRemotos_Event.sql     File spERPActualizarCupones_Procedure.sql     File spSysExecuteSQL_procedure.sql     File sqlTable_structs.sql    

 Description   

Hi when running an stored procedure via a recurring event, after some time the vent is executed, the server crashes.

The stored procedure read data from an external DMISAM (elevatesoft.com) database via ODBC connector and CONNECT engine, and then updates that data in mysql tables.

The server not always crashes in the same sql sentence, but always throws the same kinf of error:

I have attached the error LOG and the sql for the stored procedures I Use.

If you need more sample data (DBISAM) to test please let me know

180103 18:03:43 [ERROR] mysqld got exception 0xc0000005 ;
 
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed, 
something is definitely wrong and this may fail.
 
Server version: 10.2.11-MariaDB
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=2
max_threads=2001
thread_count=9
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 293753 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x857ebb2f88
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
dbodbc.dll!SQLAllocHandle()
ODBC32.dll!VFreeErrors()
ODBC32.dll!SQLSetConnectAttrW()
ODBC32.dll!SQLSetEnvAttr()
ODBC32.dll!SQLDriverConnect()
ha_connect.dll!?GetTable@ODBCDEF@@UEAAPEAVTDB@@PEAU_global@@W4MODE@@@Z()
ha_connect.dll!?GetTable@ODBCDEF@@UEAAPEAVTDB@@PEAU_global@@W4MODE@@@Z()
ha_connect.dll!?GetTable@ODBCDEF@@UEAAPEAVTDB@@PEAU_global@@W4MODE@@@Z()
ha_connect.dll!GetTraceValue()
ha_connect.dll!?MaxRange@XXROW@@UEAAHXZ()
ha_connect.dll!?MaxVal@?$TYPVAL@G@@KA_KXZ()
mysqld.exe!handler::ha_rnd_init_with_error()[handler.cc:2784]
mysqld.exe!init_read_record()[records.cc:299]
mysqld.exe!join_init_read_record()[sql_select.cc:19557]
mysqld.exe!sub_select()[sql_select.cc:18635]
mysqld.exe!do_select()[sql_select.cc:18182]
mysqld.exe!JOIN::exec_inner()[sql_select.cc:3516]
mysqld.exe!JOIN::exec()[sql_select.cc:3310]
mysqld.exe!mysql_select()[sql_select.cc:3711]
mysqld.exe!handle_select()[sql_select.cc:361]
mysqld.exe!mysql_execute_command()[sql_parse.cc:3932]
mysqld.exe!sp_instr_stmt::exec_core()[sp_head.cc:3266]
mysqld.exe!sp_lex_keeper::reset_lex_and_exec_core()[sp_head.cc:3027]
mysqld.exe!sp_instr_stmt::execute()[sp_head.cc:3180]
mysqld.exe!sp_head::execute()[sp_head.cc:1336]
mysqld.exe!sp_head::execute_procedure()[sp_head.cc:2135]
mysqld.exe!do_execute_sp()[sql_parse.cc:2887]
mysqld.exe!mysql_execute_command()[sql_parse.cc:5797]
mysqld.exe!sp_instr_stmt::exec_core()[sp_head.cc:3266]
mysqld.exe!sp_lex_keeper::reset_lex_and_exec_core()[sp_head.cc:3027]
mysqld.exe!sp_instr_stmt::execute()[sp_head.cc:3180]
mysqld.exe!sp_head::execute()[sp_head.cc:1336]
mysqld.exe!sp_head::execute_procedure()[sp_head.cc:2135]
mysqld.exe!Event_job_data::execute()[event_data_objects.cc:1433]
mysqld.exe!Event_worker_thread::run()[event_scheduler.cc:313]
mysqld.exe!event_worker_thread()[event_scheduler.cc:268]
mysqld.exe!pthread_start()[my_winthread.c:62]
mysqld.exe!thread_start<unsigned int (__cdecl*)(void * __ptr64)>()[thread.cpp:115]
KERNEL32.DLL!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x857eadc3a0): CREATE TEMPORARY TABLE __cuponesLOG__ ENGINE=MEMORY
 
 SELECT (@__idx := @__idx+1) AS ID, LOGTablaID, tipoLogID, condicionSQL FROM 
 
  DatosCupones_LogTabla WHERE (procesado=0) AND tabla='Cupones' LIMIT 10
Connection ID (thread ID): 106
Status: NOT_KILLED
 
Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on
 
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.



 Comments   
Comment by Olivier Bertrand [ 2018-01-07 ]

This is fairly complex. I don't have DBISAM installed and not sure of how to do to try reproduce this error (defining the data source, having data generated...)

Meanwhile some comments:

Looking in ServerWEB.err, it seems that the crash does not occur in CONNECT code but in the dbodbc.dll code. I cannot do much about that.

In the ODBC remote table create statements, you should not define index. Indexing is done by DBISAM, not by CONNECT. And anyway, CONNECT indexing does not use BTREE. Try to test all this after removing the index definitions and let me know whether it makes a difference.

Thanks,
Olivier

Generated at Thu Feb 08 08:16:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.