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
=== modified file 'client/drizzledump_data.cc'
--- client/drizzledump_data.cc 2010-09-24 14:56:23 +0000
+++ client/drizzledump_data.cc 2010-09-30 21:26:43 +0000
@@ -397,8 +397,7 @@
397 }397 }
398 os << std::endl;398 os << std::endl;
399 os << ") ENGINE=" << obj.engineName << " ";399 os << ") ENGINE=" << obj.engineName << " ";
400 if ((obj.dcon->getServerType() == DrizzleDumpConnection::SERVER_MYSQL_FOUND)400 if (obj.autoIncrement > 0)
401 and (obj.autoIncrement > 0))
402 {401 {
403 os << "AUTO_INCREMENT=" << obj.autoIncrement << " ";402 os << "AUTO_INCREMENT=" << obj.autoIncrement << " ";
404 }403 }
405404
=== modified file 'client/drizzledump_drizzle.cc'
--- client/drizzledump_drizzle.cc 2010-09-24 16:02:02 +0000
+++ client/drizzledump_drizzle.cc 2010-09-30 21:26:43 +0000
@@ -39,7 +39,7 @@
39 if (verbose)39 if (verbose)
40 std::cerr << _("-- Retrieving table structures for ") << databaseName << "..." << std::endl;40 std::cerr << _("-- Retrieving table structures for ") << databaseName << "..." << std::endl;
4141
42 query="SELECT TABLE_NAME, TABLE_COLLATION, ENGINE FROM DATA_DICTIONARY.TABLES WHERE TABLE_SCHEMA='";42 query="SELECT TABLE_NAME, TABLE_COLLATION, ENGINE, AUTO_INCREMENT FROM DATA_DICTIONARY.TABLES WHERE TABLE_SCHEMA='";
43 query.append(databaseName);43 query.append(databaseName);
44 query.append("' ORDER BY TABLE_NAME");44 query.append("' ORDER BY TABLE_NAME");
4545
@@ -60,7 +60,7 @@
60 table->displayName= displayName;60 table->displayName= displayName;
61 table->collate= row[1];61 table->collate= row[1];
62 table->engineName= row[2];62 table->engineName= row[2];
63 table->autoIncrement= 0;63 table->autoIncrement= boost::lexical_cast<uint64_t>(row[3]);
64 table->database= this;64 table->database= this;
65 if ((not table->populateFields()) or (not table->populateIndexes()))65 if ((not table->populateFields()) or (not table->populateIndexes()))
66 {66 {
6767
=== modified file 'plugin/schema_dictionary/tables.cc'
--- plugin/schema_dictionary/tables.cc 2010-07-20 16:35:49 +0000
+++ plugin/schema_dictionary/tables.cc 2010-09-30 21:26:43 +0000
@@ -54,6 +54,7 @@
54 add_field("TABLE_CREATION_TIME");54 add_field("TABLE_CREATION_TIME");
55 add_field("TABLE_UPDATE_TIME");55 add_field("TABLE_UPDATE_TIME");
56 add_field("TABLE_COMMENT", plugin::TableFunction::STRING, 2048, true);56 add_field("TABLE_COMMENT", plugin::TableFunction::STRING, 2048, true);
57 add_field("AUTO_INCREMENT", plugin::TableFunction::NUMBER, 0, false);
57}58}
5859
59TablesTool::Generator::Generator(Field **arg) :60TablesTool::Generator::Generator(Field **arg) :
@@ -189,4 +190,7 @@
189 {190 {
190 push();191 push();
191 }192 }
193
194 /* AUTO_INCREMENT */
195 push(getTableMessage().options().auto_increment_value());
192}196}
193197
=== modified file 'plugin/schema_dictionary/tests/r/data_dictionary.result'
--- plugin/schema_dictionary/tests/r/data_dictionary.result 2010-09-21 18:52:11 +0000
+++ plugin/schema_dictionary/tests/r/data_dictionary.result 2010-09-30 21:26:43 +0000
@@ -1,7 +1,7 @@
1use data_dictionary;1use data_dictionary;
2SELECT count(*) FROM columns;2SELECT count(*) FROM columns;
3count(*)3count(*)
44994500
5SELECT count(*) FROM indexes;5SELECT count(*) FROM indexes;
6count(*)6count(*)
7070
@@ -20,6 +20,7 @@
20APPLIER20APPLIER
21AS_LOCATOR21AS_LOCATOR
22AUTO_INCREMENT22AUTO_INCREMENT
23AUTO_INCREMENT
23AVG_ROW_LENGTH24AVG_ROW_LENGTH
24Auto_increment25Auto_increment
25Avg_row_length26Avg_row_length
@@ -609,7 +610,8 @@
609 `TABLE_COLLATION` VARCHAR(256) NOT NULL,610 `TABLE_COLLATION` VARCHAR(256) NOT NULL,
610 `TABLE_CREATION_TIME` VARCHAR(256) NOT NULL,611 `TABLE_CREATION_TIME` VARCHAR(256) NOT NULL,
611 `TABLE_UPDATE_TIME` VARCHAR(256) NOT NULL,612 `TABLE_UPDATE_TIME` VARCHAR(256) NOT NULL,
612 `TABLE_COMMENT` VARCHAR(2048) DEFAULT NULL613 `TABLE_COMMENT` VARCHAR(2048) DEFAULT NULL,
614 `AUTO_INCREMENT` BIGINT NOT NULL
613) ENGINE=FunctionEngine COLLATE = utf8_general_ci615) ENGINE=FunctionEngine COLLATE = utf8_general_ci
614show create table TABLE_CONSTRAINTS ;616show create table TABLE_CONSTRAINTS ;
615Table Create Table617Table Create Table
@@ -852,6 +854,7 @@
852DATA_DICTIONARY SHOW_TEMPORARY_TABLES RECORD_LENGTH854DATA_DICTIONARY SHOW_TEMPORARY_TABLES RECORD_LENGTH
853DATA_DICTIONARY SHOW_TEMPORARY_TABLES TABLE_NAME855DATA_DICTIONARY SHOW_TEMPORARY_TABLES TABLE_NAME
854DATA_DICTIONARY SHOW_TEMPORARY_TABLES TABLE_SCHEMA856DATA_DICTIONARY SHOW_TEMPORARY_TABLES TABLE_SCHEMA
857DATA_DICTIONARY TABLES AUTO_INCREMENT
855DATA_DICTIONARY TABLES ENGINE858DATA_DICTIONARY TABLES ENGINE
856DATA_DICTIONARY TABLES ROW_FORMAT859DATA_DICTIONARY TABLES ROW_FORMAT
857DATA_DICTIONARY TABLES TABLE_COLLATION860DATA_DICTIONARY TABLES TABLE_COLLATION
@@ -1562,6 +1565,7 @@
1562SHOW_TEMPORARY_TABLES DATA_DICTIONARY RECORD_LENGTH1565SHOW_TEMPORARY_TABLES DATA_DICTIONARY RECORD_LENGTH
1563SHOW_TEMPORARY_TABLES DATA_DICTIONARY TABLE_NAME1566SHOW_TEMPORARY_TABLES DATA_DICTIONARY TABLE_NAME
1564SHOW_TEMPORARY_TABLES DATA_DICTIONARY TABLE_SCHEMA1567SHOW_TEMPORARY_TABLES DATA_DICTIONARY TABLE_SCHEMA
1568TABLES DATA_DICTIONARY AUTO_INCREMENT
1565TABLES DATA_DICTIONARY ENGINE1569TABLES DATA_DICTIONARY ENGINE
1566TABLES DATA_DICTIONARY ROW_FORMAT1570TABLES DATA_DICTIONARY ROW_FORMAT
1567TABLES DATA_DICTIONARY TABLE_COLLATION1571TABLES DATA_DICTIONARY TABLE_COLLATION
@@ -2064,6 +2068,7 @@
2064SHOW_TEMPORARY_TABLES DATA_DICTIONARY RECORD_LENGTH2068SHOW_TEMPORARY_TABLES DATA_DICTIONARY RECORD_LENGTH
2065SHOW_TEMPORARY_TABLES DATA_DICTIONARY TABLE_NAME2069SHOW_TEMPORARY_TABLES DATA_DICTIONARY TABLE_NAME
2066SHOW_TEMPORARY_TABLES DATA_DICTIONARY TABLE_SCHEMA2070SHOW_TEMPORARY_TABLES DATA_DICTIONARY TABLE_SCHEMA
2071TABLES DATA_DICTIONARY AUTO_INCREMENT
2067TABLES DATA_DICTIONARY ENGINE2072TABLES DATA_DICTIONARY ENGINE
2068TABLES DATA_DICTIONARY ROW_FORMAT2073TABLES DATA_DICTIONARY ROW_FORMAT
2069TABLES DATA_DICTIONARY TABLE_COLLATION2074TABLES DATA_DICTIONARY TABLE_COLLATION
20702075
=== modified file 'tests/r/data_dictionary_like_info.result'
--- tests/r/data_dictionary_like_info.result 2010-09-21 10:25:01 +0000
+++ tests/r/data_dictionary_like_info.result 2010-09-30 21:26:43 +0000
@@ -341,9 +341,9 @@
341select * from data_dictionary.schemas where schema_name = NULL;341select * from data_dictionary.schemas where schema_name = NULL;
342SCHEMA_NAME DEFAULT_COLLATION_NAME SCHEMA_CREATION_TIME SCHEMA_UPDATE_TIME342SCHEMA_NAME DEFAULT_COLLATION_NAME SCHEMA_CREATION_TIME SCHEMA_UPDATE_TIME
343select * from data_dictionary.tables where table_schema = NULL;343select * from data_dictionary.tables where table_schema = NULL;
344TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_COLLATION TABLE_CREATION_TIME TABLE_UPDATE_TIME TABLE_COMMENT344TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_COLLATION TABLE_CREATION_TIME TABLE_UPDATE_TIME TABLE_COMMENT AUTO_INCREMENT
345select * from data_dictionary.tables where table_name = NULL;345select * from data_dictionary.tables where table_name = NULL;
346TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_COLLATION TABLE_CREATION_TIME TABLE_UPDATE_TIME TABLE_COMMENT346TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_COLLATION TABLE_CREATION_TIME TABLE_UPDATE_TIME TABLE_COMMENT AUTO_INCREMENT
347#347#
348# Test that the query is visible to self and others.348# Test that the query is visible to self and others.
349#349#

Subscribers

People subscribed via source and target branches