~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Patrick Galbraith
  • Date: 2008-07-28 01:47:41 UTC
  • mto: (212.1.8 codestyle)
  • mto: This revision was merged to the branch mainline in revision 217.
  • Revision ID: patg@ishvara-20080728014741-yoasv5trt1ef9rha
Renamed FIELD_TYPE to DRIZZLE_TYPE

Show diffs side-by-side

added added

removed removed

Lines of Context:
1436
1436
        innobase_hton->flags=HTON_NO_FLAGS;
1437
1437
        innobase_hton->release_temporary_latches=innobase_release_temporary_latches;
1438
1438
 
1439
 
        ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)FIELD_TYPE_VARCHAR);
 
1439
        ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)DRIZZLE_TYPE_VARCHAR);
1440
1440
 
1441
1441
#ifdef UNIV_DEBUG
1442
1442
        static const char       test_filename[] = "-@";
2526
2526
 
2527
2527
        switch (mysql_tp) {
2528
2528
 
2529
 
        case FIELD_TYPE_STRING:
2530
 
        case FIELD_TYPE_VAR_STRING:
2531
 
        case FIELD_TYPE_BLOB:
2532
 
        case FIELD_TYPE_VARCHAR:
 
2529
        case DRIZZLE_TYPE_STRING:
 
2530
        case DRIZZLE_TYPE_VAR_STRING:
 
2531
        case DRIZZLE_TYPE_BLOB:
 
2532
        case DRIZZLE_TYPE_VARCHAR:
2533
2533
                /* Use the charset number to pick the right charset struct for
2534
2534
                the comparison. Since the MySQL function get_charset may be
2535
2535
                slow before Bar removes the mutex operation there, we first
2592
2592
        8 bits: this is used in ibuf and also when DATA_NOT_NULL is ORed to
2593
2593
        the type */
2594
2594
 
2595
 
        assert((ulint)FIELD_TYPE_STRING < 256);
2596
 
        assert((ulint)FIELD_TYPE_VAR_STRING < 256);
2597
 
        assert((ulint)FIELD_TYPE_DOUBLE < 256);
 
2595
        assert((ulint)DRIZZLE_TYPE_STRING < 256);
 
2596
        assert((ulint)DRIZZLE_TYPE_VAR_STRING < 256);
 
2597
        assert((ulint)DRIZZLE_TYPE_DOUBLE < 256);
2598
2598
 
2599
2599
        if (field->flags & UNSIGNED_FLAG) {
2600
2600
 
2603
2603
                *unsigned_flag = 0;
2604
2604
        }
2605
2605
 
2606
 
        if (field->real_type() == FIELD_TYPE_ENUM
2607
 
                || field->real_type() == FIELD_TYPE_SET) {
 
2606
        if (field->real_type() == DRIZZLE_TYPE_ENUM
 
2607
                || field->real_type() == DRIZZLE_TYPE_SET) {
2608
2608
 
2609
2609
                /* MySQL has field->type() a string type for these, but the
2610
2610
                data is actually internally stored as an unsigned integer
2620
2620
        switch (field->type()) {
2621
2621
                /* NOTE that we only allow string types in DATA_MYSQL and
2622
2622
                DATA_VARMYSQL */
2623
 
        case FIELD_TYPE_VAR_STRING: /* old <= 4.1 VARCHAR */
2624
 
        case FIELD_TYPE_VARCHAR:    /* new >= 5.0.3 true VARCHAR */
 
2623
        case DRIZZLE_TYPE_VAR_STRING: /* old <= 4.1 VARCHAR */
 
2624
        case DRIZZLE_TYPE_VARCHAR:    /* new >= 5.0.3 true VARCHAR */
2625
2625
                if (field->binary()) {
2626
2626
                        return(DATA_BINARY);
2627
2627
                } else if (strcmp(
2631
2631
                } else {
2632
2632
                        return(DATA_VARMYSQL);
2633
2633
                }
2634
 
        case FIELD_TYPE_STRING: if (field->binary()) {
 
2634
        case DRIZZLE_TYPE_STRING: if (field->binary()) {
2635
2635
 
2636
2636
                        return(DATA_FIXBINARY);
2637
2637
                } else if (strcmp(
2641
2641
                } else {
2642
2642
                        return(DATA_MYSQL);
2643
2643
                }
2644
 
        case FIELD_TYPE_NEWDECIMAL:
 
2644
        case DRIZZLE_TYPE_NEWDECIMAL:
2645
2645
                return(DATA_FIXBINARY);
2646
 
        case FIELD_TYPE_LONG:
2647
 
        case FIELD_TYPE_LONGLONG:
2648
 
        case FIELD_TYPE_TINY:
2649
 
        case FIELD_TYPE_SHORT:
2650
 
        case FIELD_TYPE_DATETIME:
2651
 
        case FIELD_TYPE_YEAR:
2652
 
        case FIELD_TYPE_NEWDATE:
2653
 
        case FIELD_TYPE_TIME:
2654
 
        case FIELD_TYPE_TIMESTAMP:
 
2646
        case DRIZZLE_TYPE_LONG:
 
2647
        case DRIZZLE_TYPE_LONGLONG:
 
2648
        case DRIZZLE_TYPE_TINY:
 
2649
        case DRIZZLE_TYPE_SHORT:
 
2650
        case DRIZZLE_TYPE_DATETIME:
 
2651
        case DRIZZLE_TYPE_YEAR:
 
2652
        case DRIZZLE_TYPE_NEWDATE:
 
2653
        case DRIZZLE_TYPE_TIME:
 
2654
        case DRIZZLE_TYPE_TIMESTAMP:
2655
2655
                return(DATA_INT);
2656
 
        case FIELD_TYPE_DOUBLE:
 
2656
        case DRIZZLE_TYPE_DOUBLE:
2657
2657
                return(DATA_DOUBLE);
2658
 
        case FIELD_TYPE_BLOB:
 
2658
        case DRIZZLE_TYPE_BLOB:
2659
2659
                return(DATA_BLOB);
2660
2660
        default:
2661
2661
                assert(0);
2758
2758
                field = key_part->field;
2759
2759
                mysql_type = field->type();
2760
2760
 
2761
 
                if (mysql_type == FIELD_TYPE_VARCHAR) {
 
2761
                if (mysql_type == DRIZZLE_TYPE_VARCHAR) {
2762
2762
                                                /* >= 5.0.3 true VARCHAR */
2763
2763
                        ulint   lenlen;
2764
2764
                        ulint   len;
2822
2822
 
2823
2823
                        buff += key_len;
2824
2824
 
2825
 
                } else if (mysql_type == FIELD_TYPE_BLOB) {
 
2825
                } else if (mysql_type == DRIZZLE_TYPE_BLOB) {
2826
2826
 
2827
2827
                        CHARSET_INFO*   cs;
2828
2828
                        ulint           key_len;
2917
2917
                        type is not enum or set. For these fields check
2918
2918
                        if character set is multi byte. */
2919
2919
 
2920
 
                        if (real_type != FIELD_TYPE_ENUM
2921
 
                                && real_type != FIELD_TYPE_SET
2922
 
                                && ( mysql_type == FIELD_TYPE_VAR_STRING
2923
 
                                        || mysql_type == FIELD_TYPE_STRING)) {
 
2920
                        if (real_type != DRIZZLE_TYPE_ENUM
 
2921
                                && real_type != DRIZZLE_TYPE_SET
 
2922
                                && ( mysql_type == DRIZZLE_TYPE_VAR_STRING
 
2923
                                        || mysql_type == DRIZZLE_TYPE_STRING)) {
2924
2924
 
2925
2925
                                cs = field->charset();
2926
2926
 
3607
3607
                case DATA_VARCHAR:
3608
3608
                case DATA_BINARY:
3609
3609
                case DATA_VARMYSQL:
3610
 
                        if (field_mysql_type == FIELD_TYPE_VARCHAR) {
 
3610
                        if (field_mysql_type == DRIZZLE_TYPE_VARCHAR) {
3611
3611
                                /* This is a >= 5.0.3 type true VARCHAR where
3612
3612
                                the real payload data length is stored in
3613
3613
                                1 or 2 bytes */
4648
4648
 
4649
4649
                long_true_varchar = 0;
4650
4650
 
4651
 
                if (field->type() == FIELD_TYPE_VARCHAR) {
 
4651
                if (field->type() == DRIZZLE_TYPE_VARCHAR) {
4652
4652
                        col_len -= ((Field_varstring*)field)->length_bytes;
4653
4653
 
4654
4654
                        if (((Field_varstring*)field)->length_bytes == 2) {
4755
4755
 
4756
4756
                if (DATA_BLOB == col_type
4757
4757
                        || (key_part->length < field->pack_length()
4758
 
                                && field->type() != FIELD_TYPE_VARCHAR)
4759
 
                        || (field->type() == FIELD_TYPE_VARCHAR
 
4758
                                && field->type() != DRIZZLE_TYPE_VARCHAR)
 
4759
                        || (field->type() == DRIZZLE_TYPE_VARCHAR
4760
4760
                                && key_part->length < field->pack_length()
4761
4761
                                - ((Field_varstring*)field)->length_bytes)) {
4762
4762
 
7414
7414
                field = key_part->field;
7415
7415
                mysql_type = field->type();
7416
7416
 
7417
 
                if (mysql_type == FIELD_TYPE_BLOB) {
 
7417
                if (mysql_type == DRIZZLE_TYPE_BLOB) {
7418
7418
 
7419
7419
                        /* In the MySQL key value format, a column prefix of
7420
7420
                        a BLOB is preceded by a 2-byte length field */