misp icon indicating copy to clipboard operation
misp copied to clipboard

Remove quoutes around database flags

Open dygland opened this issue 8 months ago • 5 comments

NOTE: I have not yet tested this due to lack of proper environment, will try to do so ASAP if you cant.

Removed the single qoutes around {{ flag }} => {{ value }} since the config does not work with them in place. According to https://github.com/MISP/MISP/blob/2.5/app/Config/database.default.php the database flags should be without quoutes.

Note that MISP2.5 requres the flag 'flags' => [ PDO::ATTR_STRINGIFY_FETCHES => true ]

to have the API work as expected so this might be hardcoded in? I dont know if 2.4 compability is still needed.

dygland avatar Apr 25 '25 09:04 dygland

This has now been tested, works as intended. Ie the results from api requests are stringified if you supply that flag per misp project instructions

dygland avatar Apr 25 '25 16:04 dygland

Could this be merged @ondj ? :) or do you need something else?

dygland avatar May 13 '25 13:05 dygland

@dygland I am not sure if this is good idea. Now I am thinking to remove MYSQL_FLAGS variable completely and just set correct value. I didn't know that there was change in MISP between 2.4 and 2.5.

ondj avatar Jun 16 '25 08:06 ondj

@ondj this would ofc solve this issue, but I guess that the mechanism to supply flags for MySQL is there for a reason? Also existing installs that utilizes the flags might get broken if its removed?

Although since they wont work within quotes I guess noone is using them so the option might just as well be removed.

We have used it without the quotes for quite some time now without any issues.

dygland avatar Jun 16 '25 19:06 dygland

I've implemented this config option alongside with MYSQL_SETTINGS, but haven't used it - so the MYSQL_FLAGS option might not be necessary and can be removed from my POV. I needed the MYSQL_SETTINGS option, because one of my MISP instances were using a MariaDB database where autocommit was disabled. https://github.com/MISP/MISP/issues/10106

Benni0 avatar Jun 23 '25 06:06 Benni0