Content-Length: 239756 | pFad | http://github.com/vitessio/vitess/issues/17904

DF Bug Report: create table statement breaks if database.table is specified and column of type text with optional lenght · Issue #17904 · vitessio/vitess · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: create table statement breaks if database.table is specified and column of type text with optional lenght #17904

Open
LuigiMiazzo17 opened this issue Mar 5, 2025 · 3 comments

Comments

@LuigiMiazzo17
Copy link

Overview of the Issue

An Unknown database 'db_name' error is returned when a table is created with the CREATE TABLE statement specifying both db_name.table_name (assuming the keyspace db_name exists) for the table name and at least one column is of type TEXT(m), where m is the optional maximum lenght used to determine which kind of text type the column is as described in the mysql docs. If either the lenght or the database name is removed, then it works as expected.

Reproduction Steps

After creating a keyspace, run the following query:
CREATE TABLE keyspace_name.table (col TEXT(1024));.

Observe the error.

Binary Version

vitess/lite:v21.0.0

Operating System and Environment details

Deployed with the vitess operator

Log Fragments

ERROR 1049 (42000): target: db_name.-.primary: vttablet: rpc error: code = InvalidArgument desc = Unknown database 'db_name' (errno 1049) (sqlstate 42000) (CallerID: db_name): Sql: "create table db_name.table (col TEXT(256))", BindVars: {}
@LuigiMiazzo17 LuigiMiazzo17 added Needs Triage This issue needs to be correctly labelled and triaged Type: Bug labels Mar 5, 2025
@shlomi-noach shlomi-noach added Component: Query Serving Type: Question and removed Needs Triage This issue needs to be correctly labelled and triaged labels Mar 10, 2025
@shlomi-noach
Copy link
Contributor

what does select database(); show databases; return? Is db_name a placeholder name here, and can you share the specific name you were using?

@LuigiMiazzo17
Copy link
Author

As in this other issue I opened, db_name is just a placeholder. The requested output is the following:

mysql> select database(); show databases;
+------------+
| database() |
+------------+
| keycloak   |
+------------+
1 row in set (0.06 sec)

+--------------------+
| Database           |
+--------------------+
| keycloak           |
| information_schema |
| mysql              |
| sys                |
| performance_schema |
+--------------------+
5 rows in set (0.04 sec)

@shlomi-noach
Copy link
Contributor

Confirmed. On an examples/101 cluster:

mysql> drop table if exists tbl; CREATE TABLE commerce.tbl (col TEXT);
Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.02 sec)

mysql> drop table if exists tbl; CREATE TABLE commerce.tbl (col TEXT(1024));
Query OK, 0 rows affected (0.01 sec)

ERROR 1049 (42000): target: commerce.0.primary: vttablet: rpc error: code = InvalidArgument desc = Unknown database 'commerce' (errno 1049) (sqlstate 42000) (CallerID: userData1): Sql: "CREATE TABLE commerce.tbl (col TEXT(1024))", BindVars: {}

mysql> drop table if exists tbl; CREATE TABLE tbl (col TEXT(1024));
Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.03 sec)

mysql> show create table tbl\G
*************************** 1. row ***************************
       Table: tbl
Create Table: CREATE TABLE `tbl` (
  `col` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
1 row in set (0.01 sec)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/vitessio/vitess/issues/17904

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy