Commit graph

867 commits

Author SHA1 Message Date
Morgan Haskel
11fb01c736 Fix test issues
Remove the dependency on stdlib 4.x puppetlabs/puppetlabs-mysql#574
introduced, add some input validation, and improve test checks.
2014-11-14 13:16:01 -08:00
Igor Galić
ab84a671f9 Merge pull request #574 from Mylezeem/allow_multiple_import_at_a_time
(MODULES-1338) Allow mysql::db to import several files
2014-11-14 17:15:13 +01:00
Igor Galić
22b07aef6f Merge pull request #602 from theasci/fix-user-validation-regression
Fix regression in username validation
2014-11-14 17:13:46 +01:00
Mason Malone
4f0d4311d9 Fix regression in username validation
Commit cdd7132ff9 added logic to catch invalid database usernames,
but the regex it uses fails to match usernames with special characters that are properly quoted,
causing errors with usernames that used to work in versions < 3.0.0. This fixes the regex so that
if the username is quoted, anything is allowed between the quotes.

From the docs (http://dev.mysql.com/doc/refman/5.5/en/identifiers.html):
"Permitted characters in quoted identifiers include the full Unicode Basic Multilingual Plane (BMP),
except U+0000"
2014-11-13 18:18:02 -05:00
Yanis Guenane
5e6a1c418a (MODULES-1338) Allow mysql::db to import several files
A user might need to import several files on database creation.
Currently the module only allows the import of a single file.
This commit allows one to, from now on, import severals.

Before :

  mysql::db { 'test' :
    sql => '/tmp/my_import1.sql',
  }

Now :

  mysql::db { 'test' :
    sql => [
      '/tmp/my_import1.sql',
      '/tmp/my_import2.sql',
    ]
  }
2014-11-13 14:17:50 -05:00
Travis Fields
89762a7d0c Merge pull request #601 from mhaskel/merge_3.0.x
Merge 3.0.x
2014-11-12 09:58:30 -08:00
Igor Galić
56e52fc3fa Merge pull request #596 from NoodlesNZ/logbindir
Create log-bin directory if it doesn't exist
2014-11-12 15:39:02 +01:00
Morgan Haskel
b06d3fe55d Merge remote-tracking branch 'upstream/3.0.x' into merge_3.0.x 2014-11-11 17:23:14 -08:00
Nick Le Mouton
08a66b7bb9 Added log-bin dir creatation 2014-11-12 06:50:14 +13:00
Igor Galić
ad709afd2c Merge pull request #591 from damonconway/MODULES-1484
[MODULES-1484] Add support for install_options for all package resources...
2014-11-11 14:39:14 +01:00
Morgan Haskel
810ceb1815 Merge pull request #600 from hunner/release_3.0.0
Release 3.0.0
2014-11-10 16:23:59 -08:00
Hunter Haugen
46c53dbbd7 clarify changelog for major release 2014-11-10 16:21:21 -08:00
Travis Fields
c5c1b3840e Prepare for 3.0.0 release 2014-11-10 16:21:21 -08:00
Travis Fields
e5a300a2d2 Merge pull request #599 from mhaskel/metadata_fix
Fix issues URL and make format match puppet module build
2014-11-10 16:10:38 -08:00
Morgan Haskel
67bae9f58c Fix issues URL and make format match puppet module build 2014-11-10 16:08:40 -08:00
Travis Fields
45b4f4b3e2 Merge pull request #598 from mhaskel/fix_for_beaker_with_1.8.7
Prior to this there was generic :test group.
2014-11-10 14:56:37 -08:00
Morgan Haskel
0aee5c94d2 Prior to this there was generic :test group.
Unfortunately Beaker will be EOL-ing support for Ruby 1.8 (a number of
Beaker's dependencies already have and pinning to older versions is
becoming costly). Once Beaker does this it will cause failures whenever
running `bundle install`.

To avoid this failure we can segregate the system testing gems, allowing
unit, lint and development to continue with
`bundle install --without system_tests.`
2014-11-10 14:54:36 -08:00
Damon Conway
7de2316e15 [MODULES-1484] Add support for install_options for all package resources.
Add install_options parameter to mysql::bindings, mysql::client, and
mysql::server. The default is undef.
2014-11-08 00:30:00 -06:00
Igor Galić
8dd37aea3a Merge pull request #594 from skroll/escape_backslash
Fix escaped backslashes in grants
2014-11-07 15:23:52 +01:00
Igor Galić
1494412f88 Merge pull request #588 from maxenced/fix-mysql-user-allowed-char
Improve checks for MySQL user's name.
2014-11-07 15:23:23 +01:00
Maxence Dunnewind
cdd7132ff9 Improve checks for MySQL user's name.
As per http://dev.mysql.com/doc/refman/5.5/en/identifiers.html , MySQL
allows for more than '\w-'. This commit improves the check to ensure
that:
 - if username only contains [0-9a-zA-Z$_], it might be quoted. It is
   not a requirement though
 - if username contains anything else, it MUST be quoted

I kept 2 checks, but the 2nd one can probably be removed (I can't find a
username which match the 2nd one but not the first.)
2014-11-06 08:51:07 +01:00
Igor Galić
d9e5c95461 Merge pull request #593 from vinzent/small_maint
(maint) add statement "MANAGED BY PUPPET" to my.cnf config file template
2014-11-06 08:20:28 +01:00
Scott Kroll
9dbdd89c7a Fix escaped backslashes in grants
* Mysql uses the underscore character to represent a single character
  wildcard.
* A grant on table `the_database`.* would match `theAdatabase`.*, so
  underscores must be escaped to avoid this match.
* The output from mysql escapes special characters (\n, \t, \0, and \\),
  but the input does not need to be escaped.
* In order for the provider to compare the tables, the output of
  mysql -NBe <query> must have \\ substituted with \.
2014-11-05 14:53:14 -05:00
Thomas Mueller
5d732bda6c (maint) add statement "MANAGED BY PUPPET" to my.cnf config file template and remove unused my.conf.cnf.erb template 2014-11-05 10:13:39 +01:00
Igor Galić
40dd180588 Merge pull request #571 from jtopper/master
[MODULES-1333] Add explicit dependencies for mysql_database and mysql_user types
2014-10-28 16:14:59 +01:00
Igor Galić
8540e26ff4 Merge pull request #587 from maxenced/fix-mysql-grant-parsing
The old regex requires something after the 'host' part. Fix this.
2014-10-28 14:42:46 +01:00
Maxence Dunnewind
46065c4095 The old regex requires something after the 'host' part. Fix this.
Old regex is : /^GRANT\s(.+)\sON\s(.+)\sTO\s(.*)@(.*?)(\s.*)$/ . The
last part (\s.*)$ means "a space followed by anything". The issue is
that when user has no GRANT privileges, the "SHOW GRANTS FOR #{user_string}" returns
"GRANT SELECT ON `database`.* TO 'user'@'%'" which does not match (\s.*)$ .
This small patch fixes this making last bloc optional (thanks to '?').
2014-10-27 16:41:33 +01:00
Igor Galić
d45c1e4822 Merge pull request #585 from stepping-stone/gentoo
Add support for Gentoo
2014-10-27 16:39:12 +01:00
Pascal Jufer
2a91e524bd Add support for Gentoo 2014-10-22 15:12:18 +02:00
Igor Galić
39aa5f511a Merge pull request #576 from igalic/timeout
Timeout
2014-10-19 19:17:52 +02:00
Hunter Haugen
39d75988bc Merge pull request #584 from cmurphy/clean_metadata
Clean up metadata for new SLES support
2014-10-14 10:07:55 -07:00
Colleen Murphy
9f3e522bbf Clean up metadata for new SLES support 2014-10-14 10:05:56 -07:00
Hunter Haugen
53f5ad4881 Merge pull request #583 from cmurphy/metadata
Update PE and OS compatibility info in metadata
2014-10-14 10:01:19 -07:00
Colleen Murphy
fef9602dcf Update PE and OS compatibility info in metadata
Now compatible with PE 3.4 and SLES 10.
2014-10-14 09:58:57 -07:00
Morgan Haskel
c6f894545d Merge pull request #582 from cmurphy/fix_oracle
Oracle 7 uses mariadb
2014-10-10 16:32:23 -04:00
Colleen Murphy
d2d40a8dc8 Oracle 7 uses mariadb 2014-10-10 13:23:48 -07:00
Morgan Haskel
91e57102d6 Merge pull request #580 from cmurphy/fix_bzcat
Install bzip2 on RHEL 7 and Fedora hosts
2014-10-07 18:52:11 -04:00
Colleen Murphy
c291be44eb Install bzip2 on RHEL 7 and Fedora hosts
The backup script needs the bzcat command, which does not come
installed on RHEL 7 and Fedora hosts by default. This patch installs
the bzip2 package before attempting to run tests that use bzcat.
2014-10-07 15:43:57 -07:00
Morgan Haskel
1a3f91f12d Merge pull request #579 from cmurphy/fix_log_idempotency
Ensure error log is present before trying to manage ownership
2014-10-07 17:34:15 -04:00
Colleen Murphy
ec6b97ea5d Ensure error log is present before trying to manage ownership
If mysql generates an error log in between puppet runs, the log's
ownership and group might not match the ownership and group set by the
file resource. This means sequential puppet runs will appear not to be
idempotent. This patch makes sure the file is there from the start so
that it doesn't have to change its ownership later.
2014-10-07 14:28:00 -07:00
Igor Galić
400d3b29cf Merge pull request #570 from fnerdwq/mysql_grant_column_privs
(MODULES-552) Add capability to specify column_privileges
2014-10-07 15:46:08 +02:00
Frederik Wagner
f88719b52f (MODULES-552) Add capability to specify column_privileges 2014-10-06 08:11:01 +02:00
Morgan Haskel
e6dceb13da Merge pull request #577 from cmurphy/fix_future_errors
Change sql param to default to undef instead of empty string
2014-10-03 17:26:25 -04:00
Colleen Murphy
bf2c8d4bc0 Change sql param to default to undef instead of empty string
The future parser treats the empty string '' as a truthy value. This
means that mysql::db will always try to include the db import exec in
the catalog. With the empty string as the $sql value, the command
attempts to import '' into a database, which fails. This patch changes
the default $sql value to undef so that the exec won't be included if
there is no sql to import.
2014-10-03 11:56:18 -07:00
refnode
16d2df2cb9 Add documentation for new mysql::db "import_timeout" parameter
Signed-off-by: refnode <refnode@gmail.com>
2014-09-29 17:43:29 +02:00
refnode
4e1bb8f1ce Add timeout parameter to increase for long time running sql imports
Signed-off-by: refnode <refnode@gmail.com>
2014-09-29 17:42:30 +02:00
Morgan Haskel
b338635919 Merge pull request #573 from mhaskel/fix_187_unittests
Trailing commas were breaking things on 1.8.7
2014-09-19 10:09:26 -07:00
Morgan Haskel
ba4830cbbe Trailing commas were breaking things on 1.8.7 2014-09-19 09:42:35 -07:00
Jon Topper
c4d45c3eb5 Add explicit dependencies for types
mysql_grant has an autorequire()'d dependency on the .my.cnf file used
by the provider to talk to the database.

I've added this to mysql_database and mysql_user too since logically
these also need the file to be in place.

I've hit this bug because of a slightly unusual edge case in our own
manifests, but I think this fix belongs upstream regardless.
2014-09-16 15:46:13 +01:00
Igor Galić
1bd8f567fa Merge pull request #568 from edestecd/master
future parser converts explicit undef to empty string
2014-09-16 15:08:22 +02:00