Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
1.1.5, 1.1.6, 1.1.7
-
None
-
None
-
2019-01, 2019-02, 2019-03
Description
MariaDB ColumnStore (mysqld porocess) crashes when any "normal" MySQL aggregate UDF is called against ColumnStore table. We can use avgcost() example function form udf_example.so:
openxs@ao756:~$ mysql -uroot --socket=/usr/local/mariadb/columnstore/mysql/lib/m ysql/mysql.sock test
|
Reading table information for completion of table and column names
|
You can turn off this feature to get a quicker startup with -A
|
|
Welcome to the MySQL monitor. Commands end with ; or \g.
|
Your MySQL connection id is 13
|
Server version: 5.5.5-10.2.15-MariaDB-log Columnstore 1.1.5-1
|
|
Copyright (c) 2009-2018 Percona LLC and/or its affiliates
|
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
|
|
Oracle is a registered trademark of Oracle Corporation and/or its
|
affiliates. Other names may be trademarks of their respective
|
owners.
|
|
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
|
|
mysql> CREATE AGGREGATE FUNCTION avgcost RETURNS REAL
|
-> SONAME 'udf_example.so';
|
Query OK, 0 rows affected (0.00 sec)
|
|
mysql> create table tcs2(id int, val int, val2 real) engine=ColumnStore;
|
Query OK, 0 rows affected (5.19 sec)
|
|
mysql> insert into tcs2 values(1,1,0.1), (2,2,0.2);
|
Query OK, 2 rows affected (1.05 sec)
|
Records: 2 Duplicates: 0 Warnings: 0
|
|
mysql> select avgcost(val,val2) from tcs2;
|
ERROR 2013 (HY000): Lost connection to MySQL server during query
|
In the error log we see:
Thread pointer: 0x7fe3c8078ce8
|
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...
|
stack_bottom = 0x7fe418f91e98 thread_stack 0x80000
|
/usr/local/mariadb/columnstore/mysql//bin/mysqld(my_print_stacktrace+0x29)[0x7fe4543be219]
|
/usr/local/mariadb/columnstore/mysql//bin/mysqld(handle_fatal_signal+0x33d)[0x7fe453ee620d]
|
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10330)[0x7fe451b85330]
|
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7fe450fc2c37]
|
linux/raise.c:56(__GI_raise)[0x7fe450fc6028]
|
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZN9__gnu_cxx27__verbose_terminate_handlerEv+0x155)[0x7fe4518d1535]
|
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x5e6d6)[0x7fe4518cf6d6]
|
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x5e703)[0x7fe4518cf703]
|
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x5e922)[0x7fe4518cf922]
|
/usr/local/mariadb/columnstore/lib/libudfsdk.so.1(_ZN8mcsv1sdk12mcsv1Context11getFunctionEv+0x1e1)[0x7fe44d933de1]
|
/usr/local/mariadb/columnstore/mysql/lib/plugin/libcalmysql.so(_ZN11cal_impl_if20buildAggregateColumnEP4ItemRNS_12gp_walk_infoE+0x11d1)[0x7fe44fcd7211]
|
/usr/local/mariadb/columnstore/mysql/lib/plugin/libcalmysql.so(_ZN11cal_impl_if13getSelectPlanERNS_12gp_walk_infoER13st_select_lexRN5boost10shared_ptrIN8execplan26CalpontSelectExecutionPlanEEEb+0x2775)[0x7fe44fce4ed5]
|
/usr/local/mariadb/columnstore/mysql/lib/plugin/libcalmysql.so(_ZN11cal_impl_if11cp_get_planEP3THDRN5boost10shared_ptrIN8execplan26CalpontSelectExecutionPlanEEE+0x8ad)[0x7fe44fcf170d]
|
/usr/local/mariadb/columnstore/mysql/lib/plugin/libcalmysql.so(_Z24ha_calpont_impl_rnd_initP5TABLE+0x607)[0x7fe44fc9d517]
|
/usr/local/mariadb/columnstore/mysql//bin/mysqld(_ZN4JOIN13exec_infinidbEv+0x233)[0x7fe453d978e3]
|
sql/handler.h:2839(handler::ha_rnd_init(bool))[0x7fe453dbc8ee]
|
sql/sql_select.cc:3626(JOIN::exec_inner())[0x7fe453dbd4d9]
|
sql/sql_select.cc:3404(JOIN::exec())[0x7fe453dbd6ee]
|
sql/sql_select.cc:4053(mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x7fe453dbe2cb]
|
sql/sql_select.cc:376(handle_select(THD*, LEX*, select_result*, unsigned long))[0x7fe453d6fb60]
|
sql/sql_parse.cc:3993(mysql_execute_command(THD*))[0x7fe453d7118f]
|
sql/sql_parse.cc:7981(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x7fe453d72273]
|
sql/sql_parse.cc:10238(idb_parse_vtable(THD*, String&, THD::infinidb_state))[0x7fe453d737ee]
|
sql/sql_parse.cc:10793(idb_vtable_process(THD*, unsigned long long, Statement*))[0x7fe453d76b1a]
|
sql/sql_parse.cc:1837(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x7fe453d77bd8]
|
sql/sql_parse.cc:1395(do_command(THD*))[0x7fe453e30f6c]
|
sql/sql_connect.cc:1335(do_handle_one_connection(CONNECT*))[0x7fe453e31084]
|
nptl/pthread_create.c:312(start_thread)[0x7fe451b7d184]
|
x86_64/clone.S:113(clone)[0x7fe45108a03d]
|
|
Trying to get some variables.
|
Some pointers may be invalid and cause the dump to abort.
|
Query (0x7fe3c801beb8): create temporary table infinidb_vtable.$vtable_14 engine = aria as select avgcost(val,val2) from tcs2
|
...
|
udf_sample.so is built in the process of building ColumnStore server:
openxs@ao756:~$ ls -l ~/git/mariadb-columnstore-server/sql/udf_example.*
|
-rw-rw-r-- 1 openxs openxs 33714 чер 20 20:11 /home/openxs/git/mariadb-columnstore-server/sql/udf_example.c
|
-rw-rw-r-- 1 openxs openxs 458 лют 8 2017 /home/openxs/git/mariadb-columnstore-server/sql/udf_example.def
|
-rwxrwxr-x 1 openxs openxs 54547 сер 15 07:50 /home/openxs/git/mariadb-columnstore-server/sql/udf_example.so
|
I understand that (aggregate) UDFs for ColumnStore are created using different SDK etc, but it is not normal to accept creating function and then just crash when it is called. I'd expect some error message explaining that UDF is not defined at ColumnStore level instead.