Closed (fixed)
Project:
Drupal tweaks
Version:
6.x-1.x-dev
Component:
db_tweaks module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
2 Mar 2009 at 06:55 UTC
Updated:
3 Jan 2014 at 00:07 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
moshe weitzman commentedLooks good to me. The default for 7 should be strict. And admin should be able to select 'server default' which does nothing in hook _boot(). default for d5 and d6 ought to be server default IMO.
Comment #2
deekayen commentedI guess I don't understand the CNW status. I re-read and interpreted it several ways:
As it is, there is no attempt to grab the current server default because the MySQL docs say
If there are no checkboxes selected, the module defaults to the documented default.
Comment #3
deekayen commentedNote to self:
Grabbing the current sql_mode is
SELECT @@SESSION.sql_mode;which could act as a "server default" option.Comment #4
moshe weitzman commentedWell, there was no patch in the OP despite being marked CNR. I don't think this merits a new module in devel so this should become a patch. Downgrading to Active Needs Info for now.
1. in your list is correct.
If the admin has chosen server default, we should not ever SET a SQL mode.
We also need to not interfere with postgres and sqlite
Comment #5
deekayen commentedHere's a patch against D5. If you like it, I'll make some upgrade versions. It differs from my sandbox version by adding a server default checkbox and switches from a checkbox list to a multiselect. It also checks $db_url for MySQL.
Comment #6
deekayen commentedPerhaps a 6.x patch is more desirable?
Comment #7
deekayen commentedSame thing as #5 and #6, but for D7.
Comment #8
deekayen commentedHere's a screenshot of the new SQL Mode fieldset on the Devel settings page. It's in the middle. The environment is Firefox in Xfce 4.6 on Drupal HEAD/7 for whatever I downloaded today.
Comment #9
drewish commentedI'd love it if there was a link to the MySQL docs explaining the differences between them. Perhaps http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html ?
Comment #10
deekayen commented#5, #6, and #7 already have that URL as a link in the new fieldset's description.
Comment #11
drewish commentedyou are correct. looking at the screen shot i would not have concluded the link was information on the modes.
Comment #12
deekayen commentedI hate to elevate this, but the new http://drupal.org/project/db_tweaks is doing things where this patch might fit. Should I take this patch over there?
Comment #13
moshe weitzman commentedyes, i think so.
Comment #14
deekayen commentedmoving to Database tweaks module
Comment #15
kenorb commentedFunctionality committed into db_tweaks
http://drupal.org/cvs?commit=212924
Comment #16
deekayen commentedIs there a particular reason you moved it into hook_init() instead of _boot?
Comment #17
kenorb commentedNo special reason, the difference is that _init() is always executed (apart of maintenance mode) and you have t() accessible,
to execute hook_boot() you have to register bootstrap to 1 somehow, but I'm not sure what's the proper way for that with Drupal API.
You can do that on install hook:
But probably during module_rebuild it's reseting to default again, so you need to execute this query again during _notify()
Because I've got a lot of problems with hook_boot in other module.
You know the simple way for hook_boot usage?
And it's better idea to move it to hook_boot?
Comment #18
kenorb commentedFixed.
#477114: Unconfigured site throws user warnings
If there are any other issues, please open new one.
Comment #19
deekayen commentedhook_init() doesn't load on every page request and t() isn't needed for switching sql mode.
You could register it people already using the module through an update function, but just re-saving the modules page will fire module_rebuild_cache(), which is responsible for re-setting the bootstrap to 1 where hook_boot and hook_exit are implemented. Merely activating the module will have the bootstrap set to 1 by the mere existence of db_tweaks_boot().
If you want to do the update function, there's no point in doing string replacement on a constant in db_query(), so you can use update_sql() and provide feedback to the update script. Otherwise, the update instructions would be to just re-save the modules page. I have no idea what you're talking about with _notify().
Comment #20
kenorb commentedMoved to hook_boot()
http://drupal.org/cvs?commit=229598
Added weight priority in hook_install and changed max_packet_size from kB to MB, so probably module have to be re-installed.
Comment #21
kenorb commentedSupposing that after 1 week somebody test it already.
Comment #22
deekayen commentedI have not tested it since I made the patch for devel. I'll start you a .test file.
Comment #23
deekayen commentedThis should get you started. The problem with saying this has been tested is that there's no feedback route to see if a MySQL setting actually stuck during bootstrap.
Perhaps adding hook_requirements() could be a way to get that feedback on REQUIREMENT_INFO level. One row for each setting perhaps? Then this test could load the core status page to assert for the strings it expects.
Then the requirements and test can be expanded to all the other variables based on the template of requirements and .test file.
Comment #24
kenorb commentedThanks a lot.
I'll test this test, probably on Monday.
Comment #25
deekayen commentedWhile testing this feature, I selected POSTGRESQL on the settings page. When I submitted, it redirected to a blank page with just a forward slash / on it. It still saved the setting, but ending on a blank page wasn't productive.
Comment #26
kenorb commentedI've done hook_requirements and updated test plan.
http://drupal.org/cvs?commit=235296
http://drupal.org/cvs?commit=235320
http://drupal.org/cvs?commit=235334
http://drupal.org/cvs?commit=235338
Only one case is failing when checking mysql_max_allowed_packet from settings page, but I've no idea why.
I've set mysql_max_allowed_packet to 3 and it was saved without problems.
Without simpletest normally it's the same value, with simpletest environment it's 1 on settings page.
Comment #27
kenorb commentedMerged project with: http://drupal.org/project/drupal_tweaks
Comment #28
kenorb commentedFeature is done.
If you have any problem, please raise separate issue with steps how to reproduce it.