embulk-output-mysql 0.7.9 → 0.7.10

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 08449007dfa072591724efe96735f7f36e47890f
4
- data.tar.gz: 39acd32a644c1a5dfec133f5d5d5705d6653b6a1
3
+ metadata.gz: 692465de551dae9499e788eedd698511da8446cd
4
+ data.tar.gz: a35c2e193ed89e1402d08abb9562e55c6a29beb1
5
5
  SHA512:
6
- metadata.gz: fdc887a07cda0ab68e9e00013ea3c0be5e480647728476a9f0ae9f847bc197ce12684d120eea627f622af54efdba7d38baf94b9f0202a2c9f4e30fc9bf736201
7
- data.tar.gz: b5f443bdc839934d3c2db7d4f8fb699eb50b2b8ef618c8eb2efd2a6d491db4fdaf6fa16dcde7a75d8d31302bd1a8e12e5cd921846bc701ee3de9845ddbd2a322
6
+ metadata.gz: 42d2e2458b4d575eaa38b0e1fbb8b9e4aed52c96c8a8c9ffa6d31bd2f14d0448f3445cdb5d6990f0747dd587060e2e1f55666a248d7bf8bc29681937a25889dd
7
+ data.tar.gz: cfe4ff6a46f0cddc4001680d98ddc422965a74fd7aadc282944bd6887f49407b023560483cac9893ee39f9849a6ede18f5b52c35d8d60769adcd8ad789d19b45
data/README.md CHANGED
@@ -14,6 +14,7 @@ MySQL output plugin for Embulk loads records to MySQL.
14
14
  - **port**: database port number (integer, default: 3306)
15
15
  - **user**: database login user name (string, required)
16
16
  - **password**: database login password (string, default: "")
17
+ - **ssl**: use SSL to connect to the database (string, default: `disable`. `enable` uses SSL without server-side validation and `verify` checks the certificate. For compatibility reasons, `true` behaves as `enable` and `false` behaves as `disable`.)
17
18
  - **database**: destination database name (string, required)
18
19
  - **temp_database**: database name for intermediate tables. by default, intermediate tables will be created in the database specified by `database`. (string, optional)
19
20
  - **table**: destination table name (string, required)
@@ -9,6 +9,7 @@ import com.google.common.base.Optional;
9
9
  import org.embulk.config.Config;
10
10
  import org.embulk.config.ConfigDefault;
11
11
  import org.embulk.output.jdbc.AbstractJdbcOutputPlugin;
12
+ import org.embulk.output.jdbc.Ssl;
12
13
  import org.embulk.output.jdbc.BatchInsert;
13
14
  import org.embulk.output.jdbc.JdbcOutputConnection;
14
15
  import org.embulk.output.jdbc.MergeConfig;
@@ -44,6 +45,11 @@ public class MySQLOutputPlugin
44
45
  @Config("temp_database")
45
46
  @ConfigDefault("null")
46
47
  public Optional<String> getTempDatabase();
48
+
49
+ @Config("ssl")
50
+ @ConfigDefault("\"disable\"") // backward compatibility
51
+ public Ssl getSsl();
52
+
47
53
  }
48
54
 
49
55
  @Override
@@ -80,21 +86,21 @@ public class MySQLOutputPlugin
80
86
  // Socket options TCP_KEEPCNT, TCP_KEEPIDLE, and TCP_KEEPINTVL are not configurable.
81
87
  props.setProperty("tcpKeepAlive", "true");
82
88
 
83
- // TODO
84
- //switch t.getSssl() {
85
- //when "disable":
86
- // break;
87
- //when "enable":
88
- // props.setProperty("useSSL", "true");
89
- // props.setProperty("requireSSL", "false");
90
- // props.setProperty("verifyServerCertificate", "false");
91
- // break;
92
- //when "verify":
93
- // props.setProperty("useSSL", "true");
94
- // props.setProperty("requireSSL", "true");
95
- // props.setProperty("verifyServerCertificate", "true");
96
- // break;
97
- //}
89
+ switch (t.getSsl()) {
90
+ case DISABLE:
91
+ props.setProperty("useSSL", "false");
92
+ break;
93
+ case ENABLE:
94
+ props.setProperty("useSSL", "true");
95
+ props.setProperty("requireSSL", "true");
96
+ props.setProperty("verifyServerCertificate", "false");
97
+ break;
98
+ case VERIFY:
99
+ props.setProperty("useSSL", "true");
100
+ props.setProperty("requireSSL", "true");
101
+ props.setProperty("verifyServerCertificate", "true");
102
+ break;
103
+ }
98
104
 
99
105
  if (!retryableMetadataOperation) {
100
106
  // non-retryable batch operation uses longer timeout
@@ -119,4 +119,20 @@ public class MySQLOutputConnection
119
119
  timeZoneComparison.compareTimeZone();
120
120
  }
121
121
 
122
+ //
123
+ //
124
+ // The MySQL Connector/J 5.1.35 introduce new option `Current MySQL Connect`.
125
+ // It has incompatibility behavior current version and 5.1.35.
126
+ //
127
+ // This method announces users about this change before the update driver version.
128
+ //
129
+ @Override
130
+ public void showDriverVersion() throws SQLException {
131
+ super.showDriverVersion();
132
+ logger.warn("This plugin will update MySQL Connector/J version in the near future release.");
133
+ logger.warn("It has some incompatibility changes.");
134
+ logger.warn("For example, the 5.1.35 introduced `noTimezoneConversionForDateType` and `cacheDefaultTimezone` options.");
135
+ logger.warn("Please read a document and make sure configuration carefully before updating the plugin.");
136
+ }
137
+
122
138
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-mysql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.9
4
+ version: 0.7.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-23 00:00:00.000000000 Z
11
+ date: 2017-07-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Inserts or updates records to a table.
14
14
  email:
@@ -19,8 +19,8 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - README.md
21
21
  - build.gradle
22
- - classpath/embulk-output-jdbc-0.7.9.jar
23
- - classpath/embulk-output-mysql-0.7.9.jar
22
+ - classpath/embulk-output-jdbc-0.7.10.jar
23
+ - classpath/embulk-output-mysql-0.7.10.jar
24
24
  - classpath/mysql-connector-java-5.1.34.jar
25
25
  - lib/embulk/output/mysql.rb
26
26
  - src/main/java/org/embulk/output/MySQLOutputPlugin.java