Summary: | koha-create wants "use database" in DEFAULTSQL | ||
---|---|---|---|
Product: | Koha | Reporter: | Magnus Enger <magnus> |
Component: | Packaging | Assignee: | Magnus Enger <magnus> |
Status: | CLOSED FIXED | QA Contact: | Bugs List <koha-bugs> |
Severity: | enhancement | ||
Priority: | PATCH-Sent (DO NOT USE) | CC: | chris, semarie |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Proposed patch
Revised patch Bug 6517 - [REVISED] koha-create wants "use database" in DEFAULTSQL |
Description
Magnus Enger
2011-06-18 15:04:28 UTC
Did you use "koha-dump-defaults" to produce the default SQL? I think that this should take care of it for you. Ah, no I used plain ol' mysqldump. But I think it would be good if it was possible to make a mysqldump on a system not running from the packages and then base installs made with the packages on that. You can, use '--all-databases' when running mysqldump (but still provide the database name.) Keep in mind that part of the script is to replace the name of the instance with the placeholder, so that you can make it refer to itself (perhaps a default title or paths or something) and it'll replace that when it's installed to an instance. So it's still handy if you're in a position to use it. oh, --all-databases will put in the exact database name which isn't so good for a template. So your idea is still worthwhile :) Created attachment 4537 [details] [review] Proposed patch This patch makes sure that pointing DEFAULTSQL in /etc/koha/koha-sites.conf to any (gzip'ed) file produced by mysqldump works, by adding the name of the database to the end of the call to mysql, when the specified SQL file is loaded. Files produced with koha-dump-defaults should still work too. To test: - Apply the patch - Create an SQL file from an existing installation with mysqldump - gzip the SQL file - point DEFAULTSQL to the file in /etc/koha/koha-sites.conf - create a new site with koha-create --create-db I suggest that the variable $mysqldb should be quoted. There isn't difference in general case, but it is a better practice to quote arguments. Created attachment 4538 [details] [review] Revised patch The revised patch quotes the variable $mysqldb, as suggested by Frère Sébastien Marie. Created attachment 4549 [details] [review] Bug 6517 - [REVISED] koha-create wants "use database" in DEFAULTSQL The revised patch quotes the variable $mysqldb, as suggested by Frère Sébastien Marie. This patch makes sure that pointing DEFAULTSQL in /etc/koha/koha-sites.conf to any (gzip'ed) file produced by mysqldump works, by adding the name of the database to the end of the call to mysql, when the specified SQL file is loaded. Files produced with koha-dump-defaults should still work too. To test: - Apply the patch - Create a new package with build-git-snapshot - Install the package - Create an SQL file from an existing installation with mysqldump - gzip the SQL file - point DEFAULTSQL to the file in /etc/koha/koha-sites.conf - create a new site with koha-create --create-db Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Packaging only bug, please test The fix for this bug was published in the 3.4.5 release. If you were the reporter of this bug, please take time to verify the fix and update the status of this bug report accordingly. If the bug is fixed to your satisfaction, please close this report. |