[MDEV-22200] mysqldump client: --tab export with column names header row Created: 2020-04-09  Updated: 2022-10-27  Resolved: 2022-10-26

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients
Fix Version/s: 10.11.1

Type: Task Priority: Major
Reporter: Zachary Vance Assignee: Daniel Black
Resolution: Fixed Votes: 0
Labels: beginner-friendly

Issue Links:
Problem/Incident
causes MDEV-29889 mysqldump --tab --header is slow Closed

 Description   

I think

--tab

export would be improved if there was an option to export a row of column headers. This is a very standard CSV format.

Ex. rather than just the .sql file, you could have an output like:

"City","State","Zip"
"New York","New York","10001"
"Washington","District of Columbia","20002"

Perhaps

--prefix-data-by-column-names

, which can only be used together with

--tab

, would match the style of other options.



 Comments   
Comment by Rui Alves [ 2021-10-24 ]

I have submitted the PR #1937 on this issue, which provides a new option --header.
Invoking mysqldump database --tab <path> --header adds a header row with column names to the text files generated by --tab. The options --fields-terminated-by, --fields-enclosed-by, --fields-optionally-enclosed-by and --lines-terminated-by also apply to the header row. If the --header option is used without a leading --tab option, an error occurs

Comment by Daniel Black [ 2022-10-26 ]

Thank you very much rmfalves for writing this.

Comment by Sergei Golubchik [ 2022-10-26 ]

Quoting fixed in https://github.com/MariaDB/server/commit/768a10d02a

Comment by Zachary Vance [ 2022-10-26 ]

Thanks! I think this will make CSV export better

Comment by Daniel Black [ 2022-10-27 ]

> Quoting fixed in https://github.com/MariaDB/server/commit/768a10d02a

Thanks serg.

Generated at Thu Feb 08 09:12:57 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.