Skip to content

Commit

Permalink
apacheGH-39189: [Java] Bump com.h2database:h2 from 1.4.196 to 2.2.224…
Browse files Browse the repository at this point in the history
… in /java (apache#39188)

### Rationale for this change

Dependabot flagged this upgrade, but it requires test code changes. H2 is an in-memory database used for JDBC testing and 2.0 had several backwards-breaking changes: https://h2database.com/html/migration-to-v2.html

### What changes are included in this PR?

* h2database upgraded from 1.4.196 -> 2.2.224
* H2 changed VARCHAR description from `VARCHAR` to `CHARACTER VARYING`
* To query all tables/columns in H2, use `null` values for catalog and schema parameters instead of `%`
* H2 now returns Binary and Blob data as a byte array instead of hex values
* H2 added the type `VARBINARY`. `Binary` must now be a fixed length and is padded with zeroes.
* H2 `CHAR` is fixed length and pads with whitespace now
* H2 enforces all `ARRAY`s must be typed
* H2 changed the literal syntax for arrays to be `ARRAY[val1, val2, ...]` from `(val1, val2, ...)`
* H2 handles unicode chars natively now
* H2 connections' `createArrayOf` API handles null values differently now

### Are these changes tested?

Unit tests.

### Are there any user-facing changes?

No, only tests updated.
* Closes: apache#39189

Authored-by: Dane Pitkin <[email protected]>
Signed-off-by: David Li <[email protected]>
  • Loading branch information
danepitkin authored Dec 13, 2023
1 parent 4142607 commit dbed728
Show file tree
Hide file tree
Showing 17 changed files with 59 additions and 81 deletions.
2 changes: 1 addition & 1 deletion java/adapter/jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.196</version>
<version>2.2.224</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void schemaCommentWithDatabaseMetadata() throws Exception {
"SQL_SCHEMA_NAME", "PUBLIC",
"SQL_TABLE_NAME", "TABLE1",
"SQL_COLUMN_NAME", "NAME",
"SQL_TYPE", "VARCHAR",
"SQL_TYPE", "CHARACTER VARYING",
"comment", "Name of record")),
field("COLUMN1", true, Types.MinorType.BIT.getType(),
metadata(
Expand Down Expand Up @@ -205,7 +205,7 @@ private String getTableComment(DatabaseMetaData metaData, String tableName) thro
}
String comment = null;
int rowCount = 0;
try (ResultSet tableMetadata = metaData.getTables("%", "%", tableName, null)) {
try (ResultSet tableMetadata = metaData.getTables(null, null, tableName, null)) {
if (tableMetadata.next()) {
comment = tableMetadata.getString("REMARKS");
rowCount++;
Expand All @@ -221,7 +221,7 @@ private String getTableComment(DatabaseMetaData metaData, String tableName) thro
}

private String getColumnComment(DatabaseMetaData metaData, String tableName, String columnName) throws SQLException {
try (ResultSet tableMetadata = metaData.getColumns("%", "%", tableName, columnName)) {
try (ResultSet tableMetadata = metaData.getColumns(null, null, tableName, columnName)) {
if (tableMetadata.next()) {
return tableMetadata.getString("REMARKS");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,16 +334,6 @@ public static void assertFieldMetadataMatchesResultSetMetadata(ResultSetMetaData
}
}

public static byte[] hexStringToByteArray(String s) {
int len = s.length();
byte[] data = new byte[len / 2];
for (int i = 0; i < len; i += 2) {
data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) +
Character.digit(s.charAt(i + 1), 16));
}
return data;
}

public static Integer[] getIntValues(String[] values, String dataType) {
String[] dataArr = getValues(values, dataType);
Integer[] valueArr = new Integer[dataArr.length];
Expand Down Expand Up @@ -429,7 +419,7 @@ public static byte[][] getBinaryValues(String[] values, String dataType) {
byte[][] valueArr = new byte[dataArr.length][];
int i = 0;
for (String data : dataArr) {
valueArr[i++] = "null".equals(data.trim()) ? null : hexStringToByteArray(data.trim());
valueArr[i++] = "null".equals(data.trim()) ? null : data.trim().getBytes();
}
return valueArr;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ public Float[] getFloatValues() {
}

public byte[][] getBinaryValues() {
return getHexToByteArray(values);
return getByteArray(values);
}

public byte[][] getVarCharValues() {
return getByteArray(values);
}

public byte[][] getBlobValues() {
return getBinaryValues();
return getByteArray(values);
}

public byte[][] getClobValues() {
Expand Down Expand Up @@ -221,23 +221,4 @@ static byte[][] getByteArray(String[] data) {
}
return byteArr;
}

static byte[][] getHexToByteArray(String[] data) {
byte[][] byteArr = new byte[data.length][];

for (int i = 0; i < data.length; i++) {
byteArr[i] = hexStringToByteArray(data[i]);
}
return byteArr;
}

static byte[] hexStringToByteArray(String s) {
int len = s.length();
byte[] data = new byte[len / 2];
for (int i = 0; i < len; i += 2) {
data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) +
Character.digit(s.charAt(i + 1), 16));
}
return data;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public class JdbcToArrowArrayTest {
private Connection conn = null;

private static final String CREATE_STATEMENT =
"CREATE TABLE array_table (id INTEGER, int_array ARRAY, float_array ARRAY, string_array ARRAY);";
"CREATE TABLE array_table (id INTEGER, int_array INTEGER ARRAY, float_array REAL ARRAY, " +
"string_array VARCHAR ARRAY);";
private static final String INSERT_STATEMENT =
"INSERT INTO array_table (id, int_array, float_array, string_array) VALUES (?, ?, ?, ?);";
private static final String QUERY = "SELECT int_array, float_array, string_array FROM array_table ORDER BY id;";
Expand Down Expand Up @@ -354,9 +355,9 @@ private void insertRows(
Float[] floatArray = floatArrays[i];
String[] strArray = strArrays[i];

Array intArray = conn.createArrayOf("INT", integerArray);
Array realArray = conn.createArrayOf("REAL", floatArray);
Array varcharArray = conn.createArrayOf("VARCHAR", strArray);
Array intArray = integerArray != null ? conn.createArrayOf("INT", integerArray) : null;
Array realArray = floatArray != null ? conn.createArrayOf("REAL", floatArray) : null;
Array varcharArray = strArray != null ? conn.createArrayOf("VARCHAR", strArray) : null;

// Insert Arrays of 4 Values in Each Row
stmt.setInt(1, i);
Expand All @@ -366,9 +367,15 @@ private void insertRows(

stmt.executeUpdate();

intArray.free();
realArray.free();
varcharArray.free();
if (intArray != null) {
intArray.free();
}
if (realArray != null) {
realArray.free();
}
if (varcharArray != null) {
varcharArray.free();
}
}
}
}
Expand Down
24 changes: 12 additions & 12 deletions java/adapter/jdbc/src/test/resources/h2/test1_all_datatypes_h2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,59 +13,59 @@ name: 'test1_all_datatypes_h2'

create: 'CREATE TABLE table1 (int_field1 INT, bool_field2 BOOLEAN, tinyint_field3 TINYINT, smallint_field4 SMALLINT, bigint_field5 BIGINT,
decimal_field6 DECIMAL(20,2), double_field7 DOUBLE, real_field8 REAL, time_field9 TIME, date_field10 DATE, timestamp_field11 TIMESTAMP,
binary_field12 BINARY(100), varchar_field13 VARCHAR(256), blob_field14 BLOB, clob_field15 CLOB, char_field16 CHAR(16), bit_field17 BIT,
null_field18 NULL, list_field19 ARRAY, map_field20 VARCHAR(256));'
binary_field12 VARBINARY(100), varchar_field13 VARCHAR(256), blob_field14 BLOB, clob_field15 CLOB, char_field16 CHAR(14), bit_field17 BIT,
null_field18 NULL, list_field19 INT ARRAY, map_field20 VARCHAR(256));'

data:
- 'INSERT INTO table1 VALUES (101, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''),
PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''),
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'',
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (1, 2, 3), ''{"a":"b","key":"12345"}'');'
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[1, 2, 3], ''{"a":"b","key":"12345"}'');'

- 'INSERT INTO table1 VALUES (102, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''),
PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''),
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'',
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (1, 2),''{"c":"d"}'');'
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[1, 2],''{"c":"d"}'');'

- 'INSERT INTO table1 VALUES (103, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''),
PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''),
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'',
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (1),''{"e":"f"}'');'
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[1],''{"e":"f"}'');'

- 'INSERT INTO table1 VALUES (104, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''),
PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''),
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'',
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (2, 3, 4),''{"g":"h"}'');'
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[2, 3, 4],''{"g":"h"}'');'

- 'INSERT INTO table1 VALUES (null, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''),
PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''),
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'',
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (2, 3),''{"i":"j"}'');'
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[2, 3],''{"i":"j"}'');'

- 'INSERT INTO table1 VALUES (null, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''),
PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''),
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'',
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (2),''{"k":"l"}'');'
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[2],''{"k":"l"}'');'

- 'INSERT INTO table1 VALUES (107, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''),
PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''),
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'',
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (3, 4, 5),''{"m":"n"}'');'
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[3, 4, 5],''{"m":"n"}'');'

- 'INSERT INTO table1 VALUES (108, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''),
PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''),
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'',
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (3, 4),''{"o":"p"}'');'
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[3, 4],''{"o":"p"}'');'

- 'INSERT INTO table1 VALUES (109, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''),
PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''),
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'',
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (3),''{"q":"r"}'');'
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[3],''{"q":"r"}'');'

- 'INSERT INTO table1 VALUES (110, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''),
PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''),
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'',
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, (),''{"s":"t"}'');'
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'', 1, null, ARRAY[],''{"s":"t"}'');'

query: 'select int_field1, bool_field2, tinyint_field3, smallint_field4, bigint_field5, decimal_field6, double_field7, real_field8,
time_field9, date_field10, timestamp_field11, binary_field12, varchar_field13, blob_field14, clob_field15, char_field16, bit_field17, null_field18, list_field19, map_field20 from table1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ rowCount: '5'

create: 'CREATE TABLE table1 (int_field1 INT, bool_field2 BOOLEAN, tinyint_field3 TINYINT, smallint_field4 SMALLINT, bigint_field5 BIGINT,
decimal_field6 DECIMAL(20,2), double_field7 DOUBLE, real_field8 REAL, time_field9 TIME, date_field10 DATE, timestamp_field11 TIMESTAMP,
binary_field12 BINARY(100), varchar_field13 VARCHAR(256), blob_field14 BLOB, clob_field15 CLOB, char_field16 CHAR(16), bit_field17 BIT,
list_field19 ARRAY,map_field20 VARCHAR(256));'
binary_field12 VARBINARY(100), varchar_field13 VARCHAR(256), blob_field14 BLOB, clob_field15 CLOB, char_field16 CHAR(14), bit_field17 BIT,
list_field19 INT ARRAY, map_field20 VARCHAR(256));'

data:
- 'INSERT INTO table1 VALUES (null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ vectors:

create: 'CREATE TABLE table1 (int_field1 INT, bool_field2 BOOLEAN, tinyint_field3 TINYINT, smallint_field4 SMALLINT, bigint_field5 BIGINT,
decimal_field6 DECIMAL(20,2), double_field7 DOUBLE, real_field8 REAL, time_field9 TIME, date_field10 DATE, timestamp_field11 TIMESTAMP,
binary_field12 BINARY(100), varchar_field13 VARCHAR(256), blob_field14 BLOB, clob_field15 CLOB, char_field16 CHAR(16), bit_field17 BIT,
list_field19 ARRAY, map_field20 VARCHAR(256));'
binary_field12 VARBINARY(100), varchar_field13 VARCHAR(256), blob_field14 BLOB, clob_field15 CLOB, char_field16 CHAR(14), bit_field17 BIT,
list_field19 INT ARRAY, map_field20 VARCHAR(256));'

data:
- 'INSERT INTO table1 VALUES (null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);'
Expand All @@ -46,15 +46,15 @@ data:
PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''),
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'',
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'',
1, (1, 2, 3),''{"a":"b"}'');'
1, ARRAY[1, 2, 3],''{"a":"b"}'');'

- 'INSERT INTO table1 VALUES (null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);'

- 'INSERT INTO table1 VALUES (101, 1, 45, 12000, 92233720, 17345667789.23, 56478356785.345, 56478356785.345, PARSEDATETIME(''12:45:35 GMT'', ''HH:mm:ss z''),
PARSEDATETIME(''2018-02-12 GMT'', ''yyyy-MM-dd z''), PARSEDATETIME(''2018-02-12 12:45:35 GMT'', ''yyyy-MM-dd HH:mm:ss z''),
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to varchar'',
''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'', ''some text that needs to be converted to clob'', ''some char text'',
1, (1, 2, 3),''{"c":"d"}'');'
1, ARRAY[1, 2, 3],''{"c":"d"}'');'

- 'INSERT INTO table1 VALUES (null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: 'binary'

vector: 'BINARY_FIELD12'

create: 'CREATE TABLE table1 (binary_field12 BINARY(100));'
create: 'CREATE TABLE table1 (binary_field12 VARBINARY(100));'

data:
- 'INSERT INTO table1 VALUES (''736f6d6520746578742074686174206e6565647320746f20626520636f6e76657274656420746f2062696e617279'');'
Expand Down
2 changes: 1 addition & 1 deletion java/adapter/jdbc/src/test/resources/h2/test1_char_h2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: 'char'

vector: 'CHAR_FIELD16'

create: 'CREATE TABLE table1 (char_field16 CHAR(16));'
create: 'CREATE TABLE table1 (char_field16 CHAR(14));'

data:
- 'INSERT INTO table1 VALUES (''some char text'');'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ rowCount: '5'

charSet: 'GBK'

create: 'CREATE TABLE table1 (int_field1 INT, varchar_field13 VARCHAR(256), clob_field15 CLOB, char_field16 CHAR(128));'
create: 'CREATE TABLE table1 (int_field1 INT, varchar_field13 VARCHAR(256), clob_field15 CLOB, char_field16 CHAR(13));'

data:
- 'INSERT INTO table1 VALUES (101,''一些帶有char編碼的文本需要轉換為varchar'', ''一些带有char编码的文本需要转换为clob'', ''一些char编码的字符文本'');'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ vectors:

rowCount: '10'

create: 'CREATE TABLE table1 (int_field1 INT, varchar_field13 VARCHAR(256), clob_field15 CLOB, char_field16 CHAR(128));'
create: 'CREATE TABLE table1 (int_field1 INT, varchar_field13 VARCHAR(256), clob_field15 CLOB, char_field16 CHAR(33));'

data:
- 'INSERT INTO table1 VALUES (101,''some text with char encoding that needs to be converted to varchar'', ''some text with char encoding that needs to be converted to clob'', ''some char text with char encoding'');'
Expand Down
Loading

0 comments on commit dbed728

Please sign in to comment.