[Bug 12372] New: feature request: debian/scripts/koha-mysql should be able to handle arbitrary mysql arguments.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Bug ID: 12372 Summary: feature request: debian/scripts/koha-mysql should be able to handle arbitrary mysql arguments. Change sponsored?: --- Product: Koha Version: 3.14 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: gmcharlt@gmail.com Reporter: barton@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org The call to 'mysql' in /home/koha/kohaclone/debian/scripts/koha-mysql looks like this: mysql --host="$mysqlhost" --user="$mysqluser" --password="$mysqlpass" \ "$mysqldb" If $name were shifted off the argument stack, rather than simply assigned from $1, we could then pass the rest of the arguments directly to mysql: mysql --host="$mysqlhost" --user="$mysqluser" --password="$mysqlpass" \ "$mysqldb" "$@" This would make the koha-mysql command far more flexible at the command line, for instance koha-mysql mybranch --vertical or koha-mysql mybranch --html or koha-mysql mybranch --table would all be possible. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Ian Bays <ian.bays@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ian.bays@ptfs-europe.com --- Comment #1 from Ian Bays <ian.bays@ptfs-europe.com> --- Just to add support for this request as simple things like using -N to suppress column headings is not possible once at the mysql prompt. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Barton Chittenden <barton@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|3.14 |master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Barton Chittenden <barton@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |barton@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 --- Comment #2 from Barton Chittenden <barton@bywatersolutions.com> --- Created attachment 40322 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40322&action=edit Bug 12372: koha-mysql: process any mysql args -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Barton Chittenden <barton@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Barton Chittenden <barton@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40322|0 |1 is obsolete| | --- Comment #3 from Barton Chittenden <barton@bywatersolutions.com> --- Created attachment 40323 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40323&action=edit Bug 12372: koha-mysql: process any mysql args -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Ian Bays <ian.bays@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Ian Bays <ian.bays@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40323|0 |1 is obsolete| | --- Comment #4 from Ian Bays <ian.bays@ptfs-europe.com> --- Created attachment 40379 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40379&action=edit Bug 12372: koha-mysql: process any mysql args Signed-off-by: Ian Bays <ian.bays@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |jonathan.druart@biblibre.co | |m, tomascohen@gmail.com --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- I am not an expert at all of the debian scripts, but it seems that in others, there are 2 errors raised if the usage is incorrect: I would suggest to die "Missing instance name..." if the number of arg is not correct and warn "Unknown instance $name." if is_instance returns 0. Ccing Tomas to be sure I am not wrong. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #5)
I am not an expert at all of the debian scripts, but it seems that in others, there are 2 errors raised if the usage is incorrect:
I would suggest to die "Missing instance name..." if the number of arg is not correct and warn "Unknown instance $name." if is_instance returns 0.
Ccing Tomas to be sure I am not wrong.
Yeah, Barton, please replicate the structure from scripts like koha-enable while you are on it. Thanks -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 --- Comment #7 from Barton Chittenden <barton@bywatersolutions.com> --- Created attachment 40526 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40526&action=edit Standardized argument parsing for koha-mysql. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Barton Chittenden <barton@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40379|0 |1 is obsolete| | --- Comment #8 from Barton Chittenden <barton@bywatersolutions.com> --- Created attachment 40527 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40527&action=edit Bug 12372: (QA followup) Standardized argument parsing for koha-mysql. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 --- Comment #9 from Barton Chittenden <barton@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #5)
I am not an expert at all of the debian scripts, but it seems that in others, there are 2 errors raised if the usage is incorrect:
I would suggest to die "Missing instance name..." if the number of arg is not correct and warn "Unknown instance $name." if is_instance returns 0.
Ccing Tomas to be sure I am not wrong.
Ok, I've followed the convention set by koha-enable as closely as possible. In the context of the script, it didn't make sense to have the "Unknown instance" message be a warning. We're only processing a single instance, and if we don't die when we get a bad instance name, we'll get all of the calls to xmlstartlet and the call to mysql throwing confusing messages to stderr, and the script will fail anyway. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Barton Chittenden <barton@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40526|0 |1 is obsolete| | --- Comment #10 from Barton Chittenden <barton@bywatersolutions.com> --- Comment on attachment 40526 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40526 Standardized argument parsing for koha-mysql. This should have been obsoleted by the following patch. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Barton Chittenden <barton@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40379|1 |0 is obsolete| | --- Comment #11 from Barton Chittenden <barton@bywatersolutions.com> --- Comment on attachment 40379 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40379 Bug 12372: koha-mysql: process any mysql args Was accidentally obsoleted -- reversing. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Barton Chittenden <barton@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14443 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 --- Comment #12 from Barton Chittenden <barton@bywatersolutions.com> --- Update koha-mysql man page: bug 14443 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Barton Chittenden <barton@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|feature request: |Make koha-mysql handle |debian/scripts/koha-mysql |arbitrary mysql arguments |should be able to handle | |arbitrary mysql arguments. | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 --- Comment #13 from Barton Chittenden <barton@bywatersolutions.com> --- TODO: Update debian/docs/koha-mysql.xml: The synopsis should change to koha-mysql INSTANCE-NAME [ mysql arguments ] Also, the '-e' option is now available, so the example usage may change to koha-mysql {instancename} -e "Some SQL query" It would also be useful to provide an explicit example of a mysql argument whose functionality was previously entirely unavailable, e.g. koha-mysql {instancename} --skip-column-names 'See Also' should mention mysql. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 --- Comment #14 from Barton Chittenden <barton@bywatersolutions.com> --- *** Bug 14443 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 --- Comment #15 from Barton Chittenden <barton@bywatersolutions.com> --- Created attachment 41243 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41243&action=edit Updated man pages for koha-mysql -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 --- Comment #16 from Barton Chittenden <barton@bywatersolutions.com> --- Updated man page: KOHA-MYSQL(8) NAME koha-mysql - Provide a mysql shell set up for the specified Koha instance. SYNOPSIS koha-mysql {instancename} [mysql option...] DESCRIPTION Provide a mysql shell set up for the specified Koha instance. EXAMPLE USAGE Run interactive mysql shell for speicified Koha instance koha-mysql {instancename} Run a query given as an argument without launching mysql shell koha-mysql {instancename} -e "SOME SQL QUERY" Run a query, skip column names on output koha-mysql {instancename} -e "SOME SQL QUERY" --skip-column-names Load a database dump (e.g. one produced by mysqldump) into the database of the given instance koha-mysql {instancename} < /path/to/mysqldump.sql SEE ALSO mysql (1), koha-dump-defaults(8), koha-reset-passwd(8), koha-upgrade-schema(8) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41243|0 |1 is obsolete| | --- Comment #17 from Liz Rea <wizzyrea@gmail.com> --- Created attachment 41244 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41244&action=edit Updated man pages for koha-mysql http://bugs.koha-community.org/show_bug.cgi?id=12372 Signed-off-by: Liz Rea <liz@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40379|0 |1 is obsolete| | --- Comment #18 from Liz Rea <wizzyrea@gmail.com> --- Created attachment 41245 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41245&action=edit Bug 12372: koha-mysql: process any mysql args Signed-off-by: Ian Bays <ian.bays@ptfs-europe.com> Signed-off-by: Liz Rea <liz@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40527|0 |1 is obsolete| | --- Comment #19 from Liz Rea <wizzyrea@gmail.com> --- Created attachment 41246 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41246&action=edit Bug 12372: (QA followup) Standardized argument parsing for koha-mysql. http://bugs.koha-community.org/show_bug.cgi?id=12372 Signed-off-by: Liz Rea <liz@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41244|0 |1 is obsolete| | --- Comment #20 from Liz Rea <wizzyrea@gmail.com> --- Created attachment 41247 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41247&action=edit Updated man pages for koha-mysql http://bugs.koha-community.org/show_bug.cgi?id=12372 Signed-off-by: Liz Rea <liz@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41245|0 |1 is obsolete| | Attachment #41246|0 |1 is obsolete| | Attachment #41247|0 |1 is obsolete| | --- Comment #21 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 41366 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41366&action=edit Bug 12372: koha-mysql: process any mysql args Signed-off-by: Ian Bays <ian.bays@ptfs-europe.com> Signed-off-by: Liz Rea <liz@catalyst.net.nz> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 --- Comment #22 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 41367 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41367&action=edit Bug 12372: (QA followup) Standardized argument parsing for koha-mysql. http://bugs.koha-community.org/show_bug.cgi?id=12372 Signed-off-by: Liz Rea <liz@catalyst.net.nz> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 --- Comment #23 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 41368 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41368&action=edit Updated man pages for koha-mysql http://bugs.koha-community.org/show_bug.cgi?id=12372 Signed-off-by: Liz Rea <liz@catalyst.net.nz> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14714 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14714 [Bug 14714] koha-mysql tab-completion in bash -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12372 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #24 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks Barton! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org