~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbxt/src/myxt_xt.cc

  • Committer: Brian Aker
  • Date: 2010-05-03 20:01:36 UTC
  • mfrom: (1516.1.2 staging)
  • Revision ID: brian@gaz-20100503200136-8cbqn0m5hztqb9h8
Merge Paul's latest PBXT (includes version 1.1)

Show diffs side-by-side

added added

removed removed

Lines of Context:
312
312
               memset((byte*) key, 0,(size_t) (ind->mi_key_size) );
313
313
#endif
314
314
 
 
315
#ifdef HAVE_valgrind
 
316
       if (ind->mi_fix_key)
 
317
               memset((byte*) key, 0,(size_t) (ind->mi_key_size) );
 
318
#endif
 
319
 
315
320
        start = key;
316
321
        for (u_int i=0; i<ind->mi_seg_count; i++, keyseg++)
317
322
        {
2005
2010
{
2006
2011
        THD                     *thd = current_thd;
2007
2012
        char            path_buffer[PATH_MAX];
2008
 
        char            *table_file_name;
2009
 
#ifdef DRIZZLED
2010
 
        char            tab_name[XT_IDENTIFIER_NAME_SIZE];
2011
 
#endif
 
2013
        char            *table_name;
2012
2014
        char            database_name[XT_IDENTIFIER_NAME_SIZE];
2013
 
        char            *ptr;
2014
2015
        size_t          size;
2015
2016
        char            *buffer, *path, *db_name, *name;
2016
2017
        TABLE_SHARE     *share;
2032
2033
         * have .frm files!!
2033
2034
         */
2034
2035
        xt_strcpy(PATH_MAX, path_buffer, tab_path->ps_path);
2035
 
        table_file_name = xt_last_name_of_path(path_buffer);
 
2036
        table_name = xt_last_name_of_path(path_buffer);
 
2037
#ifndef DRIZZLED
 
2038
        char *ptr;
2036
2039
 
2037
 
        if ((ptr = strstr(tab_name, "#P#")))
 
2040
        if ((ptr = strstr(table_name, "#P#")))
2038
2041
                *ptr = 0;
 
2042
#endif
2039
2043
 
2040
2044
        xt_2nd_last_name_of_path(XT_IDENTIFIER_NAME_SIZE, database_name, path_buffer);
2041
2045
 
2042
2046
        size = sizeof(TABLE) + sizeof(TABLE_SHARE) + 
2043
2047
                strlen(path_buffer) + 1 +
2044
 
                strlen(database_name) + 1 + strlen(table_file_name) + 1;
 
2048
                strlen(database_name) + 1 + strlen(table_name) + 1;
2045
2049
        if (!(buffer = (char *) xt_malloc(self, size)))
2046
2050
                return NULL;
2047
2051
        table = (TABLE *) buffer;
2056
2060
        strcpy(db_name, database_name);
2057
2061
        buffer += strlen(database_name) + 1;
2058
2062
        name = buffer;
2059
 
        strcpy(name, table_file_name);
 
2063
        strcpy(name, table_name);
2060
2064
 
2061
2065
        /* Required to call 'open_table_from_share'! */
2062
2066
        LEX *old_lex, new_lex;
2067
2071
        lex_start(thd);
2068
2072
 
2069
2073
#ifdef DRIZZLED
 
2074
        char            tab_name[XT_IDENTIFIER_NAME_SIZE];
 
2075
 
2070
2076
        uint32_t tab_name_len = filename_to_tablename(name, tab_name, XT_IDENTIFIER_NAME_SIZE); 
2071
2077
        
2072
2078
        TableIdentifier *ident = NULL;
2073
2079
        if (table_type == XT_TABLE_TYPE_TEMPORARY) {
2074
2080
                std::string tmp_path(drizzle_tmpdir);
2075
2081
                tmp_path.append("/");
2076
 
                tmp_path.append(table_file_name);
 
2082
                tmp_path.append(table_name);
2077
2083
                ident = new TableIdentifier(db_name, tab_name, tmp_path);
2078
2084
        } else if (table_type == XT_TABLE_TYPE_STANDARD) {
2079
2085
                ident = new TableIdentifier(
2086
2092
                n.append("/");
2087
2093
                n.append(db_name);
2088
2094
                n.append("/");
2089
 
                n.append(table_file_name);
 
2095
                n.append(table_name);
2090
2096
                //ident = new TableIdentifier(
2091
2097
                //      std::string(db_name), 
2092
2098
                //      std::string(tab_name, tab_name_len), 
2720
2726
                }
2721
2727
        }
2722
2728
 
 
2729
        /* Ensure that handle data record size is big enough to
 
2730
         * include the extended record reference, in the case of
 
2731
         * variable length rows
 
2732
         */
 
2733
        if (!dic_rec_fixed) {
 
2734
                if (dic_rec_size < offsetof(XTTabRecExtDRec, re_data))
 
2735
                        dic_rec_size = offsetof(XTTabRecExtDRec, re_data);
 
2736
        }
 
2737
#ifdef DEBUG
 
2738
        else {
 
2739
                ASSERT_NS(dic_rec_size > offsetof(XTTabRecFix, rf_data));
 
2740
        }
 
2741
#endif
 
2742
 
2723
2743
        if (!dic->dic_rec_size) {
2724
2744
                dic->dic_rec_size = dic_rec_size;
2725
2745
                dic->dic_rec_fixed = dic_rec_fixed;
3309
3329
 *
3310
3330
 */
3311
3331
 
3312
 
#ifdef DRI_IS
 
3332
#ifndef DRIZZLED
3313
3333
static int mx_put_record(THD *thd, TABLE *table)
3314
3334
{
3315
3335
        return schema_table_store_record(thd, table);
3369
3389
 
3370
3390
        return err;
3371
3391
}
3372
 
#endif // DRI_IS
 
3392
#endif // !DRIZZLED
3373
3393
 
3374
3394
xtPublic void myxt_get_status(XTThreadPtr self, XTStringBufferPtr strbuf)
3375
3395
{