exwiw 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/exwiw/adapter/mysql_adapter.rb +20 -11
- data/lib/exwiw/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bf3c1130520f3f918f80f213d1fc0bee1416c677d97ae3e9fe076538bd20bb92
|
|
4
|
+
data.tar.gz: 9dd97924ac70c9b76d151c1fead90902a10900da36186e4ab7439aacaec94dbd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 45e71e45d5978ca9336b138a274759acecd1d0e50eb25826015269fb25238185642281002812e03f6f861e0c82d34b6c7d35fbf632f2d2a4ac67e9d376821dd4
|
|
7
|
+
data.tar.gz: 3f2e7e35e5ed34704b6be40190a4a2f435d14078602fb22f6bfaec7f8f8655b3cdbf3838927d0c995a38dc526e9a0b31432f8aefa85ebcb20856a1bb5655b091
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.4.3] - 2026-06-05
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- MySQL: `mysqldump` no longer fails with `Access denied; you need (at least one of) the PROCESS privilege(s)` on RDS and other managed MySQL instances where the DB user lacks `PROCESS`. The `--no-tablespaces` flag is now always passed, skipping the tablespace query that requires the privilege. Both MySQL and MariaDB support the flag.
|
|
10
|
+
|
|
11
|
+
## [0.4.2] - 2026-06-05
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- MySQL: `mysqldump` no longer fails with `unknown variable 'set-gtid-purged=OFF'` when the client binary is MariaDB's. The adapter detects the variant via `mysqldump --version` and omits the MySQL-specific flag for MariaDB.
|
|
16
|
+
|
|
5
17
|
## [0.4.1] - 2026-06-04
|
|
6
18
|
|
|
7
19
|
### Added
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'open3'
|
|
4
|
+
|
|
3
5
|
module Exwiw
|
|
4
6
|
module Adapter
|
|
5
7
|
class MysqlAdapter < Base
|
|
@@ -26,8 +28,6 @@ module Exwiw
|
|
|
26
28
|
end
|
|
27
29
|
|
|
28
30
|
def dump_schema(ordered_tables, output_path)
|
|
29
|
-
require 'open3'
|
|
30
|
-
|
|
31
31
|
table_names = ordered_tables.map(&:name)
|
|
32
32
|
if table_names.empty?
|
|
33
33
|
File.write(output_path, "-- Auto-generated by exwiw. No tables in scope.\n")
|
|
@@ -42,6 +42,10 @@ module Exwiw
|
|
|
42
42
|
mysqldump_bin = ENV['EXWIW_MYSQLDUMP']
|
|
43
43
|
mysqldump_bin = 'mysqldump' if mysqldump_bin.nil? || mysqldump_bin.empty?
|
|
44
44
|
|
|
45
|
+
# MariaDB's mysqldump does not recognise the MySQL-specific
|
|
46
|
+
# --set-gtid-purged flag and exits with code 7.
|
|
47
|
+
gtid_flags = mariadb_mysqldump?(mysqldump_bin) ? [] : ['--set-gtid-purged=OFF']
|
|
48
|
+
|
|
45
49
|
cmd = [
|
|
46
50
|
mysqldump_bin,
|
|
47
51
|
"--host=#{@connection_config.host}",
|
|
@@ -49,17 +53,10 @@ module Exwiw
|
|
|
49
53
|
"--user=#{@connection_config.user}",
|
|
50
54
|
'--no-data',
|
|
51
55
|
'--skip-add-drop-table',
|
|
52
|
-
# `--skip-comments` only suppresses the dump's header lines
|
|
53
|
-
# (e.g. `-- MySQL dump ...`, server version banner). Column and
|
|
54
|
-
# table `COMMENT '...'` clauses are emitted inline inside
|
|
55
|
-
# CREATE TABLE statements and are NOT affected, so this flag is
|
|
56
|
-
# purely about reducing noise in the generated file.
|
|
57
56
|
'--skip-comments',
|
|
58
57
|
'--skip-set-charset',
|
|
59
|
-
#
|
|
60
|
-
|
|
61
|
-
# (ERROR 3546: added gtid set must not overlap with @@GLOBAL.GTID_EXECUTED).
|
|
62
|
-
'--set-gtid-purged=OFF',
|
|
58
|
+
'--no-tablespaces', # skip tablespace query that requires PROCESS privilege (unavailable on managed MySQL like RDS)
|
|
59
|
+
*gtid_flags,
|
|
63
60
|
'--compact',
|
|
64
61
|
@connection_config.database_name,
|
|
65
62
|
*table_names,
|
|
@@ -275,6 +272,18 @@ module Exwiw
|
|
|
275
272
|
end
|
|
276
273
|
end
|
|
277
274
|
|
|
275
|
+
private def mariadb_mysqldump?(mysqldump_bin)
|
|
276
|
+
return @mariadb_mysqldump if defined?(@mariadb_mysqldump)
|
|
277
|
+
|
|
278
|
+
@mariadb_mysqldump =
|
|
279
|
+
begin
|
|
280
|
+
version_output, _, status = Open3.capture3(mysqldump_bin, '--version')
|
|
281
|
+
status.success? && version_output.match?(/mariadb/i)
|
|
282
|
+
rescue SystemCallError
|
|
283
|
+
false
|
|
284
|
+
end
|
|
285
|
+
end
|
|
286
|
+
|
|
278
287
|
private def connection
|
|
279
288
|
@connection ||= MysqlClient.new(@connection_config)
|
|
280
289
|
end
|
data/lib/exwiw/version.rb
CHANGED