~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/handler/ha_innodb.cc

More casting.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
 
72
72
#include <boost/algorithm/string.hpp>
73
73
#include <boost/program_options.hpp>
 
74
#include <boost/scoped_array.hpp>
74
75
#include <boost/filesystem.hpp>
75
76
#include <drizzled/module/option_map.h>
76
77
#include <iostream>
1670
1671
        FALSE=id is an UTF-8 string */
1671
1672
{
1672
1673
  char nz[NAME_LEN + 1];
1673
 
  char nz2[NAME_LEN + 1 + sizeof srv_mysql50_table_name_prefix];
 
1674
  const size_t nz2_size= NAME_LEN + 1 + srv_mysql50_table_name_prefix.size();
 
1675
  boost::scoped_array<char> nz2(new char[nz2_size]);
1674
1676
 
1675
1677
  const char* s = id;
1676
1678
  int   q;
1687
1689
    memcpy(nz, id, idlen);
1688
1690
    nz[idlen] = 0;
1689
1691
 
1690
 
    s = nz2;
1691
 
    idlen = TableIdentifier::filename_to_tablename(nz, nz2, sizeof nz2);
 
1692
    s = nz2.get();
 
1693
    idlen = TableIdentifier::filename_to_tablename(nz, nz2.get(), nz2_size);
1692
1694
  }
1693
1695
 
1694
1696
  /* See if the identifier needs to be quoted. */
2101
2103
 
2102
2104
#ifdef UNIV_DEBUG
2103
2105
  static const char test_filename[] = "-@";
2104
 
  char      test_tablename[sizeof test_filename
2105
 
    + sizeof srv_mysql50_table_name_prefix];
2106
 
  if ((sizeof test_tablename) - 1
2107
 
      != filename_to_tablename(test_filename, test_tablename,
2108
 
                               sizeof test_tablename)
2109
 
      || strncmp(test_tablename,
2110
 
                 srv_mysql50_table_name_prefix,
2111
 
                 sizeof srv_mysql50_table_name_prefix)
2112
 
      || strcmp(test_tablename
2113
 
                + sizeof srv_mysql50_table_name_prefix,
 
2106
  const size_t test_tablename_size= sizeof test_filename
 
2107
    + srv_mysql50_table_name_prefix.size();
 
2108
  boost::scoped_array test_tablename(new char[test_tablename_size]);
 
2109
  if ((test_tablename_size) - 1
 
2110
      != filename_to_tablename(test_filename, test_tablename.get(),
 
2111
                               test_tablename_size)
 
2112
      || strncmp(test_tablename.get(),
 
2113
                 srv_mysql50_table_name_prefix.c_str(),
 
2114
                 srv_mysql50_table_name_prefix.size())
 
2115
      || strcmp(test_tablename.get()
 
2116
                + srv_mysql50_table_name_prefix.size(),
2114
2117
                test_filename)) {
2115
2118
    errmsg_printf(ERRMSG_LVL_ERROR, "tablename encoding has been changed");
2116
2119
    goto error;