1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/library
Maykel Moya 811aa2611e Add support for string values
The SET GLOBAL statement requires properly quoting of values. For example, the
following correct queries will fail if quotes are toggled:

mysql> SET GLOBAL innodb_lru_scan_depth = 2000;
mysql> SET GLOBAL master_info_repository = "TABLE";

`mysql_variable` module doesn't quote the value argument, therefore
string values will fail.

  # this task will pass, 2000 is passed without quotes
  - name: set a numeric value
    mysql_variable: variable=innodb_lru_scan_depth value=2000

  # this task will fail, TABLE is passed without quotes
  - name: set a string value
    mysql_variable: variable=master_info_repository value=TABLE

With this patch prepared statements are used. Proper quoting will be
done automatically based on the type of the variables thus an attempt
to convert to int, then to float is done in first place.

Booleans values, ie: ON, OFF, are not specially handled because they
can be quoted. For example, the following queries are correct and
equivalent, they all set _innodb_file_per_table_ to logical _True_:

mysql> SET GLOBAL innodb_file_per_table = "ON";
mysql> SET GLOBAL innodb_file_per_table = ON;
mysql> SET GLOBAL innodb_file_per_table = 1;

Tested in mysql 5.5 and 5.6.
2014-02-12 12:44:28 +01:00
..
cloud Merge pull request #5962 from sivel/rax-facts-docs-update 2014-02-11 16:39:59 -05:00
commands Adding no_log: capability for tasks 2014-01-31 16:58:46 -06:00
database Add support for string values 2014-02-12 12:44:28 +01:00
files Merge pull request #5363 from bcoca/acl_improved 2014-02-05 18:40:59 -05:00
internal ansible -> ansibleworks 2014-01-28 20:29:41 -05:00
inventory Make add_host clear the inventory pattern cache, add some more aliases. Fixes #4442. 2013-10-11 16:37:10 -04:00
messaging Use new syntax for module snippets in rabbitmq_policy and update changelog 2014-02-05 16:21:18 -05:00
monitoring module(nagios): don't catch SystemExit 2013-12-04 13:57:55 +01:00
net_infrastructure All modules should be using /usr/bin/python in the shebang as ansible_python_interpreter processes this (see FAQ). 2014-01-15 09:52:17 -05:00
network Merge pull request #5826 from romeotheriault/fix_follow_redirects 2014-02-07 11:36:51 -06:00
notification ansible -> ansibleworks 2014-01-28 20:29:41 -05:00
packaging small change to docs 2014-02-06 20:35:42 -07:00
source_control (#5822) Use mkstemp to open a temporary file (as NamedTemporaryFile doesn't take a delete argument in Python < 2.6) 2014-01-30 19:39:39 -05:00
system Merge pull request #5554 from ttarabul/devel 2014-02-04 10:59:19 -08:00
utilities Detect remote_user change in accelerate daemon and allow a restart 2014-01-30 14:40:41 -06:00
web_infrastructure Clean up stray space at the end of a line after a period. 2014-02-03 11:52:37 -06:00