Comments (10)
Can I have a try?
from greptimedb.
Hi @killme2008 ,
Sorry for delay reply. After searching the mysql cli source code and trying mysql cli myself, I find it seems hard to just display headers without data. Maybe we should add a simple status or an empty row as a placeholder to display the header.
Here is the mysql cli output.
MySQL [(none)]> select VERSION(); +-----------+ | VERSION() | +-----------+ | 8.4.1 | +-----------+ 1 row in set (0.001 sec) MySQL [(none)]> show status where Variable_name='non-existed'; Empty set (0.002 sec)
Here is mysql cli code in display data.
if (!mysql_num_rows(result) && !quick && !column_types_flag) { my_stpcpy(buff, "Empty set"); if (opt_xml) { /* We must print XML header and footer to produce a well-formed XML even if the result set is empty (Bug#27608). */ init_pager(); print_table_data_xml(result); end_pager(); } }It will directly print fixed string "Empty set" as response. The
column_types_flag
is a mysql-cli flag. After enabling it withmysql --column-type-info -h **** -P **** -u **** -p
, I got below output.MySQL [(none)]> show status where Variable_name='non-existed'; Field 1: `Variable_name` Org_field: `Variable_name` Catalog: `def` Database: `performance_schema` Table: `session_status` Org_table: `session_status` Type: VAR_STRING Collation: utf8mb3_general_ci (33) Length: 192 Max_length: 0 Decimals: 0 Flags: NOT_NULL NO_DEFAULT_VALUE Field 2: `Value` Org_field: `Value` Catalog: `def` Database: `performance_schema` Table: `session_status` Org_table: `session_status` Type: VAR_STRING Collation: utf8mb3_general_ci (33) Length: 3072 Max_length: 0 Decimals: 0 Flags: 0 rows in set (0.008 sec)
The column info should have been contained in response data and just doesn't be displayed in mysql cli.
Could we have a simple status for
Variable_name
and make the response not empty to display column headers?Best Regards, Edward
Thank you for your investigation. Looks like the MySQL CLI doesn't display the header when the records are empty.
It already set the correct schema at
greptimedb/src/query/src/sql.rs
Lines 653 to 656 in da0c840
So i think this issue can be closed.
from greptimedb.
I am confused about where to get the value of server status variables. It seems that Greptime does not have a performance_schema
table, which is used to inspect the internal execution of the server at runtime. The information_schema
table provides metadata about the database but does not reflect the current state of the server.
from greptimedb.
... but does not reflect the current state of the server
Yes, we may need a place(a global status registry or something else) to track all related info. cc @killme2008 @MichaelScofield
from greptimedb.
I am confused about where to get the value of server status variables. It seems that Greptime does not have a
performance_schema
table, which is used to inspect the internal execution of the server at runtime. Theinformation_schema
table provides metadata about the database but does not reflect the current state of the server.
Fow now, it doesn't matter what variables should be returned by "show status". All we want is to make Navicat not complained. So I think we can simply add a regex rule in federated.rs
for "show status" first, returning empty contents, and see how Navicat satisfy about it. If Navicat then still complains some variables are missing, we can "fake" them (at last we are not really mysql, don't need to fully comply to it).
from greptimedb.
Just tried the "show status", it prints empty set. However, I think we'd better print the table header as well even there's indeed no value. Like this:
+--------------------+----------+
| Variable_name | Value |
+--------------------+----------+
+--------------------+----------+
So this issue is still opened.
from greptimedb.
Hi @MichaelScofield ,
I'm a newbie of GreptimeDB and want to make some contribution.
Can this task be assigned to me?
Best Regards,
Edward
from greptimedb.
Hi @MichaelScofield ,
I'm a newbie of GreptimeDB and want to make some contribution. Can this task be assigned to me?
Best Regards, Edward
Of course, thank you.
from greptimedb.
Hi @killme2008 ,
Sorry for delay reply.
After searching the mysql cli source code and trying mysql cli myself, I find it seems hard to just display headers without data.
Maybe we should add a simple status or an empty row as a placeholder to display the header.
Here is the mysql cli output.
MySQL [(none)]> select VERSION();
+-----------+
| VERSION() |
+-----------+
| 8.4.1 |
+-----------+
1 row in set (0.001 sec)
MySQL [(none)]> show status where Variable_name='non-existed';
Empty set (0.002 sec)
Here is mysql cli code in display data.
if (!mysql_num_rows(result) && !quick && !column_types_flag) {
my_stpcpy(buff, "Empty set");
if (opt_xml) {
/*
We must print XML header and footer
to produce a well-formed XML even if
the result set is empty (Bug#27608).
*/
init_pager();
print_table_data_xml(result);
end_pager();
}
}
It will directly print fixed string "Empty set" as response.
The column_types_flag
is a mysql-cli flag.
After enabling it with mysql --column-type-info -h **** -P **** -u **** -p
, I got below output.
MySQL [(none)]> show status where Variable_name='non-existed';
Field 1: `Variable_name`
Org_field: `Variable_name`
Catalog: `def`
Database: `performance_schema`
Table: `session_status`
Org_table: `session_status`
Type: VAR_STRING
Collation: utf8mb3_general_ci (33)
Length: 192
Max_length: 0
Decimals: 0
Flags: NOT_NULL NO_DEFAULT_VALUE
Field 2: `Value`
Org_field: `Value`
Catalog: `def`
Database: `performance_schema`
Table: `session_status`
Org_table: `session_status`
Type: VAR_STRING
Collation: utf8mb3_general_ci (33)
Length: 3072
Max_length: 0
Decimals: 0
Flags:
0 rows in set (0.008 sec)
The column info should have been contained in response data and just doesn't be displayed in mysql cli.
Could we have a simple status for Variable_name
and make the response not empty to display column headers?
Best Regards,
Edward
from greptimedb.
Just tried the "show status", it prints empty set. However, I think we'd better print the table header as well even there's indeed no value. Like this:
+--------------------+----------+ | Variable_name | Value | +--------------------+----------+ +--------------------+----------+
So this issue is still opened.
This is a blank record with the name and value are both empty strings. It's unnecessary.
from greptimedb.
Related Issues (20)
- Count with tag filter returns the unfiltered number of rows HOT 5
- Selecting distinct tags in a large dataset will cause some tags to be lost HOT 4
- Influx write endpoint ignores `precision` parameter HOT 2
- Panic "index out of bounds" while inserting a lot of data HOT 14
- Automatically archive historical data and provide downsampling capabilities
- Use opendal upstream Prometheus layer
- Comment out the parameters in the sample configuration that are linked to the system's CPU and memory.
- [Tracking Issue] `RangeReader` as input source of Index
- Workflow run 'GreptimeDB Nightly Build' failed HOT 7
- Workflow run 'Release' failed HOT 1
- Last non null mode may prune useful row groups
- Workflow run 'Release' failed HOT 1
- Workflow run 'GreptimeDB Nightly Build' failed HOT 3
- Failed to use table name which is valid in MySQL HOT 4
- HTTP 404 response for /dashboard http endpoint HOT 3
- Timeout support for MySQL and Postgres channel
- `information_schema` "database not found" when explicitly use it
- JSON format output for http query interface
- Prometheus remote write 2.0
- Workflow run 'GreptimeDB Nightly Build' failed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from greptimedb.