lovelynewlife / oceanbase

To Support Machine Learning Prediction Query by leveraging Python UDF in oceanbase.
https://open.oceanbase.com
Other
5 stars 4 forks source link

[Bug]: Python UDF Buffer Bug with Limit and Join #6

Closed watch2bear closed 1 year ago

watch2bear commented 1 year ago

Describe the bug

Python UDF Buffer Module is designed for reading data across mulitple blocks. When SQL contains JOIN opreator and LIMIT Operator, it will occur segement fault with Buffer module.

Environment

Fast Reproduce Steps(Required)

Steps to reproduce the behavior:

  1. install oceanbase_PyUdf-OB4.1_PyUdf
  2. use obclient to connect observer
  3. create test table1 and test table 2
  4. SQL: select * from test_table1 join test_table2 limit 100

Expected behavior

Run SQL and get results correctly

Actual Behavior

ERROR 2013 (HY000): Lost connection to MySQL server during query

Additional context

Segement Fault in ob_ctype_utf8_os.cc static void ob_hash_sort_utf8mb4(const ObCharsetInfo cs, const unsigned char src, size_t srclen, unsigned long int n1, unsigned long int n2, const bool calc_end_space, hash_algo hash_algo) It may be caused by a conflict between the memory management module of oceanbase and the Buffer module.

watch2bear commented 1 year ago

SQL and Execution Plan image

Result image

Segement Fault image

CALL STACK image

lovelynewlife commented 1 year ago

This bug may be due to the misuse of expression evaluation frame in execution context, may be fixed in #8, which handle Model UDF eval in a standalone operator.