Merge pull request #55962 from Algunenano/show_databases_limit

Fix `SHOW DATABASES LIMIT <N>`
This commit is contained in:
Raúl Marín 2023-10-25 10:27:43 +02:00 committed by GitHub
commit bee9eb5df4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 5 deletions

View File

@ -473,7 +473,7 @@ Shows all [users](../../guides/sre/user-management/index.md#user-account-managem
``` sql
SHOW ACCESS
```
## SHOW CLUSTER(s)
## SHOW CLUSTER(S)
Returns a list of clusters. All available clusters are listed in the [system.clusters](../../operations/system-tables/clusters.md) table.

View File

@ -48,12 +48,12 @@ String InterpreterShowTablesQuery::getRewrittenQuery()
<< DB::quote << query.like;
}
if (query.limit_length)
rewritten_query << " LIMIT " << query.limit_length;
/// (*)
rewritten_query << " ORDER BY name";
if (query.limit_length)
rewritten_query << " LIMIT " << query.limit_length;
return rewritten_query.str();
}
@ -158,7 +158,7 @@ String InterpreterShowTablesQuery::getRewrittenQuery()
else if (query.where_expression)
rewritten_query << " AND (" << query.where_expression << ")";
/// (*)
/// (*)
rewritten_query << " ORDER BY name ";
if (query.limit_length)

View File

@ -0,0 +1 @@
SHOW DATABASES LIMIT 0;