Merge lp:~linuxjedi/drizzle/elliott-bug-652228 into lp:drizzle/7.0

Proposed by Andrew Hutchings
Status: Merged
Approved by: Brian Aker
Approved revision: 1804
Merge reported by: Lee Bieber
Merged at revision: not available
Proposed branch: lp:~linuxjedi/drizzle/elliott-bug-652228
Merge into: lp:drizzle/7.0
Diff against target: 126 lines (+16/-8)
5 files modified
client/drizzledump_data.cc (+1/-2)
client/drizzledump_drizzle.cc (+2/-2)
plugin/schema_dictionary/tables.cc (+4/-0)
plugin/schema_dictionary/tests/r/data_dictionary.result (+7/-2)
tests/r/data_dictionary_like_info.result (+2/-2)
To merge this branch: bzr merge lp:~linuxjedi/drizzle/elliott-bug-652228
Reviewer Review Type Date Requested Status
Drizzle Merge Team Pending
Review via email: mp+37193@code.launchpad.net

Description of the change

Add auto_increment to data_dictionary.tables and drizzledump when connecting to a Drizzle server.

Note: auto_increment data in message proto is still broken, that is another bug.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'client/drizzledump_data.cc'
2--- client/drizzledump_data.cc 2010-09-24 14:56:23 +0000
3+++ client/drizzledump_data.cc 2010-09-30 21:26:43 +0000
4@@ -397,8 +397,7 @@
5 }
6 os << std::endl;
7 os << ") ENGINE=" << obj.engineName << " ";
8- if ((obj.dcon->getServerType() == DrizzleDumpConnection::SERVER_MYSQL_FOUND)
9- and (obj.autoIncrement > 0))
10+ if (obj.autoIncrement > 0)
11 {
12 os << "AUTO_INCREMENT=" << obj.autoIncrement << " ";
13 }
14
15=== modified file 'client/drizzledump_drizzle.cc'
16--- client/drizzledump_drizzle.cc 2010-09-24 16:02:02 +0000
17+++ client/drizzledump_drizzle.cc 2010-09-30 21:26:43 +0000
18@@ -39,7 +39,7 @@
19 if (verbose)
20 std::cerr << _("-- Retrieving table structures for ") << databaseName << "..." << std::endl;
21
22- query="SELECT TABLE_NAME, TABLE_COLLATION, ENGINE FROM DATA_DICTIONARY.TABLES WHERE TABLE_SCHEMA='";
23+ query="SELECT TABLE_NAME, TABLE_COLLATION, ENGINE, AUTO_INCREMENT FROM DATA_DICTIONARY.TABLES WHERE TABLE_SCHEMA='";
24 query.append(databaseName);
25 query.append("' ORDER BY TABLE_NAME");
26
27@@ -60,7 +60,7 @@
28 table->displayName= displayName;
29 table->collate= row[1];
30 table->engineName= row[2];
31- table->autoIncrement= 0;
32+ table->autoIncrement= boost::lexical_cast<uint64_t>(row[3]);
33 table->database= this;
34 if ((not table->populateFields()) or (not table->populateIndexes()))
35 {
36
37=== modified file 'plugin/schema_dictionary/tables.cc'
38--- plugin/schema_dictionary/tables.cc 2010-07-20 16:35:49 +0000
39+++ plugin/schema_dictionary/tables.cc 2010-09-30 21:26:43 +0000
40@@ -54,6 +54,7 @@
41 add_field("TABLE_CREATION_TIME");
42 add_field("TABLE_UPDATE_TIME");
43 add_field("TABLE_COMMENT", plugin::TableFunction::STRING, 2048, true);
44+ add_field("AUTO_INCREMENT", plugin::TableFunction::NUMBER, 0, false);
45 }
46
47 TablesTool::Generator::Generator(Field **arg) :
48@@ -189,4 +190,7 @@
49 {
50 push();
51 }
52+
53+ /* AUTO_INCREMENT */
54+ push(getTableMessage().options().auto_increment_value());
55 }
56
57=== modified file 'plugin/schema_dictionary/tests/r/data_dictionary.result'
58--- plugin/schema_dictionary/tests/r/data_dictionary.result 2010-09-21 18:52:11 +0000
59+++ plugin/schema_dictionary/tests/r/data_dictionary.result 2010-09-30 21:26:43 +0000
60@@ -1,7 +1,7 @@
61 use data_dictionary;
62 SELECT count(*) FROM columns;
63 count(*)
64-499
65+500
66 SELECT count(*) FROM indexes;
67 count(*)
68 0
69@@ -20,6 +20,7 @@
70 APPLIER
71 AS_LOCATOR
72 AUTO_INCREMENT
73+AUTO_INCREMENT
74 AVG_ROW_LENGTH
75 Auto_increment
76 Avg_row_length
77@@ -609,7 +610,8 @@
78 `TABLE_COLLATION` VARCHAR(256) NOT NULL,
79 `TABLE_CREATION_TIME` VARCHAR(256) NOT NULL,
80 `TABLE_UPDATE_TIME` VARCHAR(256) NOT NULL,
81- `TABLE_COMMENT` VARCHAR(2048) DEFAULT NULL
82+ `TABLE_COMMENT` VARCHAR(2048) DEFAULT NULL,
83+ `AUTO_INCREMENT` BIGINT NOT NULL
84 ) ENGINE=FunctionEngine COLLATE = utf8_general_ci
85 show create table TABLE_CONSTRAINTS ;
86 Table Create Table
87@@ -852,6 +854,7 @@
88 DATA_DICTIONARY SHOW_TEMPORARY_TABLES RECORD_LENGTH
89 DATA_DICTIONARY SHOW_TEMPORARY_TABLES TABLE_NAME
90 DATA_DICTIONARY SHOW_TEMPORARY_TABLES TABLE_SCHEMA
91+DATA_DICTIONARY TABLES AUTO_INCREMENT
92 DATA_DICTIONARY TABLES ENGINE
93 DATA_DICTIONARY TABLES ROW_FORMAT
94 DATA_DICTIONARY TABLES TABLE_COLLATION
95@@ -1562,6 +1565,7 @@
96 SHOW_TEMPORARY_TABLES DATA_DICTIONARY RECORD_LENGTH
97 SHOW_TEMPORARY_TABLES DATA_DICTIONARY TABLE_NAME
98 SHOW_TEMPORARY_TABLES DATA_DICTIONARY TABLE_SCHEMA
99+TABLES DATA_DICTIONARY AUTO_INCREMENT
100 TABLES DATA_DICTIONARY ENGINE
101 TABLES DATA_DICTIONARY ROW_FORMAT
102 TABLES DATA_DICTIONARY TABLE_COLLATION
103@@ -2064,6 +2068,7 @@
104 SHOW_TEMPORARY_TABLES DATA_DICTIONARY RECORD_LENGTH
105 SHOW_TEMPORARY_TABLES DATA_DICTIONARY TABLE_NAME
106 SHOW_TEMPORARY_TABLES DATA_DICTIONARY TABLE_SCHEMA
107+TABLES DATA_DICTIONARY AUTO_INCREMENT
108 TABLES DATA_DICTIONARY ENGINE
109 TABLES DATA_DICTIONARY ROW_FORMAT
110 TABLES DATA_DICTIONARY TABLE_COLLATION
111
112=== modified file 'tests/r/data_dictionary_like_info.result'
113--- tests/r/data_dictionary_like_info.result 2010-09-21 10:25:01 +0000
114+++ tests/r/data_dictionary_like_info.result 2010-09-30 21:26:43 +0000
115@@ -341,9 +341,9 @@
116 select * from data_dictionary.schemas where schema_name = NULL;
117 SCHEMA_NAME DEFAULT_COLLATION_NAME SCHEMA_CREATION_TIME SCHEMA_UPDATE_TIME
118 select * from data_dictionary.tables where table_schema = NULL;
119-TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_COLLATION TABLE_CREATION_TIME TABLE_UPDATE_TIME TABLE_COMMENT
120+TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_COLLATION TABLE_CREATION_TIME TABLE_UPDATE_TIME TABLE_COMMENT AUTO_INCREMENT
121 select * from data_dictionary.tables where table_name = NULL;
122-TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_COLLATION TABLE_CREATION_TIME TABLE_UPDATE_TIME TABLE_COMMENT
123+TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_COLLATION TABLE_CREATION_TIME TABLE_UPDATE_TIME TABLE_COMMENT AUTO_INCREMENT
124 #
125 # Test that the query is visible to self and others.
126 #

Subscribers

People subscribed via source and target branches