~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field.cc

  • Committer: Muhammad Umair
  • Date: 2011-08-16 11:47:29 UTC
  • mto: This revision was merged to the branch mainline in revision 2402.
  • Revision ID: umair@remotedesk-20110816114729-w6x88fj0sow4g3z9
mergeĀ lp:~mumair/drizzle/drizzle-IPv6Address

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
#include <drizzled/field/microtime.h>
49
49
#include <drizzled/field/varstring.h>
50
50
#include <drizzled/field/uuid.h>
 
51
#include <drizzled/field/ipv6.h>
51
52
#include <drizzled/time_functions.h>
52
53
#include <drizzled/internal/m_string.h>
53
54
#include <drizzled/table.h>
99
100
    DRIZZLE_TYPE_VARCHAR,
100
101
    //DRIZZLE_TYPE_MICROTIME
101
102
    DRIZZLE_TYPE_VARCHAR,
 
103
    //DRIZZLE_TYPE_IPV6
 
104
    DRIZZLE_TYPE_VARCHAR,
102
105
  },
103
106
  /* DRIZZLE_TYPE_DOUBLE -> */
104
107
  {
132
135
    DRIZZLE_TYPE_VARCHAR,
133
136
    //DRIZZLE_TYPE_MICROTIME
134
137
    DRIZZLE_TYPE_VARCHAR,
 
138
    //DRIZZLE_TYPE_IPV6
 
139
    DRIZZLE_TYPE_VARCHAR,
135
140
  },
136
141
  /* DRIZZLE_TYPE_NULL -> */
137
142
  {
165
170
    DRIZZLE_TYPE_UUID,
166
171
    //DRIZZLE_TYPE_MICROTIME
167
172
    DRIZZLE_TYPE_MICROTIME,
 
173
    //DRIZZLE_TYPE_IPV6
 
174
    DRIZZLE_TYPE_VARCHAR,
168
175
  },
169
176
  /* DRIZZLE_TYPE_TIMESTAMP -> */
170
177
  {
198
205
    DRIZZLE_TYPE_VARCHAR,
199
206
    //DRIZZLE_TYPE_MICROTIME
200
207
    DRIZZLE_TYPE_VARCHAR,
 
208
    //DRIZZLE_TYPE_IPV6
 
209
    DRIZZLE_TYPE_VARCHAR,
201
210
  },
202
211
  /* DRIZZLE_TYPE_LONGLONG -> */
203
212
  {
230
239
    DRIZZLE_TYPE_VARCHAR,
231
240
    //DRIZZLE_TYPE_MICROTIME
232
241
    DRIZZLE_TYPE_VARCHAR,
 
242
    //DRIZZLE_TYPE_IPV6
 
243
    DRIZZLE_TYPE_VARCHAR,
233
244
  },
234
245
  /* DRIZZLE_TYPE_DATETIME -> */
235
246
  {
263
274
    DRIZZLE_TYPE_VARCHAR,
264
275
    //DRIZZLE_TYPE_MICROTIME
265
276
    DRIZZLE_TYPE_VARCHAR,
 
277
    //DRIZZLE_TYPE_IPV6
 
278
    DRIZZLE_TYPE_VARCHAR,
266
279
  },
267
280
  /* DRIZZLE_TYPE_DATE -> */
268
281
  {
296
309
    DRIZZLE_TYPE_VARCHAR,
297
310
    //DRIZZLE_TYPE_MICROTIME
298
311
    DRIZZLE_TYPE_VARCHAR,
 
312
    //DRIZZLE_TYPE_IPV6
 
313
    DRIZZLE_TYPE_VARCHAR,
299
314
  },
300
315
  /* DRIZZLE_TYPE_VARCHAR -> */
301
316
  {
329
344
    DRIZZLE_TYPE_VARCHAR,
330
345
    //DRIZZLE_TYPE_MICROTIME
331
346
    DRIZZLE_TYPE_VARCHAR,
 
347
    //DRIZZLE_TYPE_IPV6
 
348
    DRIZZLE_TYPE_VARCHAR,
332
349
  },
333
350
  /* DRIZZLE_TYPE_DECIMAL -> */
334
351
  {
362
379
    DRIZZLE_TYPE_VARCHAR,
363
380
    //DRIZZLE_TYPE_MICROTIME
364
381
    DRIZZLE_TYPE_VARCHAR,
 
382
    //DRIZZLE_TYPE_IPV6
 
383
    DRIZZLE_TYPE_VARCHAR,
365
384
  },
366
385
  /* DRIZZLE_TYPE_ENUM -> */
367
386
  {
395
414
    DRIZZLE_TYPE_VARCHAR,
396
415
    //DRIZZLE_TYPE_MICROTIME
397
416
    DRIZZLE_TYPE_VARCHAR,
 
417
    //DRIZZLE_TYPE_IPV6
 
418
    DRIZZLE_TYPE_VARCHAR,
398
419
   },
399
420
  /* DRIZZLE_TYPE_BLOB -> */
400
421
  {
428
449
    DRIZZLE_TYPE_VARCHAR,
429
450
    //DRIZZLE_TYPE_MICROTIME
430
451
    DRIZZLE_TYPE_VARCHAR,
 
452
    //DRIZZLE_TYPE_IPV6
 
453
    DRIZZLE_TYPE_VARCHAR,
431
454
  },
432
455
  /* DRIZZLE_TYPE_TIME -> */
433
456
  {
461
484
    DRIZZLE_TYPE_UUID,
462
485
    //DRIZZLE_TYPE_MICROTIME
463
486
    DRIZZLE_TYPE_VARCHAR,
 
487
    //DRIZZLE_TYPE_IPV6
 
488
    DRIZZLE_TYPE_VARCHAR,
464
489
  },
465
490
  /* DRIZZLE_TYPE_BOOLEAN -> */
466
491
  {
494
519
    DRIZZLE_TYPE_VARCHAR,
495
520
    //DRIZZLE_TYPE_MICROTIME
496
521
    DRIZZLE_TYPE_VARCHAR,
 
522
    //DRIZZLE_TYPE_IPV6
 
523
    DRIZZLE_TYPE_VARCHAR,
497
524
  },
498
525
  /* DRIZZLE_TYPE_UUID -> */
499
526
  {
527
554
    DRIZZLE_TYPE_UUID,
528
555
    //DRIZZLE_TYPE_MICROTIME
529
556
    DRIZZLE_TYPE_VARCHAR,
 
557
    //DRIZZLE_TYPE_IPV6
 
558
    DRIZZLE_TYPE_VARCHAR,
530
559
  },
531
560
  /* DRIZZLE_TYPE_MICROTIME -> */
532
561
  {
560
589
    DRIZZLE_TYPE_UUID,
561
590
    //DRIZZLE_TYPE_MICROTIME
562
591
    DRIZZLE_TYPE_MICROTIME,
 
592
    //DRIZZLE_TYPE_IPV6
 
593
    DRIZZLE_TYPE_VARCHAR,
 
594
  },
 
595
  /* DRIZZLE_TYPE_IPV6 -> */
 
596
  {
 
597
    //DRIZZLE_TYPE_LONG
 
598
    DRIZZLE_TYPE_VARCHAR,
 
599
    //DRIZZLE_TYPE_DOUBLE
 
600
    DRIZZLE_TYPE_VARCHAR,
 
601
    //DRIZZLE_TYPE_NULL
 
602
    DRIZZLE_TYPE_IPV6,
 
603
    //DRIZZLE_TYPE_TIMESTAMP
 
604
    DRIZZLE_TYPE_VARCHAR,
 
605
    //DRIZZLE_TYPE_LONGLONG
 
606
    DRIZZLE_TYPE_VARCHAR,
 
607
    //DRIZZLE_TYPE_DATETIME
 
608
    DRIZZLE_TYPE_VARCHAR,
 
609
    //DRIZZLE_TYPE_DATE
 
610
    DRIZZLE_TYPE_VARCHAR,
 
611
    //DRIZZLE_TYPE_VARCHAR
 
612
    DRIZZLE_TYPE_VARCHAR,
 
613
    //DRIZZLE_TYPE_DECIMAL
 
614
    DRIZZLE_TYPE_VARCHAR,
 
615
    //DRIZZLE_TYPE_VARCHAR,
 
616
    DRIZZLE_TYPE_VARCHAR,
 
617
    //DRIZZLE_TYPE_BLOB
 
618
    DRIZZLE_TYPE_BLOB,
 
619
    //DRIZZLE_TYPE_TIME
 
620
    DRIZZLE_TYPE_TIME,
 
621
    //DRIZZLE_TYPE_BOOLEAN
 
622
    DRIZZLE_TYPE_VARCHAR,
 
623
    //DRIZZLE_TYPE_UUID
 
624
    DRIZZLE_TYPE_UUID,
 
625
    //DRIZZLE_TYPE_MICROTIME
 
626
    DRIZZLE_TYPE_MICROTIME,
 
627
    //DRIZZLE_TYPE_IPV6
 
628
    DRIZZLE_TYPE_VARCHAR,
563
629
  },
564
630
};
565
631
 
595
661
  STRING_RESULT,
596
662
  //DRIZZLE_TYPE_MICROTIME
597
663
  STRING_RESULT,
 
664
  //DRIZZLE_TYPE_IPV6
 
665
  STRING_RESULT,
598
666
};
599
667
 
600
668
bool test_if_important_data(const charset_info_st * const cs, 
1111
1179
  case DRIZZLE_TYPE_MICROTIME: return field::Microtime::max_string_length();
1112
1180
  case DRIZZLE_TYPE_TIMESTAMP: return field::Epoch::max_string_length();
1113
1181
  case DRIZZLE_TYPE_BOOLEAN: return field::Boolean::max_string_length();
 
1182
  case DRIZZLE_TYPE_IPV6: return field::IPv6::max_string_length();
1114
1183
  case DRIZZLE_TYPE_DATE:
1115
1184
  case DRIZZLE_TYPE_ENUM:
1116
1185
  case DRIZZLE_TYPE_LONG: return 4;