~drizzle-trunk/drizzle/jenkins-Drizzle-Builder-187

« back to all changes in this revision

Viewing changes to unittests/table_identifier.cc

  • Committer: Stewart Smith
  • Date: 2012-07-11 14:06:00 UTC
  • mto: This revision was merged to the branch mainline in revision 2574.
  • Revision ID: stewart@flamingspork.com-20120711140600-oxrs1cjabjuqpd05
force a identifier::Schema to be constructed with a identifier::Catalog. This is close to the final 'big' part for CATALOG support. We also have to modify all around the server that creates identifier::Schema so it does so properly. Since a single Session cannot span schemas, we get off a wee bit easy :) The big limitation in this patch is that INFORMATION_SCHEMA and DATA_DICTIONARY only appear in the LOCAL catalog (and this really needs to be fixed before CATALOGs other than LOCAL are supported).

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
BOOST_AUTO_TEST_SUITE(TableIdentifierTest)
31
31
BOOST_AUTO_TEST_CASE(CreateStandard)
32
32
{
33
 
  identifier::Table identifier("test", "a");
 
33
  identifier::Table identifier(identifier::Catalog(str_ref("local")), "test", "a");
34
34
  BOOST_REQUIRE_EQUAL("local/test/a", identifier.getPath());
35
35
  BOOST_REQUIRE_EQUAL("test.a", identifier.getSQLPath());
36
36
}
37
37
 
38
38
BOOST_AUTO_TEST_CASE(CreateTemporary)
39
39
{
40
 
  identifier::Table identifier("test", "a", message::Table::TEMPORARY);
 
40
  identifier::Table identifier(identifier::Catalog(str_ref("local")),"test", "a", message::Table::TEMPORARY);
41
41
  BOOST_REQUIRE_EQUAL("/#sql", identifier.getPath().substr(0, 5));
42
42
  BOOST_REQUIRE_EQUAL("test.#a", identifier.getSQLPath());
43
43
}
44
44
 
45
45
BOOST_AUTO_TEST_CASE(CreateInternal)
46
46
{
47
 
  identifier::Table identifier("test", "a", message::Table::TEMPORARY);
 
47
  identifier::Table identifier(identifier::Catalog(str_ref("local")),"test", "a", message::Table::TEMPORARY);
48
48
  BOOST_REQUIRE_EQUAL("/#sql", identifier.getPath().substr(0, 5));
49
49
  BOOST_REQUIRE_EQUAL("test.#a", identifier.getSQLPath());
50
50
}
59
59
 
60
60
BOOST_AUTO_TEST_CASE(Key)
61
61
{
62
 
  identifier::Table identifier("test", "a");
 
62
  identifier::Table identifier(identifier::Catalog(str_ref("LOCAL")),"test", "a");
63
63
 
64
64
  const identifier::Table::Key key= identifier.getKey();
65
65
 
82
82
 
83
83
BOOST_AUTO_TEST_CASE(KeyCompare)
84
84
{
85
 
  identifier::Table identifier("test", "a");
86
 
  identifier::Table identifier2("test", "a");
 
85
  identifier::Table identifier(identifier::Catalog(str_ref("local")), "test", "a");
 
86
  identifier::Table identifier2(identifier::Catalog(str_ref("local")), "test", "a");
87
87
 
88
88
  BOOST_REQUIRE_EQUAL((identifier.getKey() == identifier.getKey()), true);
89
89
}