Merge lp:~stewart/drizzle/tableshare-use-tableidentifier into lp:~drizzle-trunk/drizzle/development

Proposed by Stewart Smith
Status: Work in progress
Proposed branch: lp:~stewart/drizzle/tableshare-use-tableidentifier
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: 1271 lines (+305/-150)
37 files modified
drizzled/catalog/local.cc (+9/-1)
drizzled/catalog/local.h (+4/-1)
drizzled/data_home.cc (+2/-12)
drizzled/data_home.h (+0/-2)
drizzled/drizzled.cc (+1/-1)
drizzled/errmsg_print.cc (+1/-1)
drizzled/function/str/load_file.cc (+3/-2)
drizzled/identifier/catalog.cc (+1/-1)
drizzled/identifier/catalog.h (+7/-1)
drizzled/identifier/schema.cc (+6/-3)
drizzled/identifier/schema.h (+3/-0)
drizzled/identifier/table.cc (+7/-3)
drizzled/identifier/table.h (+2/-2)
drizzled/main.cc (+0/-5)
drizzled/session.cc (+2/-2)
drizzled/sql_load.cc (+3/-2)
drizzled/table/instance/base.cc (+20/-28)
drizzled/table/instance/base.h (+5/-6)
plugin/innobase/dict/dict0dict.cc (+13/-2)
plugin/innobase/handler/ha_innodb.cc (+28/-1)
plugin/innobase/tests/r/innodb-system-table-view.result (+9/-9)
plugin/schema_engine/schema.cc (+10/-3)
plugin/table_cache_dictionary/tests/r/table_cache.result (+2/-2)
plugin/table_cache_dictionary/tests/r/table_definition_cache.result (+2/-2)
plugin/tableprototester/tableprototester.cc (+8/-8)
plugin/transaction_log/hexdump_transaction_message.cc (+1/-1)
plugin/transaction_log/module.cc (+1/-1)
plugin/transaction_log/print_transaction_message.cc (+1/-1)
plugin/transaction_log/tests/r/bug660779.result (+6/-6)
plugin/transaction_log/tests/r/bug911643.result (+71/-0)
plugin/transaction_log/tests/r/variables.result (+1/-1)
plugin/transaction_log/tests/t/bug660779.test (+3/-3)
plugin/transaction_log/tests/t/bug911643-master.opt (+1/-0)
plugin/transaction_log/tests/t/bug911643.test (+28/-0)
tests/r/broken_table_proto_file.result (+1/-1)
tests/r/show_check.result (+28/-28)
unittests/table_identifier.cc (+15/-8)
To merge this branch: bzr merge lp:~stewart/drizzle/tableshare-use-tableidentifier
Reviewer Review Type Date Requested Status
Brian Aker Pending
Drizzle Merge Team Pending
Review via email: mp+87557@code.launchpad.net

Description of the change

This switches TableShare over to use an identifier instead of two strings (db and table_name).

This makes one change to some appearances of a couple of data_dictionary tables. Odds are these were always incorrect (IIRC all I_S table names should be all UPPER_CASE anyway - because SQL loves to shout).

http://jenkins.drizzle.org/view/Drizzle-param/job/drizzle-param/914/

To post a comment you must log in.

Unmerged revisions

2489. By Stewart Smith

merge table_identifier unittest fix

2488. By Stewart Smith

TableShare use a TableIdentifier instead of db,table strings.

2487. By Stewart Smith

merge print_transaction_message filename/path bug fix (also hit in testing CATALOG)

2486. By Stewart Smith

merge off-by-one error message fix (was hitting this)

2485. By Stewart Smith

Schema identifier has a Catalog identifier. Use it instead of catalog::local_identifier() in most places in Schema identifier code

2484. By Stewart Smith

update innodb-system-table-view.result to include CATALOG in path to table

2483. By Stewart Smith

modify tableprototester to include local/ in the path for the test tables

2482. By Stewart Smith

modify transaction_log plugin to default to local/transaction.log to keep backwards compatibility with old drizzled (before chdir to local/ was removed)

2481. By Stewart Smith

no longer chdir into local CATALOG. Instead, generate paths everywhere (well... in identifiers) that include the path to the correct CATALOG. Currently that's just LOCAL, but we get closer. Also added is some backwards compatibility code in InnoDB for old data dictionary entries that didn't include CATALOG in catalog/db/table but just had db/table. The next step is to construct the table and schema identifiers with the current CATALOG.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'drizzled/catalog/local.cc'
--- drizzled/catalog/local.cc 2011-09-18 17:33:22 +0000
+++ drizzled/catalog/local.cc 2012-01-05 00:31:36 +0000
@@ -1,7 +1,7 @@
1/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-1/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *3 *
4 * Copyright (C) 2010 Brian Aker4 * Copyright (C) 2010-2011 Brian Aker, Stewart Smith
5 *5 *
6 * This program is free software; you can redistribute it and/or modify6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by7 * it under the terms of the GNU General Public License as published by
@@ -42,6 +42,14 @@
42 return default_catalog;42 return default_catalog;
43}43}
4444
45void resetPath_for_local_identifier()
46{
47 /* this is currently commented out to do nothing as we don't need
48 to reset the relative path ../local to anything but that.
49 We will need to enable this when we don't chdir into local on startup */
50// default_catalog.resetPath();
51}
52
45Instance::shared_ptr local()53Instance::shared_ptr local()
46{54{
47 boost::call_once(&init, run_once);55 boost::call_once(&init, run_once);
4856
=== modified file 'drizzled/catalog/local.h'
--- drizzled/catalog/local.h 2011-03-23 23:34:24 +0000
+++ drizzled/catalog/local.h 2012-01-05 00:31:36 +0000
@@ -1,7 +1,7 @@
1/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-1/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *3 *
4 * Copyright (C) 2010 Brian Aker4 * Copyright (C) 2010-2011 Brian Aker, Stewart Smith
5 *5 *
6 * This program is free software; you can redistribute it and/or modify6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by7 * it under the terms of the GNU General Public License as published by
@@ -28,6 +28,9 @@
28namespace drizzled {28namespace drizzled {
29namespace catalog {29namespace catalog {
3030
31/* only for use by drizzled after command line parsing (new datadir) */
32void resetPath_for_local_identifier();
33
31DRIZZLED_API const identifier::Catalog& local_identifier();34DRIZZLED_API const identifier::Catalog& local_identifier();
32DRIZZLED_API Instance::shared_ptr local();35DRIZZLED_API Instance::shared_ptr local();
3336
3437
=== modified file 'drizzled/data_home.cc'
--- drizzled/data_home.cc 2011-06-16 15:27:28 +0000
+++ drizzled/data_home.cc 2012-01-05 00:31:36 +0000
@@ -1,7 +1,7 @@
1/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-1/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *3 *
4 * Copyright (C) 2011 Brian Aker4 * Copyright (C) 2011 Brian Aker, Stewart Smith
5 *5 *
6 * This program is free software; you can redistribute it and/or modify6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by7 * it under the terms of the GNU General Public License as published by
@@ -22,12 +22,12 @@
22#include <boost/filesystem.hpp>22#include <boost/filesystem.hpp>
23#include <drizzled/configmake.h>23#include <drizzled/configmake.h>
24#include <drizzled/data_home.h>24#include <drizzled/data_home.h>
25#include <drizzled/catalog.h>
2526
26namespace drizzled {27namespace drizzled {
2728
28static boost::filesystem::path data_home(LOCALSTATEDIR);29static boost::filesystem::path data_home(LOCALSTATEDIR);
29static boost::filesystem::path full_data_home(LOCALSTATEDIR);30static boost::filesystem::path full_data_home(LOCALSTATEDIR);
30static boost::filesystem::path data_home_catalog(LOCALSTATEDIR);
3131
32const boost::filesystem::path& getFullDataHome()32const boost::filesystem::path& getFullDataHome()
33{33{
@@ -39,11 +39,6 @@
39 return data_home;39 return data_home;
40}40}
4141
42const boost::filesystem::path& getDataHomeCatalog()
43{
44 return data_home_catalog;
45}
46
47boost::filesystem::path& getMutableDataHome()42boost::filesystem::path& getMutableDataHome()
48{43{
49 return data_home;44 return data_home;
@@ -54,9 +49,4 @@
54 full_data_home= v;49 full_data_home= v;
55}50}
5651
57void setDataHomeCatalog(const boost::filesystem::path& v)
58{
59 data_home_catalog= v;
60}
61
62} // namespace drizzled52} // namespace drizzled
6353
=== modified file 'drizzled/data_home.h'
--- drizzled/data_home.h 2011-06-16 15:27:28 +0000
+++ drizzled/data_home.h 2012-01-05 00:31:36 +0000
@@ -26,10 +26,8 @@
2626
27DRIZZLED_API const boost::filesystem::path& getFullDataHome();27DRIZZLED_API const boost::filesystem::path& getFullDataHome();
28DRIZZLED_API const boost::filesystem::path& getDataHome();28DRIZZLED_API const boost::filesystem::path& getDataHome();
29DRIZZLED_API const boost::filesystem::path& getDataHomeCatalog();
30DRIZZLED_API boost::filesystem::path& getMutableDataHome();29DRIZZLED_API boost::filesystem::path& getMutableDataHome();
31DRIZZLED_API void setFullDataHome(const boost::filesystem::path&);30DRIZZLED_API void setFullDataHome(const boost::filesystem::path&);
32DRIZZLED_API void setDataHomeCatalog(const boost::filesystem::path&);
3331
34} /* namespace drizzled */32} /* namespace drizzled */
3533
3634
=== modified file 'drizzled/drizzled.cc'
--- drizzled/drizzled.cc 2012-01-03 01:17:08 +0000
+++ drizzled/drizzled.cc 2012-01-05 00:31:36 +0000
@@ -1977,7 +1977,7 @@
1977*/1977*/
1978static void get_options()1978static void get_options()
1979{1979{
1980 setDataHomeCatalog(getDataHome() / "local");1980 catalog::resetPath_for_local_identifier();
19811981
1982 if (vm.count("user"))1982 if (vm.count("user"))
1983 {1983 {
19841984
=== modified file 'drizzled/errmsg_print.cc'
--- drizzled/errmsg_print.cc 2011-10-20 02:45:57 +0000
+++ drizzled/errmsg_print.cc 2012-01-05 00:31:36 +0000
@@ -74,7 +74,7 @@
7474
75 if (not extra.empty())75 if (not extra.empty())
76 {76 {
77 if (message.at(message.size()) != ' ')77 if (message.at(message.size()-1) != ' ')
78 message+= " ";78 message+= " ";
7979
80 message+= "'";80 message+= "'";
8181
=== modified file 'drizzled/function/str/load_file.cc'
--- drizzled/function/str/load_file.cc 2011-06-22 22:23:29 +0000
+++ drizzled/function/str/load_file.cc 2012-01-05 00:31:36 +0000
@@ -2,6 +2,7 @@
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *3 *
4 * Copyright (C) 2008 Sun Microsystems, Inc.4 * Copyright (C) 2008 Sun Microsystems, Inc.
5 * Copyright (C) 2011 Stewart Smith
5 *6 *
6 * This program is free software; you can redistribute it and/or modify7 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by8 * it under the terms of the GNU General Public License as published by
@@ -21,7 +22,7 @@
21#include <drizzled/function/str/strfunc.h>22#include <drizzled/function/str/strfunc.h>
22#include <drizzled/function/str/load_file.h>23#include <drizzled/function/str/load_file.h>
23#include <drizzled/error.h>24#include <drizzled/error.h>
24#include <drizzled/data_home.h>25#include <drizzled/catalog/local.h>
25#include <drizzled/session.h>26#include <drizzled/session.h>
26#include <drizzled/internal/my_sys.h>27#include <drizzled/internal/my_sys.h>
27#include <drizzled/sys_var.h>28#include <drizzled/sys_var.h>
@@ -52,7 +53,7 @@
52 return 0;53 return 0;
53 }54 }
5455
55 fs::path target_path(fs::system_complete(getDataHomeCatalog()));56 fs::path target_path(fs::system_complete(catalog::local_identifier().getPath()));
56 fs::path to_file(file_name->c_ptr());57 fs::path to_file(file_name->c_ptr());
57 if (not to_file.has_root_directory())58 if (not to_file.has_root_directory())
58 {59 {
5960
=== modified file 'drizzled/identifier/catalog.cc'
--- drizzled/identifier/catalog.cc 2011-10-19 09:25:53 +0000
+++ drizzled/identifier/catalog.cc 2012-01-05 00:31:36 +0000
@@ -50,7 +50,7 @@
50void Catalog::init()50void Catalog::init()
51{ 51{
52 assert(not _name.empty());52 assert(not _name.empty());
53 path += "../";53 path.clear();
54 path += util::tablename_to_filename(_name);54 path += util::tablename_to_filename(_name);
55 assert(path.length()); // TODO throw exception, this is a possibility55 assert(path.length()); // TODO throw exception, this is a possibility
56 hash_value= util::insensitive_hash()(path);56 hash_value= util::insensitive_hash()(path);
5757
=== modified file 'drizzled/identifier/catalog.h'
--- drizzled/identifier/catalog.h 2011-09-18 17:33:22 +0000
+++ drizzled/identifier/catalog.h 2012-01-05 00:31:36 +0000
@@ -35,7 +35,7 @@
35namespace drizzled {35namespace drizzled {
36namespace identifier {36namespace identifier {
3737
38class Catalog : public Identifier38class DRIZZLED_API Catalog : public Identifier
39{39{
40public:40public:
41 Catalog(str_ref);41 Catalog(str_ref);
@@ -81,6 +81,12 @@
81 {81 {
82 return boost::iequals(left.getName(), right.getName());82 return boost::iequals(left.getName(), right.getName());
83 }83 }
84
85 void resetPath()
86 {
87 init();
88 }
89
84private:90private:
85 void init();91 void init();
8692
8793
=== modified file 'drizzled/identifier/schema.cc'
--- drizzled/identifier/schema.cc 2011-10-19 09:25:53 +0000
+++ drizzled/identifier/schema.cc 2012-01-05 00:31:36 +0000
@@ -42,7 +42,8 @@
42namespace identifier {42namespace identifier {
4343
44Schema::Schema(str_ref db_arg) :44Schema::Schema(str_ref db_arg) :
45 db(db_arg.data(), db_arg.size())45 db(db_arg.data(), db_arg.size()),
46 _catalog(drizzled::catalog::local_identifier())
46{ 47{
47#if 048#if 0
48 string::size_type lastPos= db.find_first_of('/', 0);49 string::size_type lastPos= db.find_first_of('/', 0);
@@ -56,6 +57,8 @@
5657
57 if (not db_arg.empty())58 if (not db_arg.empty())
58 {59 {
60 db_path += _catalog.getPath();
61 db_path += FN_LIBCHAR;
59 db_path += util::tablename_to_filename(db);62 db_path += util::tablename_to_filename(db);
60 assert(db_path.length()); // TODO throw exception, this is a possibility63 assert(db_path.length()); // TODO throw exception, this is a possibility
61 }64 }
@@ -95,12 +98,12 @@
9598
96const std::string &Schema::getCatalogName() const99const std::string &Schema::getCatalogName() const
97{100{
98 return drizzled::catalog::local_identifier().name();101 return _catalog.name();
99}102}
100103
101std::ostream& operator<<(std::ostream& output, const Schema&identifier)104std::ostream& operator<<(std::ostream& output, const Schema&identifier)
102{105{
103 return output << "identifier::Schema:(" << drizzled::catalog::local_identifier() << ", " << identifier.getSchemaName() << ", " << identifier.getPath() << ")";106 return output << "identifier::Schema:(" << identifier.getCatalogName() << ", " << identifier.getSchemaName() << ", " << identifier.getPath() << ")";
104}107}
105108
106} /* namespace identifier */109} /* namespace identifier */
107110
=== modified file 'drizzled/identifier/schema.h'
--- drizzled/identifier/schema.h 2011-10-18 13:52:19 +0000
+++ drizzled/identifier/schema.h 2012-01-05 00:31:36 +0000
@@ -37,10 +37,13 @@
37namespace drizzled {37namespace drizzled {
38namespace identifier {38namespace identifier {
3939
40class Catalog;
41
40class DRIZZLED_API Schema : public Identifier42class DRIZZLED_API Schema : public Identifier
41{43{
42 std::string db;44 std::string db;
43 std::string db_path;45 std::string db_path;
46 drizzled::identifier::Catalog _catalog;
4447
45public:48public:
46 Schema(str_ref);49 Schema(str_ref);
4750
=== modified file 'drizzled/identifier/table.cc'
--- drizzled/identifier/table.cc 2011-10-19 09:25:53 +0000
+++ drizzled/identifier/table.cc 2012-01-05 00:31:36 +0000
@@ -33,6 +33,7 @@
3333
34#include <drizzled/util/string.h>34#include <drizzled/util/string.h>
35#include <drizzled/util/tablename_to_filename.h>35#include <drizzled/util/tablename_to_filename.h>
36#include <drizzled/catalog/local.h>
3637
37#include <algorithm>38#include <algorithm>
38#include <sstream>39#include <sstream>
@@ -179,7 +180,8 @@
179180
180std::string Table::build_table_filename(const std::string &in_db, const std::string &in_table_name, bool is_tmp)181std::string Table::build_table_filename(const std::string &in_db, const std::string &in_table_name, bool is_tmp)
181{182{
182 string in_path= util::tablename_to_filename(in_db) + FN_LIBCHAR;183 string in_path= drizzled::catalog::local_identifier().getPath();
184 in_path+= FN_LIBCHAR + util::tablename_to_filename(in_db) + FN_LIBCHAR;
183 return in_path + (is_tmp ? in_table_name : util::tablename_to_filename(in_table_name));185 return in_path + (is_tmp ? in_table_name : util::tablename_to_filename(in_table_name));
184}186}
185187
@@ -221,7 +223,7 @@
221 }223 }
222224
223 hash_value= util::insensitive_hash()(path);225 hash_value= util::insensitive_hash()(path);
224 key.set(getKeySize(), getSchemaName(), boost::to_lower_copy(std::string(getTableName())));226 key.set(getKeySize(), getCatalogName(), getSchemaName(), boost::to_lower_copy(std::string(getTableName())));
225}227}
226228
227229
@@ -284,12 +286,14 @@
284 message.set_schema(getSchemaName());286 message.set_schema(getSchemaName());
285}287}
286288
287void Table::Key::set(size_t resize_arg, const std::string &a, const std::string &b)289 void Table::Key::set(size_t resize_arg, const std::string &a, const std::string &b, const std::string &c)
288{290{
289 key_buffer.resize(resize_arg);291 key_buffer.resize(resize_arg);
290292
291 std::copy(a.begin(), a.end(), key_buffer.begin());293 std::copy(a.begin(), a.end(), key_buffer.begin());
292 std::copy(b.begin(), b.end(), key_buffer.begin() + a.length() + 1);294 std::copy(b.begin(), b.end(), key_buffer.begin() + a.length() + 1);
295 std::copy(c.begin(), c.end(),
296 key_buffer.begin() + a.length() + 1 + b.length() + 1);
293297
294 util::sensitive_hash hasher;298 util::sensitive_hash hasher;
295 hash_value= hasher(key_buffer);299 hash_value= hasher(key_buffer);
296300
=== modified file 'drizzled/identifier/table.h'
--- drizzled/identifier/table.h 2011-11-22 06:24:37 +0000
+++ drizzled/identifier/table.h 2012-01-05 00:31:36 +0000
@@ -81,7 +81,7 @@
81 return key_buffer;81 return key_buffer;
82 }82 }
8383
84 void set(size_t resize_arg, const std::string &a, const std::string &b);84 void set(size_t resize_arg, const std::string &a, const std::string &b, const std::string &c);
8585
86 friend bool operator==(const Key &left, const Key &right)86 friend bool operator==(const Key &left, const Key &right)
87 {87 {
@@ -123,7 +123,7 @@
123123
124 size_t getKeySize() const124 size_t getKeySize() const
125 {125 {
126 return getSchemaName().size() + getTableName().size() + 2;126 return getCatalogName().size() + getSchemaName().size() + getTableName().size() + 3;
127 }127 }
128128
129public:129public:
130130
=== modified file 'drizzled/main.cc'
--- drizzled/main.cc 2011-10-19 19:30:54 +0000
+++ drizzled/main.cc 2012-01-05 00:31:36 +0000
@@ -336,11 +336,6 @@
336 }336 }
337 }337 }
338338
339 if (chdir("local") == -1)
340 {
341 unireg_abort << "Local catalog does not exist, was unable to chdir() to " << getDataHome().file_string();
342 }
343
344 setFullDataHome(boost::filesystem::system_complete(getDataHome()));339 setFullDataHome(boost::filesystem::system_complete(getDataHome()));
345 errmsg_printf(error::INFO, "Data Home directory is : %s", getFullDataHome().native_file_string().c_str());340 errmsg_printf(error::INFO, "Data Home directory is : %s", getFullDataHome().native_file_string().c_str());
346 }341 }
347342
=== modified file 'drizzled/session.cc'
--- drizzled/session.cc 2011-11-09 20:20:23 +0000
+++ drizzled/session.cc 2012-01-05 00:31:36 +0000
@@ -27,7 +27,7 @@
27#include <boost/filesystem.hpp>27#include <boost/filesystem.hpp>
28#include <boost/ptr_container/ptr_container.hpp>28#include <boost/ptr_container/ptr_container.hpp>
29#include <drizzled/copy_field.h>29#include <drizzled/copy_field.h>
30#include <drizzled/data_home.h>30#include <drizzled/catalog/local.h>
31#include <drizzled/diagnostics_area.h>31#include <drizzled/diagnostics_area.h>
32#include <drizzled/display.h>32#include <drizzled/display.h>
33#include <drizzled/drizzled.h>33#include <drizzled/drizzled.h>
@@ -996,7 +996,7 @@
996996
997 if (not to_file.has_root_directory())997 if (not to_file.has_root_directory())
998 {998 {
999 target_path= fs::system_complete(getDataHomeCatalog());999 target_path= fs::system_complete(catalog::local_identifier().getPath());
1000 util::string::ptr schema(session.schema());1000 util::string::ptr schema(session.schema());
1001 if (not schema->empty())1001 if (not schema->empty())
1002 {1002 {
10031003
=== modified file 'drizzled/sql_load.cc'
--- drizzled/sql_load.cc 2011-10-18 11:01:40 +0000
+++ drizzled/sql_load.cc 2012-01-05 00:31:36 +0000
@@ -1,4 +1,5 @@
1/* Copyright (C) 2000-2006 MySQL AB1/* Copyright (C) 2000-2006 MySQL AB
2 Copyright (C) 2011 Stewart Smith
23
3 This program is free software; you can redistribute it and/or modify4 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by5 it under the terms of the GNU General Public License as published by
@@ -20,7 +21,7 @@
2021
21#include <drizzled/sql_load.h>22#include <drizzled/sql_load.h>
22#include <drizzled/error.h>23#include <drizzled/error.h>
23#include <drizzled/data_home.h>24#include <drizzled/catalog/local.h>
24#include <drizzled/session.h>25#include <drizzled/session.h>
25#include <drizzled/sql_base.h>26#include <drizzled/sql_base.h>
26#include <drizzled/field/epoch.h>27#include <drizzled/field/epoch.h>
@@ -263,7 +264,7 @@
263 }264 }
264265
265 fs::path to_file(ex->file_name);266 fs::path to_file(ex->file_name);
266 fs::path target_path(fs::system_complete(getDataHomeCatalog()));267 fs::path target_path(fs::system_complete(catalog::local_identifier().getPath()));
267 if (not to_file.has_root_directory())268 if (not to_file.has_root_directory())
268 {269 {
269 int count_elements= 0;270 int count_elements= 0;
270271
=== modified file 'drizzled/table/instance/base.cc'
--- drizzled/table/instance/base.cc 2011-10-29 18:07:51 +0000
+++ drizzled/table/instance/base.cc 2012-01-05 00:31:36 +0000
@@ -230,6 +230,7 @@
230 key_info(NULL),230 key_info(NULL),
231 mem_root(TABLE_ALLOC_BLOCK_SIZE),231 mem_root(TABLE_ALLOC_BLOCK_SIZE),
232 all_set(),232 all_set(),
233 table_identifier(NULL),
233 block_size(0),234 block_size(0),
234 version(0),235 version(0),
235 timestamp_offset(0),236 timestamp_offset(0),
@@ -289,6 +290,7 @@
289 mem_root(TABLE_ALLOC_BLOCK_SIZE),290 mem_root(TABLE_ALLOC_BLOCK_SIZE),
290 table_charset(0),291 table_charset(0),
291 all_set(),292 all_set(),
293 table_identifier(NULL),
292 block_size(0),294 block_size(0),
293 version(0),295 version(0),
294 timestamp_offset(0),296 timestamp_offset(0),
@@ -328,6 +330,8 @@
328 keys_in_use(0),330 keys_in_use(0),
329 keys_for_keyread(0)331 keys_for_keyread(0)
330{332{
333 table_identifier= new identifier::Table(identifier);
334
331 assert(identifier.getKey() == key);335 assert(identifier.getKey() == key);
332336
333 private_key_for_cache= key;337 private_key_for_cache= key;
@@ -335,16 +339,8 @@
335 table_category= TABLE_CATEGORY_TEMPORARY;339 table_category= TABLE_CATEGORY_TEMPORARY;
336 tmp_table= message::Table::INTERNAL;340 tmp_table= message::Table::INTERNAL;
337341
338 db= str_ref(private_key_for_cache.vector());
339
340 table_name= str_ref(private_key_for_cache.vector() + strlen(private_key_for_cache.vector()) + 1);
341 path= str_ref("");342 path= str_ref("");
342 normalized_path= str_ref("");343 normalized_path= str_ref("");
343
344 std::string tb_name(identifier.getTableName());
345 boost::to_lower(tb_name);
346 assert(strcmp(tb_name.c_str(), table_name.data()) == 0);
347 assert(strcmp(identifier.getSchemaName().c_str(), db.data()) == 0);
348}344}
349345
350TableShare::TableShare(const identifier::Table &identifier) : // Just used during createTable()346TableShare::TableShare(const identifier::Table &identifier) : // Just used during createTable()
@@ -355,6 +351,7 @@
355 mem_root(TABLE_ALLOC_BLOCK_SIZE),351 mem_root(TABLE_ALLOC_BLOCK_SIZE),
356 table_charset(0),352 table_charset(0),
357 all_set(),353 all_set(),
354 table_identifier(NULL),
358 block_size(0),355 block_size(0),
359 version(0),356 version(0),
360 timestamp_offset(0),357 timestamp_offset(0),
@@ -394,6 +391,8 @@
394 keys_in_use(0),391 keys_in_use(0),
395 keys_for_keyread(0)392 keys_for_keyread(0)
396{393{
394 table_identifier= new identifier::Table(identifier);
395
397 private_key_for_cache= identifier.getKey();396 private_key_for_cache= identifier.getKey();
398 assert(identifier.getPath().size()); // Since we are doing a create table, this should be a positive value397 assert(identifier.getPath().size()); // Since we are doing a create table, this should be a positive value
399 private_normalized_path.resize(identifier.getPath().size() + 1);398 private_normalized_path.resize(identifier.getPath().size() + 1);
@@ -402,8 +401,6 @@
402 {401 {
403 table_category= TABLE_CATEGORY_TEMPORARY;402 table_category= TABLE_CATEGORY_TEMPORARY;
404 tmp_table= message::Table::INTERNAL;403 tmp_table= message::Table::INTERNAL;
405 db= str_ref(private_key_for_cache.vector());
406 table_name= str_ref(db.data() + 1);
407 path= private_normalized_path;404 path= private_normalized_path;
408 normalized_path= path;405 normalized_path= path;
409 }406 }
@@ -424,6 +421,7 @@
424 mem_root(TABLE_ALLOC_BLOCK_SIZE),421 mem_root(TABLE_ALLOC_BLOCK_SIZE),
425 table_charset(0),422 table_charset(0),
426 all_set(),423 all_set(),
424 table_identifier(NULL),
427 block_size(0),425 block_size(0),
428 version(0),426 version(0),
429 timestamp_offset(0),427 timestamp_offset(0),
@@ -463,14 +461,9 @@
463 keys_in_use(0),461 keys_in_use(0),
464 keys_for_keyread(0)462 keys_for_keyread(0)
465{463{
464 table_identifier= new identifier::Table(identifier);
466465
467 private_key_for_cache= identifier.getKey();466 private_key_for_cache= identifier.getKey();
468 /*
469 Let us use the fact that the key is "db/0/table_name/0" + optional
470 part for temporary tables.
471 */
472 db= str_ref(private_key_for_cache.vector());
473 table_name= str_ref(db.data() + db.size() + 1);
474467
475 std::string _path;468 std::string _path;
476 if (path_arg)469 if (path_arg)
@@ -479,7 +472,7 @@
479 }472 }
480 else473 else
481 {474 {
482 _path= identifier::Table::build_table_filename(db.data(), table_name.data(), false);475 _path= identifier::Table::build_table_filename(table_identifier->getSchemaName(), table_identifier->getTableName(), false);
483 }476 }
484477
485 char* path_buff= mem_root.strdup(_path);478 char* path_buff= mem_root.strdup(_path);
@@ -493,8 +486,11 @@
493{486{
494 table_category= TABLE_CATEGORY_TEMPORARY;487 table_category= TABLE_CATEGORY_TEMPORARY;
495 tmp_table= message::Table::INTERNAL;488 tmp_table= message::Table::INTERNAL;
496 db= str_ref("");489
497 table_name= str_ref(new_table_name);490 identifier::Table *n= new identifier::Table("", new_table_name, new_path);
491 delete table_identifier;
492 table_identifier= n;
493
498 path= str_ref(new_path);494 path= str_ref(new_path);
499 normalized_path= str_ref(new_path);495 normalized_path= str_ref(new_path);
500}496}
@@ -502,6 +498,7 @@
502TableShare::~TableShare() 498TableShare::~TableShare()
503{499{
504 storage_engine= NULL;500 storage_engine= NULL;
501 delete table_identifier;
505502
506 mem_root.free_root(MYF(0)); // Free's share503 mem_root.free_root(MYF(0)); // Free's share
507}504}
@@ -510,12 +507,8 @@
510{507{
511 private_key_for_cache= identifier_arg.getKey();508 private_key_for_cache= identifier_arg.getKey();
512509
513 /*510 delete table_identifier;
514 Let us use the fact that the key is "db/0/table_name/0" + optional511 table_identifier= new identifier::Table(identifier_arg);
515 part for temporary tables.
516 */
517 db= str_ref(private_key_for_cache.vector());
518 table_name= str_ref(db.data() + db.size() + 1);
519512
520 getTableMessage()->set_name(identifier_arg.getTableName());513 getTableMessage()->set_name(identifier_arg.getTableName());
521 getTableMessage()->set_schema(identifier_arg.getSchemaName());514 getTableMessage()->set_schema(identifier_arg.getSchemaName());
@@ -1708,8 +1701,7 @@
1708 case 1:1701 case 1:
1709 if (db_errno == ENOENT)1702 if (db_errno == ENOENT)
1710 {1703 {
1711 identifier::Table identifier(db.data(), table_name.data());1704 my_error(ER_TABLE_UNKNOWN, *table_identifier);
1712 my_error(ER_TABLE_UNKNOWN, identifier);
1713 }1705 }
1714 else1706 else
1715 {1707 {
@@ -1732,7 +1724,7 @@
1732 snprintf(tmp, sizeof(tmp), "#%d", pass_errarg);1724 snprintf(tmp, sizeof(tmp), "#%d", pass_errarg);
1733 csname= tmp;1725 csname= tmp;
1734 }1726 }
1735 my_printf_error(ER_UNKNOWN_COLLATION, _("Unknown collation '%s' in table '%-.64s' definition"), MYF(0), csname, table_name.data());1727 my_printf_error(ER_UNKNOWN_COLLATION, _("Unknown collation '%s' in table '%-.64s' definition"), MYF(0), csname, table_identifier->getTableName().c_str());
1736 break;1728 break;
1737 }1729 }
1738 case 6:1730 case 6:
17391731
=== modified file 'drizzled/table/instance/base.h'
--- drizzled/table/instance/base.h 2011-10-29 18:07:51 +0000
+++ drizzled/table/instance/base.h 2012-01-05 00:31:36 +0000
@@ -231,8 +231,7 @@
231private:231private:
232 identifier::Table::Key private_key_for_cache; // This will not exist in the final design.232 identifier::Table::Key private_key_for_cache; // This will not exist in the final design.
233 std::vector<char> private_normalized_path; // This will not exist in the final design.233 std::vector<char> private_normalized_path; // This will not exist in the final design.
234 str_ref db; /* Pointer to db */234 drizzled::identifier::Table *table_identifier;
235 str_ref table_name; /* Table name (for open) */
236 str_ref path; /* Path to table (from datadir) */235 str_ref path; /* Path to table (from datadir) */
237 str_ref normalized_path; /* unpack_filename(path) */236 str_ref normalized_path; /* unpack_filename(path) */
238237
@@ -261,22 +260,22 @@
261260
262 str_ref getTableNameRef() const261 str_ref getTableNameRef() const
263 {262 {
264 return table_name;263 return str_ref(table_identifier->getTableName());
265 }264 }
266265
267 const char *getTableName() const266 const char *getTableName() const
268 {267 {
269 return table_name.data();268 return table_identifier->getTableName().c_str();
270 }269 }
271270
272 str_ref getSchemaNameRef() const271 str_ref getSchemaNameRef() const
273 {272 {
274 return db;273 return str_ref(table_identifier->getSchemaName());
275 }274 }
276275
277 const char *getSchemaName() const276 const char *getSchemaName() const
278 {277 {
279 return db.data();278 return table_identifier->getSchemaName().c_str();
280 }279 }
281280
282 uint32_t block_size; /* create information */281 uint32_t block_size; /* create information */
283282
=== modified file 'plugin/innobase/dict/dict0dict.cc'
--- plugin/innobase/dict/dict0dict.cc 2011-02-04 22:30:00 +0000
+++ plugin/innobase/dict/dict0dict.cc 2012-01-05 00:31:36 +0000
@@ -225,6 +225,11 @@
225 const char* s = strchr(name, '/');225 const char* s = strchr(name, '/');
226 ut_a(s);226 ut_a(s);
227227
228 s= strchr(s+1, '/');
229
230 if (s == NULL)
231 s= strchr(name, '/');
232
228 return(s + 1);233 return(s + 1);
229}234}
230235
@@ -239,8 +244,14 @@
239 dbname '/' tablename */244 dbname '/' tablename */
240{245{
241 const char* s;246 const char* s;
242 s = strchr(name, '/');247 const char* catalog;
243 ut_a(s);248 catalog = strchr(name, '/');
249 ut_a(catalog);
250 s= strchr(catalog+1, '/');
251
252 if (s == NULL)
253 s = catalog;
254
244 return(s - name);255 return(s - name);
245}256}
246257
247258
=== modified file 'plugin/innobase/handler/ha_innodb.cc'
--- plugin/innobase/handler/ha_innodb.cc 2011-11-09 20:20:23 +0000
+++ plugin/innobase/handler/ha_innodb.cc 2012-01-05 00:31:36 +0000
@@ -3,6 +3,7 @@
3Copyright (C) 2000, 2010, MySQL AB & Innobase Oy. All Rights Reserved.3Copyright (C) 2000, 2010, MySQL AB & Innobase Oy. All Rights Reserved.
4Copyright (C) 2008, 2009 Google Inc.4Copyright (C) 2008, 2009 Google Inc.
5Copyright (C) 2009, Percona Inc.5Copyright (C) 2009, Percona Inc.
6Copyright (C) 2011, Stewart Smith
67
7Portions of this file contain modifications contributed and copyrighted by8Portions of this file contain modifications contributed and copyrighted by
8Google, Inc. Those modifications are gratefully acknowledged and are described9Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -50,6 +51,7 @@
50#include <drizzled/plugin.h>51#include <drizzled/plugin.h>
51#include <drizzled/show.h>52#include <drizzled/show.h>
52#include <drizzled/data_home.h>53#include <drizzled/data_home.h>
54#include <drizzled/catalog/local.h>
53#include <drizzled/error.h>55#include <drizzled/error.h>
54#include <drizzled/field.h>56#include <drizzled/field.h>
55#include <drizzled/charset.h>57#include <drizzled/charset.h>
@@ -1795,6 +1797,12 @@
1795 const char* bufend = buf + buflen;1797 const char* bufend = buf + buflen;
17961798
1797 if (table_id) {1799 if (table_id) {
1800 const char* catalog_skip= (const char*) memchr(id, '/', idlen);
1801 if (catalog_skip)
1802 {
1803 idlen = idlen - (catalog_skip - id);
1804 id = catalog_skip + 1;
1805 }
1798 const char* slash = (const char*) memchr(id, '/', idlen);1806 const char* slash = (const char*) memchr(id, '/', idlen);
1799 if (!slash) {1807 if (!slash) {
18001808
@@ -3514,6 +3522,15 @@
3514 else3522 else
3515 {3523 {
3516 ib_table = dict_table_get(identifier.getKeyPath().c_str(), TRUE);3524 ib_table = dict_table_get(identifier.getKeyPath().c_str(), TRUE);
3525 if (ib_table == NULL
3526 && drizzled::identifier::Catalog(identifier.getCatalogName())==drizzled::catalog::local_identifier())
3527 {
3528 std::string table_path_no_catalog(identifier.getKeyPath());
3529 table_path_no_catalog.erase(0, drizzled::catalog::local_identifier().getPath().length()+1);
3530 /* We try without local/ as old InnoDB data dictionary (pre CATALOG)
3531 did not have local/ in data dict, just in filesystem path */
3532 ib_table = dict_table_get(table_path_no_catalog.c_str(), TRUE);
3533 }
3517 }3534 }
3518 3535
3519 if (NULL == ib_table) {3536 if (NULL == ib_table) {
@@ -6661,6 +6678,16 @@
6661 session.getSqlCommand()6678 session.getSqlCommand()
6662 == SQLCOM_DROP_DB);6679 == SQLCOM_DROP_DB);
66636680
6681 if (error == ENOENT
6682 && drizzled::identifier::Catalog(identifier.getCatalogName())==drizzled::catalog::local_identifier())
6683 {
6684 std::string table_path_no_catalog(identifier.getKeyPath());
6685 table_path_no_catalog.erase(0, drizzled::catalog::local_identifier().getPath().length()+1);
6686 error = row_drop_table_for_mysql(table_path_no_catalog.c_str(), trx,
6687 session.getSqlCommand()
6688 == SQLCOM_DROP_DB);
6689 }
6690
6664 session.setXaId(trx->id);6691 session.setXaId(trx->id);
66656692
6666 /* Flush the log to reduce probability that the .frm files and6693 /* Flush the log to reduce probability that the .frm files and
@@ -7287,7 +7314,7 @@
72877314
7288 prebuilt->trx->op_info = "returning various info to MySQL";7315 prebuilt->trx->op_info = "returning various info to MySQL";
72897316
7290 fs::path get_status_path(getDataHomeCatalog());7317 fs::path get_status_path(catalog::local_identifier().getPath());
7291 get_status_path /= ib_table->name;7318 get_status_path /= ib_table->name;
7292 fs::change_extension(get_status_path, "dfe");7319 fs::change_extension(get_status_path, "dfe");
72937320
72947321
=== modified file 'plugin/innobase/tests/r/innodb-system-table-view.result'
--- plugin/innobase/tests/r/innodb-system-table-view.result 2011-04-29 18:45:16 +0000
+++ plugin/innobase/tests/r/innodb-system-table-view.result 2012-01-05 00:31:36 +0000
@@ -58,23 +58,23 @@
58ON DELETE CASCADE) ENGINE=INNODB;58ON DELETE CASCADE) ENGINE=INNODB;
59SELECT * FROM DATA_DICTIONARY.INNODB_SYS_FOREIGN;59SELECT * FROM DATA_DICTIONARY.INNODB_SYS_FOREIGN;
60ID FOR_NAME REF_NAME N_COLS TYPE60ID FOR_NAME REF_NAME N_COLS TYPE
61test/constraint_test test/child test/parent 1 161local/test/constraint_test local/test/child local/test/parent 1 1
62SELECT * FROM DATA_DICTIONARY.INNODB_SYS_FOREIGN_COLS;62SELECT * FROM DATA_DICTIONARY.INNODB_SYS_FOREIGN_COLS;
63ID FOR_COL_NAME REF_COL_NAME POS63ID FOR_COL_NAME REF_COL_NAME POS
64test/constraint_test parent_id id 064local/test/constraint_test parent_id id 0
65INSERT INTO parent VALUES(1);65INSERT INTO parent VALUES(1);
66SELECT name, num_rows, handles_opened66SELECT name, num_rows, handles_opened
67FROM DATA_DICTIONARY.INNODB_SYS_TABLESTATS67FROM DATA_DICTIONARY.INNODB_SYS_TABLESTATS
68WHERE name LIKE "%parent";68WHERE name LIKE "%parent";
69name num_rows handles_opened69name num_rows handles_opened
70test/parent 1 170local/test/parent 1 1
71SELECT NAME, FLAG, N_COLS, SPACE FROM DATA_DICTIONARY.INNODB_SYS_TABLES;71SELECT NAME, FLAG, N_COLS, SPACE FROM DATA_DICTIONARY.INNODB_SYS_TABLES;
72NAME FLAG N_COLS SPACE72NAME FLAG N_COLS SPACE
73SYS_FOREIGN 0 7 073SYS_FOREIGN 0 7 0
74SYS_FOREIGN_COLS 0 7 074SYS_FOREIGN_COLS 0 7 0
75SYS_REPLICATION_LOG 0 11 075SYS_REPLICATION_LOG 0 11 0
76test/child 1 5 076local/test/child 1 5 0
77test/parent 1 4 077local/test/parent 1 4 0
78SELECT name, n_fields78SELECT name, n_fields
79from DATA_DICTIONARY.INNODB_SYS_INDEXES79from DATA_DICTIONARY.INNODB_SYS_INDEXES
80WHERE table_id In (SELECT table_id from80WHERE table_id In (SELECT table_id from
@@ -109,11 +109,11 @@
109ON DELETE CASCADE) ENGINE=INNODB;109ON DELETE CASCADE) ENGINE=INNODB;
110SELECT * FROM DATA_DICTIONARY.INNODB_SYS_FOREIGN;110SELECT * FROM DATA_DICTIONARY.INNODB_SYS_FOREIGN;
111ID FOR_NAME REF_NAME N_COLS TYPE111ID FOR_NAME REF_NAME N_COLS TYPE
112test/constraint_test test/child test/parent 2 1112local/test/constraint_test local/test/child local/test/parent 2 1
113SELECT * FROM DATA_DICTIONARY.INNODB_SYS_FOREIGN_COLS;113SELECT * FROM DATA_DICTIONARY.INNODB_SYS_FOREIGN_COLS;
114ID FOR_COL_NAME REF_COL_NAME POS114ID FOR_COL_NAME REF_COL_NAME POS
115test/constraint_test id id 0115local/test/constraint_test id id 0
116test/constraint_test parent_id newid 1116local/test/constraint_test parent_id newid 1
117INSERT INTO parent VALUES(1, 9);117INSERT INTO parent VALUES(1, 9);
118SELECT * FROM parent WHERE id IN (SELECT id FROM parent);118SELECT * FROM parent WHERE id IN (SELECT id FROM parent);
119id newid119id newid
@@ -122,6 +122,6 @@
122FROM DATA_DICTIONARY.INNODB_SYS_TABLESTATS122FROM DATA_DICTIONARY.INNODB_SYS_TABLESTATS
123WHERE name LIKE "%parent";123WHERE name LIKE "%parent";
124name num_rows handles_opened124name num_rows handles_opened
125test/parent 1 2125local/test/parent 1 2
126DROP TABLE child;126DROP TABLE child;
127DROP TABLE parent;127DROP TABLE parent;
128128
=== modified file 'plugin/schema_engine/schema.cc'
--- plugin/schema_engine/schema.cc 2011-10-18 13:52:19 +0000
+++ plugin/schema_engine/schema.cc 2012-01-05 00:31:36 +0000
@@ -26,7 +26,7 @@
26#include <drizzled/sql_table.h>26#include <drizzled/sql_table.h>
27#include <drizzled/charset.h>27#include <drizzled/charset.h>
28#include <drizzled/cursor.h>28#include <drizzled/cursor.h>
29#include <drizzled/data_home.h>29#include <drizzled/catalog/local.h>
3030
31#include <drizzled/pthread_globals.h>31#include <drizzled/pthread_globals.h>
3232
@@ -71,7 +71,9 @@
7171
72void Schema::prime()72void Schema::prime()
73{73{
74 CachedDirectory directory(getDataHomeCatalog().file_string(), CachedDirectory::DIRECTORY);74 CachedDirectory directory(catalog::local_identifier().getPath(),
75 CachedDirectory::DIRECTORY, true);
76
75 CachedDirectory::Entries files= directory.getEntries();77 CachedDirectory::Entries files= directory.getEntries();
76 boost::unique_lock<boost::shared_mutex> scopedLock(mutex);78 boost::unique_lock<boost::shared_mutex> scopedLock(mutex);
7779
@@ -80,7 +82,12 @@
80 if (not entry->filename.compare(GLOBAL_TEMPORARY_EXT))82 if (not entry->filename.compare(GLOBAL_TEMPORARY_EXT))
81 continue;83 continue;
82 message::Schema schema_message;84 message::Schema schema_message;
83 if (readSchemaFile(entry->filename, schema_message))85
86 std::string filename= catalog::local_identifier().getPath();
87 filename+= FN_LIBCHAR;
88 filename+= entry->filename;
89
90 if (readSchemaFile(filename, schema_message))
84 {91 {
85 identifier::Schema schema_identifier(schema_message.name());92 identifier::Schema schema_identifier(schema_message.name());
8693
8794
=== modified file 'plugin/table_cache_dictionary/tests/r/table_cache.result'
--- plugin/table_cache_dictionary/tests/r/table_cache.result 2011-04-28 02:29:52 +0000
+++ plugin/table_cache_dictionary/tests/r/table_cache.result 2012-01-05 00:31:36 +0000
@@ -17,14 +17,14 @@
17flush tables;17flush tables;
18select * FROM data_dictionary.TABLE_CACHE ORDER BY TABLE_SCHEMA, TABLE_NAME;18select * FROM data_dictionary.TABLE_CACHE ORDER BY TABLE_SCHEMA, TABLE_NAME;
19SESSION_ID TABLE_SCHEMA TABLE_NAME VERSION IS_NAME_LOCKED ROWS AVG_ROW_LENGTH TABLE_SIZE AUTO_INCREMENT19SESSION_ID TABLE_SCHEMA TABLE_NAME VERSION IS_NAME_LOCKED ROWS AVG_ROW_LENGTH TABLE_SIZE AUTO_INCREMENT
20# data_dictionary table_cache # # # 2112 # #20# data_dictionary TABLE_CACHE # # # 2112 # #
21create table a ( a int);21create table a ( a int);
22create table b ( b int);22create table b ( b int);
23select * FROM a CROSS JOIN b;23select * FROM a CROSS JOIN b;
24a b24a b
25select * FROM data_dictionary.TABLE_CACHE ORDER BY TABLE_SCHEMA, TABLE_NAME;25select * FROM data_dictionary.TABLE_CACHE ORDER BY TABLE_SCHEMA, TABLE_NAME;
26SESSION_ID TABLE_SCHEMA TABLE_NAME VERSION IS_NAME_LOCKED ROWS AVG_ROW_LENGTH TABLE_SIZE AUTO_INCREMENT26SESSION_ID TABLE_SCHEMA TABLE_NAME VERSION IS_NAME_LOCKED ROWS AVG_ROW_LENGTH TABLE_SIZE AUTO_INCREMENT
27# data_dictionary table_cache # # # 2112 # #27# data_dictionary TABLE_CACHE # # # 2112 # #
28# test a # # # 6 # #28# test a # # # 6 # #
29# test b # # # 6 # #29# test b # # # 6 # #
30DROP TABLES a,b;30DROP TABLES a,b;
3131
=== modified file 'plugin/table_cache_dictionary/tests/r/table_definition_cache.result'
--- plugin/table_cache_dictionary/tests/r/table_definition_cache.result 2011-04-28 02:29:52 +0000
+++ plugin/table_cache_dictionary/tests/r/table_definition_cache.result 2012-01-05 00:31:36 +0000
@@ -13,14 +13,14 @@
13flush tables;13flush tables;
14select * FROM data_dictionary.TABLE_DEFINITION_CACHE ORDER BY TABLE_SCHEMA, TABLE_NAME;14select * FROM data_dictionary.TABLE_DEFINITION_CACHE ORDER BY TABLE_SCHEMA, TABLE_NAME;
15TABLE_SCHEMA TABLE_NAME VERSION TABLE_COUNT IS_NAME_LOCKED15TABLE_SCHEMA TABLE_NAME VERSION TABLE_COUNT IS_NAME_LOCKED
16# table_definition_cache # # #16# TABLE_DEFINITION_CACHE # # #
17create table a ( a int);17create table a ( a int);
18create table b ( b int);18create table b ( b int);
19select * FROM a CROSS JOIN b;19select * FROM a CROSS JOIN b;
20a b20a b
21select * FROM data_dictionary.TABLE_DEFINITION_CACHE ORDER BY TABLE_SCHEMA, TABLE_NAME;21select * FROM data_dictionary.TABLE_DEFINITION_CACHE ORDER BY TABLE_SCHEMA, TABLE_NAME;
22TABLE_SCHEMA TABLE_NAME VERSION TABLE_COUNT IS_NAME_LOCKED22TABLE_SCHEMA TABLE_NAME VERSION TABLE_COUNT IS_NAME_LOCKED
23# table_definition_cache # # #23# TABLE_DEFINITION_CACHE # # #
24# a # # #24# a # # #
25# b # # #25# b # # #
26DROP TABLES a,b;26DROP TABLES a,b;
2727
=== modified file 'plugin/tableprototester/tableprototester.cc'
--- plugin/tableprototester/tableprototester.cc 2011-04-20 22:18:30 +0000
+++ plugin/tableprototester/tableprototester.cc 2012-01-05 00:31:36 +0000
@@ -118,11 +118,11 @@
118118
119bool TableProtoTesterEngine::doDoesTableExist(Session&, const drizzled::identifier::Table &identifier)119bool TableProtoTesterEngine::doDoesTableExist(Session&, const drizzled::identifier::Table &identifier)
120{120{
121 if (not identifier.getPath().compare("test/t1"))121 if (not identifier.getPath().compare("local/test/t1"))
122 return true;122 return true;
123 if (not identifier.getPath().compare("test/too_many_enum_values"))123 if (not identifier.getPath().compare("local/test/too_many_enum_values"))
124 return true;124 return true;
125 if (not identifier.getPath().compare("test/invalid_table_collation"))125 if (not identifier.getPath().compare("local/test/invalid_table_collation"))
126 return true;126 return true;
127127
128 return false;128 return false;
@@ -239,17 +239,17 @@
239 const drizzled::identifier::Table &identifier,239 const drizzled::identifier::Table &identifier,
240 drizzled::message::Table &table_proto)240 drizzled::message::Table &table_proto)
241{241{
242 if (not identifier.getPath().compare("test/t1"))242 if (not identifier.getPath().compare("local/test/t1"))
243 {243 {
244 fill_table1(table_proto);244 fill_table1(table_proto);
245 return EEXIST;245 return EEXIST;
246 }246 }
247 else if (not identifier.getPath().compare("test/too_many_enum_values"))247 else if (not identifier.getPath().compare("local/test/too_many_enum_values"))
248 {248 {
249 fill_table_too_many_enum_values(table_proto);249 fill_table_too_many_enum_values(table_proto);
250 return EEXIST;250 return EEXIST;
251 }251 }
252 else if (not identifier.getPath().compare("test/invalid_table_collation"))252 else if (not identifier.getPath().compare("local/test/invalid_table_collation"))
253 {253 {
254 fill_table_invalid_table_collation(table_proto);254 fill_table_invalid_table_collation(table_proto);
255 return EEXIST;255 return EEXIST;
256256
=== modified file 'plugin/transaction_log/hexdump_transaction_message.cc'
--- plugin/transaction_log/hexdump_transaction_message.cc 2011-08-22 19:14:08 +0000
+++ plugin/transaction_log/hexdump_transaction_message.cc 2012-01-05 00:31:36 +0000
@@ -99,7 +99,7 @@
99 * a pool of TransactionLogReader objects that can be 99 * a pool of TransactionLogReader objects that can be
100 * re-used.100 * re-used.
101 */101 */
102 const string &filename= transaction_log->getLogFilename();102 const string &filename= transaction_log->getLogFilepath();
103 int log_file= open(filename.c_str(), O_RDONLY);103 int log_file= open(filename.c_str(), O_RDONLY);
104 if (log_file == -1)104 if (log_file == -1)
105 {105 {
106106
=== modified file 'plugin/transaction_log/module.cc'
--- plugin/transaction_log/module.cc 2011-06-24 13:24:06 +0000
+++ plugin/transaction_log/module.cc 2012-01-05 00:31:36 +0000
@@ -56,7 +56,7 @@
56 * The name of the main transaction log file on disk. With no prefix,56 * The name of the main transaction log file on disk. With no prefix,
57 * this goes into Drizzle's $datadir.57 * this goes into Drizzle's $datadir.
58 */58 */
59static const char DEFAULT_LOG_FILE_PATH[]= "transaction.log"; /* In datadir... */59static const char DEFAULT_LOG_FILE_PATH[]= "local/transaction.log"; /* In datadir... */
60/** 60/**
61 * Transaction Log plugin system variable - Is the log enabled? Only used on init(). 61 * Transaction Log plugin system variable - Is the log enabled? Only used on init().
62 */62 */
6363
=== modified file 'plugin/transaction_log/print_transaction_message.cc'
--- plugin/transaction_log/print_transaction_message.cc 2011-04-14 21:56:22 +0000
+++ plugin/transaction_log/print_transaction_message.cc 2012-01-05 00:31:36 +0000
@@ -99,7 +99,7 @@
99 * a pool of TransactionLogReader objects that can be 99 * a pool of TransactionLogReader objects that can be
100 * re-used.100 * re-used.
101 */101 */
102 const string &filename= transaction_log->getLogFilename();102 const string &filename= transaction_log->getLogFilepath();
103 int log_file= open(filename.c_str(), O_RDONLY);103 int log_file= open(filename.c_str(), O_RDONLY);
104 if (log_file == -1)104 if (log_file == -1)
105 {105 {
106106
=== modified file 'plugin/transaction_log/tests/r/bug660779.result'
--- plugin/transaction_log/tests/r/bug660779.result 2011-01-11 14:22:54 +0000
+++ plugin/transaction_log/tests/r/bug660779.result 2012-01-05 00:31:36 +0000
@@ -15,8 +15,8 @@
15COMMIT;15COMMIT;
1616
17We should have a Transaction with a single insert Statement17We should have a Transaction with a single insert Statement
18SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));18SELECT PRINT_TRANSACTION_MESSAGE('local/transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
19PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS))19PRINT_TRANSACTION_MESSAGE('local/transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS))
20transaction_context {20transaction_context {
21 server_id: 121 server_id: 1
22 TRANSACTION_ID22 TRANSACTION_ID
@@ -75,8 +75,8 @@
75COMMIT;75COMMIT;
7676
77We should have a Transaction with 1 update and 1 insert Statement77We should have a Transaction with 1 update and 1 insert Statement
78SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));78SELECT PRINT_TRANSACTION_MESSAGE('local/transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
79PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS))79PRINT_TRANSACTION_MESSAGE('local/transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS))
80transaction_context {80transaction_context {
81 server_id: 181 server_id: 1
82 TRANSACTION_ID82 TRANSACTION_ID
@@ -169,8 +169,8 @@
169COMMIT;169COMMIT;
170170
171We should have a Transaction with 1 insert Statement171We should have a Transaction with 1 insert Statement
172SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));172SELECT PRINT_TRANSACTION_MESSAGE('local/transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
173PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS))173PRINT_TRANSACTION_MESSAGE('local/transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS))
174transaction_context {174transaction_context {
175 server_id: 1175 server_id: 1
176 TRANSACTION_ID176 TRANSACTION_ID
177177
=== added file 'plugin/transaction_log/tests/r/bug911643.result'
--- plugin/transaction_log/tests/r/bug911643.result 1970-01-01 00:00:00 +0000
+++ plugin/transaction_log/tests/r/bug911643.result 2012-01-05 00:31:36 +0000
@@ -0,0 +1,71 @@
1CREATE TABLE t1 (
2pk INT NOT NULL AUTO_INCREMENT,
3col_int1 INT,
4col_int2 INT,
5col_int_not_null INT NOT NULL,
6PRIMARY KEY (pk));
7INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (1,1,1);
8INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (NULL,1,1);
9INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (2,1,3);
10SET GLOBAL transaction_log_truncate_debug= true;
11BEGIN;
12UPDATE t1 SET col_int_not_null = col_int1 WHERE col_int2 = 1;
13ERROR 23000: Column 'col_int_not_null' cannot be null
14INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (5,5,5);
15COMMIT;
16
17We should have a Transaction with a single insert Statement
18SELECT PRINT_TRANSACTION_MESSAGE('test/transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
19PRINT_TRANSACTION_MESSAGE('test/transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS))
20transaction_context {
21 server_id: 1
22 TRANSACTION_ID
23 START_TIMESTAMP
24 END_TIMESTAMP
25}
26statement {
27 type: INSERT
28 START_TIMESTAMP
29 END_TIMESTAMP
30 insert_header {
31 table_metadata {
32 schema_name: "test"
33 table_name: "t1"
34 }
35 field_metadata {
36 type: INTEGER
37 name: "pk"
38 }
39 field_metadata {
40 type: INTEGER
41 name: "col_int1"
42 }
43 field_metadata {
44 type: INTEGER
45 name: "col_int2"
46 }
47 field_metadata {
48 type: INTEGER
49 name: "col_int_not_null"
50 }
51 }
52 insert_data {
53 segment_id: 1
54 end_segment: true
55 record {
56 insert_value: "4"
57 insert_value: "5"
58 insert_value: "5"
59 insert_value: "5"
60 is_null: false
61 is_null: false
62 is_null: false
63 is_null: false
64 }
65 }
66}
67segment_id: 1
68end_segment: true
69
70DROP TABLE t1;
71SET GLOBAL transaction_log_truncate_debug= true;
072
=== modified file 'plugin/transaction_log/tests/r/variables.result'
--- plugin/transaction_log/tests/r/variables.result 2010-08-21 19:42:55 +0000
+++ plugin/transaction_log/tests/r/variables.result 2012-01-05 00:31:36 +0000
@@ -3,7 +3,7 @@
3VARIABLE_NAME VARIABLE_VALUE3VARIABLE_NAME VARIABLE_VALUE
4transaction_log_enable ON4transaction_log_enable ON
5transaction_log_enable_checksum OFF5transaction_log_enable_checksum OFF
6transaction_log_file transaction.log6transaction_log_file local/transaction.log
7transaction_log_flush_frequency 17transaction_log_flush_frequency 1
8transaction_log_num_write_buffers 88transaction_log_num_write_buffers 8
9transaction_log_truncate_debug OFF9transaction_log_truncate_debug OFF
1010
=== modified file 'plugin/transaction_log/tests/t/bug660779.test'
--- plugin/transaction_log/tests/t/bug660779.test 2010-10-29 02:01:29 +0000
+++ plugin/transaction_log/tests/t/bug660779.test 2012-01-05 00:31:36 +0000
@@ -22,7 +22,7 @@
22--echo We should have a Transaction with a single insert Statement22--echo We should have a Transaction with a single insert Statement
23--replace_regex /transaction_id: [0-9]+/TRANSACTION_ID/ /start_timestamp: [0-9]+/START_TIMESTAMP/g /end_timestamp: [0-9]+/END_TIMESTAMP/g /creation_timestamp: [0-9]+/CREATE_TIMESTAMP/ /update_timestamp: [0-9]+/UPDATE_TIMESTAMP/23--replace_regex /transaction_id: [0-9]+/TRANSACTION_ID/ /start_timestamp: [0-9]+/START_TIMESTAMP/g /end_timestamp: [0-9]+/END_TIMESTAMP/g /creation_timestamp: [0-9]+/CREATE_TIMESTAMP/ /update_timestamp: [0-9]+/UPDATE_TIMESTAMP/
2424
25SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));25SELECT PRINT_TRANSACTION_MESSAGE('local/transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
2626
27BEGIN;27BEGIN;
28UPDATE t1 SET col_int1 = (col_int1 + 1) WHERE col_int2 = 1;28UPDATE t1 SET col_int1 = (col_int1 + 1) WHERE col_int2 = 1;
@@ -35,7 +35,7 @@
35--echo We should have a Transaction with 1 update and 1 insert Statement35--echo We should have a Transaction with 1 update and 1 insert Statement
36--replace_regex /transaction_id: [0-9]+/TRANSACTION_ID/ /start_timestamp: [0-9]+/START_TIMESTAMP/g /end_timestamp: [0-9]+/END_TIMESTAMP/g /creation_timestamp: [0-9]+/CREATE_TIMESTAMP/ /update_timestamp: [0-9]+/UPDATE_TIMESTAMP/36--replace_regex /transaction_id: [0-9]+/TRANSACTION_ID/ /start_timestamp: [0-9]+/START_TIMESTAMP/g /end_timestamp: [0-9]+/END_TIMESTAMP/g /creation_timestamp: [0-9]+/CREATE_TIMESTAMP/ /update_timestamp: [0-9]+/UPDATE_TIMESTAMP/
3737
38SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));38SELECT PRINT_TRANSACTION_MESSAGE('local/transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
3939
40CREATE TABLE t2 (pk INT NOT NULL AUTO_INCREMENT PRIMARY KEY, a INT);40CREATE TABLE t2 (pk INT NOT NULL AUTO_INCREMENT PRIMARY KEY, a INT);
41INSERT INTO t2 (a) VALUES (1),(2), (NULL);41INSERT INTO t2 (a) VALUES (1),(2), (NULL);
@@ -50,7 +50,7 @@
50--echo We should have a Transaction with 1 insert Statement50--echo We should have a Transaction with 1 insert Statement
51--replace_regex /transaction_id: [0-9]+/TRANSACTION_ID/ /start_timestamp: [0-9]+/START_TIMESTAMP/g /end_timestamp: [0-9]+/END_TIMESTAMP/g /creation_timestamp: [0-9]+/CREATE_TIMESTAMP/ /update_timestamp: [0-9]+/UPDATE_TIMESTAMP/51--replace_regex /transaction_id: [0-9]+/TRANSACTION_ID/ /start_timestamp: [0-9]+/START_TIMESTAMP/g /end_timestamp: [0-9]+/END_TIMESTAMP/g /creation_timestamp: [0-9]+/CREATE_TIMESTAMP/ /update_timestamp: [0-9]+/UPDATE_TIMESTAMP/
5252
53SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));53SELECT PRINT_TRANSACTION_MESSAGE('local/transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
5454
5555
56DROP TABLE t1;56DROP TABLE t1;
5757
=== added file 'plugin/transaction_log/tests/t/bug911643-master.opt'
--- plugin/transaction_log/tests/t/bug911643-master.opt 1970-01-01 00:00:00 +0000
+++ plugin/transaction_log/tests/t/bug911643-master.opt 2012-01-05 00:31:36 +0000
@@ -0,0 +1,1 @@
1--transaction-log.enable --scheduler=multi_thread --transaction-message-threshold=131072 --allow-all-authentication.allow_anonymous=true --transaction-log.file=local/test/transaction.log
02
=== added file 'plugin/transaction_log/tests/t/bug911643.test'
--- plugin/transaction_log/tests/t/bug911643.test 1970-01-01 00:00:00 +0000
+++ plugin/transaction_log/tests/t/bug911643.test 2012-01-05 00:31:36 +0000
@@ -0,0 +1,28 @@
1CREATE TABLE t1 (
2 pk INT NOT NULL AUTO_INCREMENT,
3 col_int1 INT,
4 col_int2 INT,
5 col_int_not_null INT NOT NULL,
6 PRIMARY KEY (pk));
7
8INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (1,1,1);
9INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (NULL,1,1);
10INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (2,1,3);
11
12SET GLOBAL transaction_log_truncate_debug= true;
13
14--test with no previous Statement message
15BEGIN;
16--ERROR ER_BAD_NULL_ERROR
17UPDATE t1 SET col_int_not_null = col_int1 WHERE col_int2 = 1;
18INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (5,5,5);
19COMMIT;
20
21--echo
22--echo We should have a Transaction with a single insert Statement
23--replace_regex /transaction_id: [0-9]+/TRANSACTION_ID/ /start_timestamp: [0-9]+/START_TIMESTAMP/g /end_timestamp: [0-9]+/END_TIMESTAMP/g /creation_timestamp: [0-9]+/CREATE_TIMESTAMP/ /update_timestamp: [0-9]+/UPDATE_TIMESTAMP/
24
25SELECT PRINT_TRANSACTION_MESSAGE('test/transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
26
27DROP TABLE t1;
28SET GLOBAL transaction_log_truncate_debug= true;
029
=== modified file 'tests/r/broken_table_proto_file.result'
--- tests/r/broken_table_proto_file.result 2011-01-12 22:54:12 +0000
+++ tests/r/broken_table_proto_file.result 2012-01-05 00:31:36 +0000
@@ -2,6 +2,6 @@
2SHOW TABLE STATUS like 't1';2SHOW TABLE STATUS like 't1';
3Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment3Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
4show create table t1;4show create table t1;
5ERROR HY000: Corrupt or invalid table definition for 'test/t1.dfe': name, schema, type, engine, creation_timestamp, update_timestamp5ERROR HY000: Corrupt or invalid table definition for 'local/test/t1.dfe': name, schema, type, engine, creation_timestamp, update_timestamp
6drop table if exists t1;6drop table if exists t1;
7Got one of the listed errors7Got one of the listed errors
88
=== modified file 'tests/r/show_check.result'
--- tests/r/show_check.result 2011-07-15 08:26:31 +0000
+++ tests/r/show_check.result 2012-01-05 00:31:36 +0000
@@ -26,11 +26,11 @@
26test.t1 check status OK26test.t1 check status OK
27show index from t1;27show index from t1;
28Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr28Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
29def data_dictionary show_indexes SHOW_INDEXES Table Table 8 1024 2 N 4097 0 4529def data_dictionary SHOW_INDEXES SHOW_INDEXES Table Table 8 1024 2 N 4097 0 45
30def data_dictionary show_indexes SHOW_INDEXES Unique Unique 13 1 1 N 36897 0 6330def data_dictionary SHOW_INDEXES SHOW_INDEXES Unique Unique 13 1 1 N 36897 0 63
31def data_dictionary show_indexes SHOW_INDEXES Key_name Key_name 8 1024 7 N 4097 0 4531def data_dictionary SHOW_INDEXES SHOW_INDEXES Key_name Key_name 8 1024 7 N 4097 0 45
32def data_dictionary show_indexes SHOW_INDEXES Seq_in_index Seq_in_index 5 21 1 N 36865 0 6332def data_dictionary SHOW_INDEXES SHOW_INDEXES Seq_in_index Seq_in_index 5 21 1 N 36865 0 63
33def data_dictionary show_indexes SHOW_INDEXES Column_name Column_name 8 1024 1 N 4097 0 4533def data_dictionary SHOW_INDEXES SHOW_INDEXES Column_name Column_name 8 1024 1 N 4097 0 45
34Table Unique Key_name Seq_in_index Column_name34Table Unique Key_name Seq_in_index Column_name
35t1 YES PRIMARY 1 a35t1 YES PRIMARY 1 a
36t1 NO b 1 b36t1 NO b 1 b
@@ -48,37 +48,37 @@
48-- after Bug#29394 is implemented.48-- after Bug#29394 is implemented.
49show variables like "server_id%";49show variables like "server_id%";
50Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr50Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
51def data_dictionary session_variables SESSION_VARIABLES VARIABLE_NAME Variable_name 8 1024 9 N 4097 0 4551def data_dictionary SESSION_VARIABLES SESSION_VARIABLES VARIABLE_NAME Variable_name 8 1024 9 N 4097 0 45
52def data_dictionary session_variables SESSION_VARIABLES VARIABLE_VALUE Value 8 4096 1 N 4097 0 4552def data_dictionary SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 8 4096 1 N 4097 0 45
53Variable_name Value53Variable_name Value
54server_id 154server_id 1
55show variables like "SERVER_id%";55show variables like "SERVER_id%";
56Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr56Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
57def data_dictionary session_variables SESSION_VARIABLES VARIABLE_NAME Variable_name 8 1024 9 N 4097 0 4557def data_dictionary SESSION_VARIABLES SESSION_VARIABLES VARIABLE_NAME Variable_name 8 1024 9 N 4097 0 45
58def data_dictionary session_variables SESSION_VARIABLES VARIABLE_VALUE Value 8 4096 1 N 4097 0 4558def data_dictionary SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 8 4096 1 N 4097 0 45
59Variable_name Value59Variable_name Value
60server_id 160server_id 1
61show variables like "this_doesn't_exists%";61show variables like "this_doesn't_exists%";
62Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr62Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
63def data_dictionary session_variables SESSION_VARIABLES VARIABLE_NAME Variable_name 8 1024 0 N 4097 0 4563def data_dictionary SESSION_VARIABLES SESSION_VARIABLES VARIABLE_NAME Variable_name 8 1024 0 N 4097 0 45
64def data_dictionary session_variables SESSION_VARIABLES VARIABLE_VALUE Value 8 4096 0 N 4097 0 4564def data_dictionary SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 8 4096 0 N 4097 0 45
65Variable_name Value65Variable_name Value
66show table status from test like "this_doesn't_exists%";66show table status from test like "this_doesn't_exists%";
67Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr67Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
68def data_dictionary show_table_status SHOW_TABLE_STATUS Session Session 5 21 0 N 36865 0 6368def data_dictionary SHOW_TABLE_STATUS SHOW_TABLE_STATUS Session Session 5 21 0 N 36865 0 63
69def data_dictionary show_table_status SHOW_TABLE_STATUS Schema Schema 8 1024 0 N 4097 0 4569def data_dictionary SHOW_TABLE_STATUS SHOW_TABLE_STATUS Schema Schema 8 1024 0 N 4097 0 45
70def data_dictionary show_table_status SHOW_TABLE_STATUS Name Name 8 1024 0 N 4097 0 4570def data_dictionary SHOW_TABLE_STATUS SHOW_TABLE_STATUS Name Name 8 1024 0 N 4097 0 45
71def data_dictionary show_table_status SHOW_TABLE_STATUS Type Type 8 1024 0 N 4097 0 4571def data_dictionary SHOW_TABLE_STATUS SHOW_TABLE_STATUS Type Type 8 1024 0 N 4097 0 45
72def data_dictionary show_table_status SHOW_TABLE_STATUS Engine Engine 8 1024 0 N 4097 0 4572def data_dictionary SHOW_TABLE_STATUS SHOW_TABLE_STATUS Engine Engine 8 1024 0 N 4097 0 45
73def data_dictionary show_table_status SHOW_TABLE_STATUS Version Version 8 1024 0 N 4097 0 4573def data_dictionary SHOW_TABLE_STATUS SHOW_TABLE_STATUS Version Version 8 1024 0 N 4097 0 45
74def data_dictionary show_table_status SHOW_TABLE_STATUS Rows Rows 8 1024 0 N 4097 0 4574def data_dictionary SHOW_TABLE_STATUS SHOW_TABLE_STATUS Rows Rows 8 1024 0 N 4097 0 45
75def data_dictionary show_table_status SHOW_TABLE_STATUS Avg_row_length Avg_row_length 8 1024 0 N 4097 0 4575def data_dictionary SHOW_TABLE_STATUS SHOW_TABLE_STATUS Avg_row_length Avg_row_length 8 1024 0 N 4097 0 45
76def data_dictionary show_table_status SHOW_TABLE_STATUS Table_size Table_size 8 1024 0 N 4097 0 4576def data_dictionary SHOW_TABLE_STATUS SHOW_TABLE_STATUS Table_size Table_size 8 1024 0 N 4097 0 45
77def data_dictionary show_table_status SHOW_TABLE_STATUS Auto_increment Auto_increment 8 1024 0 N 4097 0 4577def data_dictionary SHOW_TABLE_STATUS SHOW_TABLE_STATUS Auto_increment Auto_increment 8 1024 0 N 4097 0 45
78Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment78Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
79show databases;79show databases;
80Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr80Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
81def data_dictionary show_schemas SHOW_SCHEMAS SCHEMA_NAME Database 8 1024 18 N 4097 0 4581def data_dictionary SHOW_SCHEMAS SHOW_SCHEMAS SCHEMA_NAME Database 8 1024 18 N 4097 0 45
82Database82Database
83DATA_DICTIONARY83DATA_DICTIONARY
84INFORMATION_SCHEMA84INFORMATION_SCHEMA
@@ -86,7 +86,7 @@
86test86test
87show databases like "test%";87show databases like "test%";
88Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr88Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
89def data_dictionary show_schemas SHOW_SCHEMAS SCHEMA_NAME Database (test%) 8 1024 4 N 4097 0 4589def data_dictionary SHOW_SCHEMAS SHOW_SCHEMAS SCHEMA_NAME Database (test%) 8 1024 4 N 4097 0 45
90Database (test%)90Database (test%)
91test91test
92create table t1 (f1 int not null, f2 int not null, f3 int not null, f4 int not null, primary key(f1,f2,f3,f4));92create table t1 (f1 int not null, f2 int not null, f3 int not null, f4 int not null, primary key(f1,f2,f3,f4));
@@ -446,11 +446,11 @@
446);446);
447show index from t1;447show index from t1;
448Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr448Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
449def data_dictionary show_indexes SHOW_INDEXES Table Table 8 1024 2 N 4097 0 45449def data_dictionary SHOW_INDEXES SHOW_INDEXES Table Table 8 1024 2 N 4097 0 45
450def data_dictionary show_indexes SHOW_INDEXES Unique Unique 13 1 1 N 36897 0 63450def data_dictionary SHOW_INDEXES SHOW_INDEXES Unique Unique 13 1 1 N 36897 0 63
451def data_dictionary show_indexes SHOW_INDEXES Key_name Key_name 8 1024 7 N 4097 0 45451def data_dictionary SHOW_INDEXES SHOW_INDEXES Key_name Key_name 8 1024 7 N 4097 0 45
452def data_dictionary show_indexes SHOW_INDEXES Seq_in_index Seq_in_index 5 21 1 N 36865 0 63452def data_dictionary SHOW_INDEXES SHOW_INDEXES Seq_in_index Seq_in_index 5 21 1 N 36865 0 63
453def data_dictionary show_indexes SHOW_INDEXES Column_name Column_name 8 1024 6 N 4097 0 45453def data_dictionary SHOW_INDEXES SHOW_INDEXES Column_name Column_name 8 1024 6 N 4097 0 45
454Table Unique Key_name Seq_in_index Column_name454Table Unique Key_name Seq_in_index Column_name
455t1 YES PRIMARY 1 field1455t1 YES PRIMARY 1 field1
456drop table t1;456drop table t1;
457457
=== modified file 'unittests/table_identifier.cc'
--- unittests/table_identifier.cc 2011-07-07 11:47:49 +0000
+++ unittests/table_identifier.cc 2012-01-05 00:31:36 +0000
@@ -63,14 +63,21 @@
6363
64 const identifier::Table::Key key= identifier.getKey();64 const identifier::Table::Key key= identifier.getKey();
6565
66 BOOST_REQUIRE_EQUAL(key.size(), 7);66 BOOST_REQUIRE_EQUAL(key.size(), 13);
67 BOOST_REQUIRE_EQUAL(key.vector()[0], 't');67 int i=0;
68 BOOST_REQUIRE_EQUAL(key.vector()[1], 'e');68 BOOST_REQUIRE_EQUAL(key.vector()[i++], 'L');
69 BOOST_REQUIRE_EQUAL(key.vector()[2], 's');69 BOOST_REQUIRE_EQUAL(key.vector()[i++], 'O');
70 BOOST_REQUIRE_EQUAL(key.vector()[3], 't');70 BOOST_REQUIRE_EQUAL(key.vector()[i++], 'C');
71 BOOST_REQUIRE_EQUAL(key.vector()[4], 0);71 BOOST_REQUIRE_EQUAL(key.vector()[i++], 'A');
72 BOOST_REQUIRE_EQUAL(key.vector()[5], 'a');72 BOOST_REQUIRE_EQUAL(key.vector()[i++], 'L');
73 BOOST_REQUIRE_EQUAL(key.vector()[6], 0);73 BOOST_REQUIRE_EQUAL(key.vector()[i++], 0);
74 BOOST_REQUIRE_EQUAL(key.vector()[i++], 't');
75 BOOST_REQUIRE_EQUAL(key.vector()[i++], 'e');
76 BOOST_REQUIRE_EQUAL(key.vector()[i++], 's');
77 BOOST_REQUIRE_EQUAL(key.vector()[i++], 't');
78 BOOST_REQUIRE_EQUAL(key.vector()[i++], 0);
79 BOOST_REQUIRE_EQUAL(key.vector()[i++], 'a');
80 BOOST_REQUIRE_EQUAL(key.vector()[i++], 0);
74}81}
7582
76BOOST_AUTO_TEST_CASE(KeyCompare)83BOOST_AUTO_TEST_CASE(KeyCompare)