Skip to content
New issue

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

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

Already on GitHub? # to your account

Meta info in mysql response #1456

Closed
sanikolaev opened this issue Sep 21, 2023 · 4 comments
Closed

Meta info in mysql response #1456

sanikolaev opened this issue Sep 21, 2023 · 4 comments
Assignees

Comments

@sanikolaev
Copy link
Collaborator

It would be nice if we could show the most important query meta info right in the mysql response without the need to do SHOW META, e.g.:

mysql> select * from hackernews;
Empty set (0.00 sec)
Time: 0.000877 sec., total found: 0

The task is to research how feasible it is and implement. Things to check:

  • in what mysql clients it would work
  • whether there would be any issue with Buddy
@tomatolog
Copy link
Contributor

SendMysqlOkPacket already has a sMessage argument and any text there looks like one-liner at reply message

mysql> select * from hackernews;
Empty set (0.00 sec)
any text - Time: 0.000877 sec., total found: 0

@sanikolaev
Copy link
Collaborator Author

An idea of what it might look like combining total, total_found, total_relation and time:

mysql> select * from hackernews limit 0;
Empty set (0.00 sec)
--- 0 out of 1115 results in 115 ms ---

mysql> select * from t
+---------------------+
| id                  |
+---------------------+
| 1515532189620502761 |
| 1515532189620502801 |
| 1515532189620502762 |
| 1515532189620502802 |
| 1515532189620502800 |
| 1515532189620502760 |
| 1515532189620502758 |
| 1515532189620502798 |
| 1515532189620502759 |
| 1515532189620502799 |
| 1515532189620502694 |
| 1515532189620502718 |
| 1515532189620502716 |
| 1515532189620502692 |
| 1515532189620502693 |
| 1515532189620502647 |
| 1515532189620502648 |
| 1515532189620502623 |
| 1515532189620502583 |
| 1515532189620502582 |
+---------------------+
20 rows in set (5.12 sec)
--- 20 out of >= 20 results in 5.123 sec ---

@sanikolaev
Copy link
Collaborator Author

Note from today's dev call: many tests may fail when we implement this. We'll have to update them or do smth else.

@sanikolaev
Copy link
Collaborator Author

As discuss with Alexey on the call of Oct 2 2023, there's a function which can display time in human-readable format. We can use it.

klirichek added a commit that referenced this issue Oct 4, 2023
Emit lines like
--- 2 out of 2 results in 0ms ---
into OK packet at the end of resultset (that implies, client supports
emitting OK instead of EOF; old clients work old way, i.e. without such
lines.

That closes #1456 (github)
@sanikolaev sanikolaev added the rel::upcoming Upcoming release label Oct 4, 2023
@sanikolaev sanikolaev added rel::6.3.0 Released in 6.3.0 and removed rel::upcoming Upcoming release labels May 23, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants