~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Lee Bieber
  • Date: 2010-11-07 19:34:48 UTC
  • mfrom: (1910.1.2 build)
  • Revision ID: kalebral@gmail.com-20101107193448-64kdu912qej354sh
Merge Stewart - including adapting and expanding the "differences from mysql" page from the wiki.
Merge Stewart - fix bug 668143: drizzleslap with --commit runs second iteration data load in a transaction

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2005 PrimeBase Technologies GmbH
 
1
/* Copyright (c) 2005 PrimeBase Technologies GmbH
2
2
 *
3
3
 * PrimeBase XT
4
4
 *
663
663
                        memcpy(&data, ((char *) from)+packlength, sizeof(char*));
664
664
                        
665
665
                        //*len = ((Field_blob *) field)->get_length((byte *) from);
666
 
                        *len = ((Field_blob *) field)->get_length((byte *) from, GET_TABLE_SHARE(table)->db_low_byte_first);
 
666
                        *len = ((Field_blob *) field)->get_length((byte *) from, packlength, GET_TABLE_SHARE(table)->db_low_byte_first);
667
667
                        return data;
668
668
                }
669
669
#ifndef DRIZZLED
724
724
                case DRIZZLE_TYPE_TIMESTAMP:
725
725
                case DRIZZLE_TYPE_LONGLONG:
726
726
                case DRIZZLE_TYPE_DATETIME:
727
 
                case DRIZZLE_TYPE_TIME:
728
727
                case DRIZZLE_TYPE_DATE:
729
728
                case DRIZZLE_TYPE_DECIMAL:
730
729
                case DRIZZLE_TYPE_ENUM:
731
 
                case DRIZZLE_TYPE_UUID:
732
730
#endif
733
731
                        break;
734
732
        }
774
772
                        */
775
773
                        xtWord4 packlength = ((Field_blob *) field)->pack_length_no_ptr();
776
774
 
777
 
                        ((Field_blob *) field)->store_length((byte *) from, len, GET_TABLE_SHARE(table)->db_low_byte_first);
 
775
                        ((Field_blob *) field)->store_length((byte *) from, packlength, len, GET_TABLE_SHARE(table)->db_low_byte_first);
778
776
                        memcpy_fixed(((char *) from)+packlength, &data, sizeof(char*));
779
777
 
780
778
                        if (data)
839
837
                case DRIZZLE_TYPE_TIMESTAMP:
840
838
                case DRIZZLE_TYPE_LONGLONG:
841
839
                case DRIZZLE_TYPE_DATETIME:
842
 
                case DRIZZLE_TYPE_TIME:
843
840
                case DRIZZLE_TYPE_DATE:
844
841
                case DRIZZLE_TYPE_DECIMAL:
845
842
                case DRIZZLE_TYPE_ENUM:
846
 
                case DRIZZLE_TYPE_UUID:
847
843
#endif
848
844
                        break;
849
845
        }
1845
1841
                xt_lock_mutex(self, &tab->tab_dic_field_lock);
1846
1842
                pushr_(xt_unlock_mutex, &tab->tab_dic_field_lock);
1847
1843
                field->ptr = (byte *) buffer + field->offset(table->getDefaultValues());
1848
 
                field->val_str_internal(&val);
 
1844
                field->val_str(&val);
1849
1845
                field->ptr = save;                                      // Restore org row pointer
1850
1846
                freer_(); // xt_unlock_mutex(&tab->tab_dic_field_lock)
1851
1847
                xt_strcpy(len, value, val.c_ptr());
2202
2198
                        }
2203
2199
                }
2204
2200
 
2205
 
                seg->col_idx = field->position();
 
2201
                seg->col_idx = field->field_index;
2206
2202
                seg->is_recs_in_range = 1;
2207
2203
                seg->is_selectivity = 1;
2208
2204
                seg->type = (int) type;
2316
2312
                /* NOTE: do not set if the field is only partially in the index!!! */
2317
2313
                if (!partial_field)
2318
2314
#ifdef DRIZZLED
2319
 
                        MX_BIT_FAST_TEST_AND_SET(&mi_col_map, field->position());
 
2315
                        MX_BIT_FAST_TEST_AND_SET(&mi_col_map, field->field_index);
2320
2316
#else
2321
 
                        MX_BIT_FAST_TEST_AND_SET(&ind->mi_col_map, field->position());
 
2317
                        MX_BIT_FAST_TEST_AND_SET(&ind->mi_col_map, field->field_index);
2322
2318
#endif
2323
2319
        }
2324
2320
 
2442
2438
                for (key_part = index->key_part; key_part != key_part_end; key_part++) {
2443
2439
                        curr_field = key_part->field;
2444
2440
 
2445
 
                        if ((u_int) curr_field->position()+1 > dic->dic_ind_cols_req)
2446
 
                                dic->dic_ind_cols_req = curr_field->position()+1;
 
2441
                        if ((u_int) curr_field->field_index+1 > dic->dic_ind_cols_req)
 
2442
                                dic->dic_ind_cols_req = curr_field->field_index+1;
2447
2443
                }
2448
2444
        }
2449
2445
 
2480
2476
                                else
2481
2477
                                        max_ave_row_size = 200;
2482
2478
                                large_blob_field_count++;
2483
 
                                if ((u_int) curr_field->position()+1 > dic->dic_blob_cols_req)
2484
 
                                        dic->dic_blob_cols_req = curr_field->position()+1;
 
2479
                                if ((u_int) curr_field->field_index+1 > dic->dic_blob_cols_req)
 
2480
                                        dic->dic_blob_cols_req = curr_field->field_index+1;
2485
2481
                                dic->dic_blob_count++;
2486
2482
                                xt_realloc(self, (void **) &dic->dic_blob_cols, sizeof(Field *) * dic->dic_blob_count);
2487
2483
                                dic->dic_blob_cols[dic->dic_blob_count-1] = curr_field;
3178
3174
{
3179
3175
        Session *session = (Session *) s;
3180
3176
 
 
3177
        session->lockForDelete();
3181
3178
        delete session;
3182
3179
 
3183
3180
        if (end_threads)
3184
 
          drizzled::internal::my_thread_end();
 
3181
                drizzled::internal::my_thread_end();
3185
3182
}
3186
3183
#else
3187
3184
xtPublic void myxt_destroy_thread(void *thread, xtBool end_threads)