Merge lp:~mmcm/akiban-client-tools/more-types into lp:~akiban-technologies/akiban-client-tools/trunk

Proposed by Mike McMahon
Status: Merged
Approved by: Nathan Williams
Approved revision: 26
Merged at revision: 25
Proposed branch: lp:~mmcm/akiban-client-tools/more-types
Merge into: lp:~akiban-technologies/akiban-client-tools/trunk
Diff against target: 72 lines (+42/-8)
2 files modified
src/main/java/com/akiban/client/dump/DumpClient.java (+6/-2)
src/test/resources/com/akiban/client/dump/extra.sql (+36/-6)
To merge this branch: bzr merge lp:~mmcm/akiban-client-tools/more-types
Reviewer Review Type Date Requested Status
Nathan Williams Approve
Review via email: mp+161009@code.launchpad.net

Description of the change

Handling remaining type special cases (name from AIS doesn't match what needs to be dumped) and add a test for most of the types that should now pass through okay.

To post a comment you must log in.
Revision history for this message
Nathan Williams (nwilliams) wrote :

As described.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/main/java/com/akiban/client/dump/DumpClient.java'
2--- src/main/java/com/akiban/client/dump/DumpClient.java 2013-04-11 19:17:41 +0000
3+++ src/main/java/com/akiban/client/dump/DumpClient.java 2013-04-25 20:33:26 +0000
4@@ -630,11 +630,15 @@
5 sql.append(type.toUpperCase());
6 sql.append('(').append(length).append(')');
7 }
8- else if ("varbinary".equals(type)) {
9- sql.append("VARCHAR");
10+ else if ("varbinary".equals(type) ||
11+ "binary".equals(type)) {
12+ sql.append("binary".equals(type) ? "CHAR" : "VARCHAR");
13 sql.append('(').append(length).append(')');
14 sql.append(" FOR BIT DATA");
15 }
16+ else if ("float".equals(type)) {
17+ sql.append("REAL");
18+ }
19 else {
20 // Fixed-size numerics have a length, but it doesn't mean much.
21 sql.append(type.toUpperCase());
22
23=== modified file 'src/test/resources/com/akiban/client/dump/extra.sql'
24--- src/test/resources/com/akiban/client/dump/extra.sql 2012-10-08 22:22:52 +0000
25+++ src/test/resources/com/akiban/client/dump/extra.sql 2013-04-25 20:33:26 +0000
26@@ -12,12 +12,42 @@
27 INSERT INTO x_pk VALUES('alfa'),
28 ('bravo');
29
30---- x_unsigned
31-
32-DROP TABLE IF EXISTS x_unsigned;
33-
34-CREATE TABLE x_unsigned(
35- n DECIMAL(10,2) UNSIGNED
36+--- x_types
37+
38+DROP TABLE IF EXISTS x_types;
39+
40+CREATE TABLE x_types(
41+ c1 BIGINT,
42+ c2 BIGINT UNSIGNED,
43+ c3 DOUBLE,
44+ c4 DOUBLE UNSIGNED,
45+ c5 REAL,
46+ c6 REAL UNSIGNED,
47+ c7 INT,
48+ c8 INT UNSIGNED,
49+ c9 MEDIUMINT,
50+ c10 MEDIUMINT UNSIGNED,
51+ c11 SMALLINT,
52+ c12 SMALLINT UNSIGNED,
53+ c13 TINYINT,
54+ c14 TINYINT UNSIGNED,
55+ c15 DATE,
56+ c16 DATETIME,
57+ c17 YEAR,
58+ c18 TIME,
59+ c20 VARCHAR(128) FOR BIT DATA,
60+ c21 CHAR(128) FOR BIT DATA,
61+ c22 VARCHAR(128) CHARACTER SET latin1 COLLATE latin1_swedish_ci,
62+ c23 CHAR(128) CHARACTER SET latin1 COLLATE latin1_swedish_ci,
63+ c24 TINYBLOB CHARACTER SET utf8 COLLATE utf8_bin,
64+ c25 TINYTEXT CHARACTER SET utf8 COLLATE utf8_bin,
65+ c27 TEXT CHARACTER SET utf8 COLLATE utf8_bin,
66+ c28 MEDIUMBLOB CHARACTER SET utf8 COLLATE utf8_bin,
67+ c29 MEDIUMTEXT CHARACTER SET utf8 COLLATE utf8_bin,
68+ c30 LONGBLOB CHARACTER SET utf8 COLLATE utf8_bin,
69+ c31 LONGTEXT CHARACTER SET utf8 COLLATE utf8_bin,
70+ c32 DECIMAL(10,3),
71+ c33 DECIMAL(10,3) UNSIGNED
72 );
73
74

Subscribers

People subscribed via source and target branches