duckdb / duckdb_mysql

https://duckdb.org/docs/extensions/mysql
MIT License
55 stars 13 forks source link

SHOW ALL TABLES; Query causes INTERNAL Error: MySQLResult::Next called without result #94

Open JayJamieson opened 3 weeks ago

JayJamieson commented 3 weeks ago

What happens?

Loaded mysql extension per documentation, attached and set mysql_debug_show_queries=true. Ran the SHOW ALL TABLES; query and error occurred. As per below.

v1.1.2 f680b7d08f
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
D load mysql;
D attach 'host=localhost user=root password=password port=3306 database=multi_tenant' as mysqldb (type MYSQL);
D use mysqldb;
D set mysql_debug_show_queries=true;
D SHOW ALL TABLES;
SET character_set_results = 'utf8mb4';

SET character_set_results = 'utf8mb4';

START TRANSACTION

SELECT table_name, column_name, data_type, column_type, column_default, is_nullable, numeric_precision, numeric_scale
FROM information_schema.columns
WHERE table_schema='multi_tenant'
ORDER BY table_name, ordinal_position;

ROLLBACK

INTERNAL Error: MySQLResult::Next called without result
This error signals an assertion failure within DuckDB. This usually occurs due to unexpected conditions or errors in the program's logic.
For more information, see https://duckdb.org/docs/dev/internal_errors

To Reproduce

Run mysql with following docker compose configuration:

version: '3'
services:
  db:
    image: mysql:8
    restart: always
    ports:
      - 3306:3306
    environment:
      MYSQL_DATABASE: multi_tenant
      MYSQL_ROOT_PASSWORD: password

Start DuckDB CLI shell and run following commands in order

install mysql; # skip if already installed?
load mysql;
attach 'host=localhost user=root password=password port=3306 database=multi_tenant' as mysqldb (type MYSQL);
use mysqldb;
set mysql_debug_show_queries=true;
SHOW ALL TABLES;

Observe SHOW ALL TABLES; causes INTERNAL Error: MySQLResult::Next called without result

OS:

Linux silver-slab 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

MySQL Version:

8

DuckDB Version:

v1.1.2 f680b7d08f

DuckDB Client:

CLI

Full Name:

Jay Jamieson

Affiliation:

None

Have you tried this on the latest main branch?

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?