raku-community-modules / DBIish

Database interface for Raku
89 stars 32 forks source link

Some MySQL administrative queries return empty results #237

Open bbkr opened 1 month ago

bbkr commented 1 month ago

Some queries from https://dev.mysql.com/doc/refman/8.4/en/sql-server-administration-statements.html works fine. I can get output of SHOW TABLES or SHOW COLUMNS FROM sometable.

But some queries like SHOW GRANTS or SHOW CREATE TABLE sometable just return empty result, with no error message.

I've checked grants by logging using the same credentials to database from mysql client direclty and i can see output of all commands, so it is not grants issue.

Raku 2024.07 DBIish current as ow writing this task MySQL 8.0 vanilla from dockerhub

bbkr commented 1 month ago

I found weird workaround:

$database.execute( 'SHOW CREATE TABLE foo' ).allrows().say;

is not working (returning Empty list), but wrapping it in server side prepared statement works just fine:

$database.execute( 'PREPARE foo FROM "SHOW CREATE TABLE foo"' );
$database.execute( 'EXECUTE foo' ).allrows().say;

:)

bbkr commented 1 month ago

I wonder if this is caused by returned data type. Everything that returns information_schema columns directly (like SHOW TABLES) works, everything that is somehow concatenating various information schema info (like SHOW CREATE TABLE foo) does not.