~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item_create.cc

  • Committer: Brian Aker
  • Date: 2008-10-20 03:40:03 UTC
  • mto: (492.3.21 drizzle-clean-code)
  • mto: This revision was merged to the branch mainline in revision 530.
  • Revision ID: brian@tangent.org-20081020034003-t2dcnl0ayr2ymm8k
THD -> Session rename

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
class Create_native_func : public Create_func
40
40
{
41
41
public:
42
 
  virtual Item *create(THD *thd, LEX_STRING name, List<Item> *item_list);
 
42
  virtual Item *create(Session *thd, LEX_STRING name, List<Item> *item_list);
43
43
 
44
44
  /**
45
45
    Builder method, with no arguments.
48
48
    @param item_list The function parameters, none of which are named
49
49
    @return An item representing the function call
50
50
  */
51
 
  virtual Item *create_native(THD *thd, LEX_STRING name,
 
51
  virtual Item *create_native(Session *thd, LEX_STRING name,
52
52
                              List<Item> *item_list) = 0;
53
53
 
54
54
protected:
66
66
class Create_func_arg0 : public Create_func
67
67
{
68
68
public:
69
 
  virtual Item *create(THD *thd, LEX_STRING name, List<Item> *item_list);
 
69
  virtual Item *create(Session *thd, LEX_STRING name, List<Item> *item_list);
70
70
 
71
71
  /**
72
72
    Builder method, with no arguments.
73
73
    @param thd The current thread
74
74
    @return An item representing the function call
75
75
  */
76
 
  virtual Item *create(THD *thd) = 0;
 
76
  virtual Item *create(Session *thd) = 0;
77
77
 
78
78
protected:
79
79
  /** Constructor. */
90
90
class Create_func_arg1 : public Create_func
91
91
{
92
92
public:
93
 
  virtual Item *create(THD *thd, LEX_STRING name, List<Item> *item_list);
 
93
  virtual Item *create(Session *thd, LEX_STRING name, List<Item> *item_list);
94
94
 
95
95
  /**
96
96
    Builder method, with one argument.
98
98
    @param arg1 The first argument of the function
99
99
    @return An item representing the function call
100
100
  */
101
 
  virtual Item *create(THD *thd, Item *arg1) = 0;
 
101
  virtual Item *create(Session *thd, Item *arg1) = 0;
102
102
 
103
103
protected:
104
104
  /** Constructor. */
115
115
class Create_func_arg2 : public Create_func
116
116
{
117
117
public:
118
 
  virtual Item *create(THD *thd, LEX_STRING name, List<Item> *item_list);
 
118
  virtual Item *create(Session *thd, LEX_STRING name, List<Item> *item_list);
119
119
 
120
120
  /**
121
121
    Builder method, with two arguments.
124
124
    @param arg2 The second argument of the function
125
125
    @return An item representing the function call
126
126
  */
127
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2) = 0;
 
127
  virtual Item *create(Session *thd, Item *arg1, Item *arg2) = 0;
128
128
 
129
129
protected:
130
130
  /** Constructor. */
141
141
class Create_func_arg3 : public Create_func
142
142
{
143
143
public:
144
 
  virtual Item *create(THD *thd, LEX_STRING name, List<Item> *item_list);
 
144
  virtual Item *create(Session *thd, LEX_STRING name, List<Item> *item_list);
145
145
 
146
146
  /**
147
147
    Builder method, with three arguments.
151
151
    @param arg3 The third argument of the function
152
152
    @return An item representing the function call
153
153
  */
154
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3) = 0;
 
154
  virtual Item *create(Session *thd, Item *arg1, Item *arg2, Item *arg3) = 0;
155
155
 
156
156
protected:
157
157
  /** Constructor. */
174
174
class Create_func_abs : public Create_func_arg1
175
175
{
176
176
public:
177
 
  virtual Item *create(THD *thd, Item *arg1);
 
177
  virtual Item *create(Session *thd, Item *arg1);
178
178
 
179
179
  static Create_func_abs s_singleton;
180
180
 
187
187
class Create_func_acos : public Create_func_arg1
188
188
{
189
189
public:
190
 
  virtual Item *create(THD *thd, Item *arg1);
 
190
  virtual Item *create(Session *thd, Item *arg1);
191
191
 
192
192
  static Create_func_acos s_singleton;
193
193
 
200
200
class Create_func_addtime : public Create_func_arg2
201
201
{
202
202
public:
203
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
203
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
204
204
 
205
205
  static Create_func_addtime s_singleton;
206
206
 
213
213
class Create_func_asin : public Create_func_arg1
214
214
{
215
215
public:
216
 
  virtual Item *create(THD *thd, Item *arg1);
 
216
  virtual Item *create(Session *thd, Item *arg1);
217
217
 
218
218
  static Create_func_asin s_singleton;
219
219
 
226
226
class Create_func_atan : public Create_native_func
227
227
{
228
228
public:
229
 
  virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
 
229
  virtual Item *create_native(Session *thd, LEX_STRING name, List<Item> *item_list);
230
230
 
231
231
  static Create_func_atan s_singleton;
232
232
 
239
239
class Create_func_benchmark : public Create_func_arg2
240
240
{
241
241
public:
242
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
242
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
243
243
 
244
244
  static Create_func_benchmark s_singleton;
245
245
 
252
252
class Create_func_bin : public Create_func_arg1
253
253
{
254
254
public:
255
 
  virtual Item *create(THD *thd, Item *arg1);
 
255
  virtual Item *create(Session *thd, Item *arg1);
256
256
 
257
257
  static Create_func_bin s_singleton;
258
258
 
265
265
class Create_func_bit_count : public Create_func_arg1
266
266
{
267
267
public:
268
 
  virtual Item *create(THD *thd, Item *arg1);
 
268
  virtual Item *create(Session *thd, Item *arg1);
269
269
 
270
270
  static Create_func_bit_count s_singleton;
271
271
 
278
278
class Create_func_bit_length : public Create_func_arg1
279
279
{
280
280
public:
281
 
  virtual Item *create(THD *thd, Item *arg1);
 
281
  virtual Item *create(Session *thd, Item *arg1);
282
282
 
283
283
  static Create_func_bit_length s_singleton;
284
284
 
291
291
class Create_func_ceiling : public Create_func_arg1
292
292
{
293
293
public:
294
 
  virtual Item *create(THD *thd, Item *arg1);
 
294
  virtual Item *create(Session *thd, Item *arg1);
295
295
 
296
296
  static Create_func_ceiling s_singleton;
297
297
 
304
304
class Create_func_char_length : public Create_func_arg1
305
305
{
306
306
public:
307
 
  virtual Item *create(THD *thd, Item *arg1);
 
307
  virtual Item *create(Session *thd, Item *arg1);
308
308
 
309
309
  static Create_func_char_length s_singleton;
310
310
 
317
317
class Create_func_coercibility : public Create_func_arg1
318
318
{
319
319
public:
320
 
  virtual Item *create(THD *thd, Item *arg1);
 
320
  virtual Item *create(Session *thd, Item *arg1);
321
321
 
322
322
  static Create_func_coercibility s_singleton;
323
323
 
330
330
class Create_func_concat : public Create_native_func
331
331
{
332
332
public:
333
 
  virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
 
333
  virtual Item *create_native(Session *thd, LEX_STRING name, List<Item> *item_list);
334
334
 
335
335
  static Create_func_concat s_singleton;
336
336
 
343
343
class Create_func_concat_ws : public Create_native_func
344
344
{
345
345
public:
346
 
  virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
 
346
  virtual Item *create_native(Session *thd, LEX_STRING name, List<Item> *item_list);
347
347
 
348
348
  static Create_func_concat_ws s_singleton;
349
349
 
356
356
class Create_func_connection_id : public Create_func_arg0
357
357
{
358
358
public:
359
 
  virtual Item *create(THD *thd);
 
359
  virtual Item *create(Session *thd);
360
360
 
361
361
  static Create_func_connection_id s_singleton;
362
362
 
369
369
class Create_func_conv : public Create_func_arg3
370
370
{
371
371
public:
372
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
 
372
  virtual Item *create(Session *thd, Item *arg1, Item *arg2, Item *arg3);
373
373
 
374
374
  static Create_func_conv s_singleton;
375
375
 
382
382
class Create_func_cos : public Create_func_arg1
383
383
{
384
384
public:
385
 
  virtual Item *create(THD *thd, Item *arg1);
 
385
  virtual Item *create(Session *thd, Item *arg1);
386
386
 
387
387
  static Create_func_cos s_singleton;
388
388
 
395
395
class Create_func_cot : public Create_func_arg1
396
396
{
397
397
public:
398
 
  virtual Item *create(THD *thd, Item *arg1);
 
398
  virtual Item *create(Session *thd, Item *arg1);
399
399
 
400
400
  static Create_func_cot s_singleton;
401
401
 
407
407
class Create_func_date_format : public Create_func_arg2
408
408
{
409
409
public:
410
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
410
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
411
411
 
412
412
  static Create_func_date_format s_singleton;
413
413
 
420
420
class Create_func_datediff : public Create_func_arg2
421
421
{
422
422
public:
423
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
423
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
424
424
 
425
425
  static Create_func_datediff s_singleton;
426
426
 
433
433
class Create_func_dayname : public Create_func_arg1
434
434
{
435
435
public:
436
 
  virtual Item *create(THD *thd, Item *arg1);
 
436
  virtual Item *create(Session *thd, Item *arg1);
437
437
 
438
438
  static Create_func_dayname s_singleton;
439
439
 
446
446
class Create_func_dayofmonth : public Create_func_arg1
447
447
{
448
448
public:
449
 
  virtual Item *create(THD *thd, Item *arg1);
 
449
  virtual Item *create(Session *thd, Item *arg1);
450
450
 
451
451
  static Create_func_dayofmonth s_singleton;
452
452
 
459
459
class Create_func_dayofweek : public Create_func_arg1
460
460
{
461
461
public:
462
 
  virtual Item *create(THD *thd, Item *arg1);
 
462
  virtual Item *create(Session *thd, Item *arg1);
463
463
 
464
464
  static Create_func_dayofweek s_singleton;
465
465
 
472
472
class Create_func_dayofyear : public Create_func_arg1
473
473
{
474
474
public:
475
 
  virtual Item *create(THD *thd, Item *arg1);
 
475
  virtual Item *create(Session *thd, Item *arg1);
476
476
 
477
477
  static Create_func_dayofyear s_singleton;
478
478
 
485
485
class Create_func_decode : public Create_func_arg2
486
486
{
487
487
public:
488
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
488
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
489
489
 
490
490
  static Create_func_decode s_singleton;
491
491
 
498
498
class Create_func_degrees : public Create_func_arg1
499
499
{
500
500
public:
501
 
  virtual Item *create(THD *thd, Item *arg1);
 
501
  virtual Item *create(Session *thd, Item *arg1);
502
502
 
503
503
  static Create_func_degrees s_singleton;
504
504
 
511
511
class Create_func_elt : public Create_native_func
512
512
{
513
513
public:
514
 
  virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
 
514
  virtual Item *create_native(Session *thd, LEX_STRING name, List<Item> *item_list);
515
515
 
516
516
  static Create_func_elt s_singleton;
517
517
 
524
524
class Create_func_exp : public Create_func_arg1
525
525
{
526
526
public:
527
 
  virtual Item *create(THD *thd, Item *arg1);
 
527
  virtual Item *create(Session *thd, Item *arg1);
528
528
 
529
529
  static Create_func_exp s_singleton;
530
530
 
537
537
class Create_func_export_set : public Create_native_func
538
538
{
539
539
public:
540
 
  virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
 
540
  virtual Item *create_native(Session *thd, LEX_STRING name, List<Item> *item_list);
541
541
 
542
542
  static Create_func_export_set s_singleton;
543
543
 
550
550
class Create_func_field : public Create_native_func
551
551
{
552
552
public:
553
 
  virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
 
553
  virtual Item *create_native(Session *thd, LEX_STRING name, List<Item> *item_list);
554
554
 
555
555
  static Create_func_field s_singleton;
556
556
 
563
563
class Create_func_find_in_set : public Create_func_arg2
564
564
{
565
565
public:
566
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
566
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
567
567
 
568
568
  static Create_func_find_in_set s_singleton;
569
569
 
576
576
class Create_func_floor : public Create_func_arg1
577
577
{
578
578
public:
579
 
  virtual Item *create(THD *thd, Item *arg1);
 
579
  virtual Item *create(Session *thd, Item *arg1);
580
580
 
581
581
  static Create_func_floor s_singleton;
582
582
 
589
589
class Create_func_format : public Create_func_arg2
590
590
{
591
591
public:
592
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
592
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
593
593
 
594
594
  static Create_func_format s_singleton;
595
595
 
602
602
class Create_func_found_rows : public Create_func_arg0
603
603
{
604
604
public:
605
 
  virtual Item *create(THD *thd);
 
605
  virtual Item *create(Session *thd);
606
606
 
607
607
  static Create_func_found_rows s_singleton;
608
608
 
615
615
class Create_func_from_days : public Create_func_arg1
616
616
{
617
617
public:
618
 
  virtual Item *create(THD *thd, Item *arg1);
 
618
  virtual Item *create(Session *thd, Item *arg1);
619
619
 
620
620
  static Create_func_from_days s_singleton;
621
621
 
628
628
class Create_func_from_unixtime : public Create_native_func
629
629
{
630
630
public:
631
 
  virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
 
631
  virtual Item *create_native(Session *thd, LEX_STRING name, List<Item> *item_list);
632
632
 
633
633
  static Create_func_from_unixtime s_singleton;
634
634
 
641
641
class Create_func_greatest : public Create_native_func
642
642
{
643
643
public:
644
 
  virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
 
644
  virtual Item *create_native(Session *thd, LEX_STRING name, List<Item> *item_list);
645
645
 
646
646
  static Create_func_greatest s_singleton;
647
647
 
654
654
class Create_func_hex : public Create_func_arg1
655
655
{
656
656
public:
657
 
  virtual Item *create(THD *thd, Item *arg1);
 
657
  virtual Item *create(Session *thd, Item *arg1);
658
658
 
659
659
  static Create_func_hex s_singleton;
660
660
 
667
667
class Create_func_ifnull : public Create_func_arg2
668
668
{
669
669
public:
670
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
670
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
671
671
 
672
672
  static Create_func_ifnull s_singleton;
673
673
 
680
680
class Create_func_instr : public Create_func_arg2
681
681
{
682
682
public:
683
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
683
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
684
684
 
685
685
  static Create_func_instr s_singleton;
686
686
 
693
693
class Create_func_isnull : public Create_func_arg1
694
694
{
695
695
public:
696
 
  virtual Item *create(THD *thd, Item *arg1);
 
696
  virtual Item *create(Session *thd, Item *arg1);
697
697
 
698
698
  static Create_func_isnull s_singleton;
699
699
 
706
706
class Create_func_last_day : public Create_func_arg1
707
707
{
708
708
public:
709
 
  virtual Item *create(THD *thd, Item *arg1);
 
709
  virtual Item *create(Session *thd, Item *arg1);
710
710
 
711
711
  static Create_func_last_day s_singleton;
712
712
 
719
719
class Create_func_last_insert_id : public Create_native_func
720
720
{
721
721
public:
722
 
  virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
 
722
  virtual Item *create_native(Session *thd, LEX_STRING name, List<Item> *item_list);
723
723
 
724
724
  static Create_func_last_insert_id s_singleton;
725
725
 
732
732
class Create_func_lcase : public Create_func_arg1
733
733
{
734
734
public:
735
 
  virtual Item *create(THD *thd, Item *arg1);
 
735
  virtual Item *create(Session *thd, Item *arg1);
736
736
 
737
737
  static Create_func_lcase s_singleton;
738
738
 
745
745
class Create_func_least : public Create_native_func
746
746
{
747
747
public:
748
 
  virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
 
748
  virtual Item *create_native(Session *thd, LEX_STRING name, List<Item> *item_list);
749
749
 
750
750
  static Create_func_least s_singleton;
751
751
 
758
758
class Create_func_length : public Create_func_arg1
759
759
{
760
760
public:
761
 
  virtual Item *create(THD *thd, Item *arg1);
 
761
  virtual Item *create(Session *thd, Item *arg1);
762
762
 
763
763
  static Create_func_length s_singleton;
764
764
 
771
771
class Create_func_ln : public Create_func_arg1
772
772
{
773
773
public:
774
 
  virtual Item *create(THD *thd, Item *arg1);
 
774
  virtual Item *create(Session *thd, Item *arg1);
775
775
 
776
776
  static Create_func_ln s_singleton;
777
777
 
784
784
class Create_func_load_file : public Create_func_arg1
785
785
{
786
786
public:
787
 
  virtual Item *create(THD *thd, Item *arg1);
 
787
  virtual Item *create(Session *thd, Item *arg1);
788
788
 
789
789
  static Create_func_load_file s_singleton;
790
790
 
797
797
class Create_func_locate : public Create_native_func
798
798
{
799
799
public:
800
 
  virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
 
800
  virtual Item *create_native(Session *thd, LEX_STRING name, List<Item> *item_list);
801
801
 
802
802
  static Create_func_locate s_singleton;
803
803
 
810
810
class Create_func_log : public Create_native_func
811
811
{
812
812
public:
813
 
  virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
 
813
  virtual Item *create_native(Session *thd, LEX_STRING name, List<Item> *item_list);
814
814
 
815
815
  static Create_func_log s_singleton;
816
816
 
823
823
class Create_func_log10 : public Create_func_arg1
824
824
{
825
825
public:
826
 
  virtual Item *create(THD *thd, Item *arg1);
 
826
  virtual Item *create(Session *thd, Item *arg1);
827
827
 
828
828
  static Create_func_log10 s_singleton;
829
829
 
836
836
class Create_func_log2 : public Create_func_arg1
837
837
{
838
838
public:
839
 
  virtual Item *create(THD *thd, Item *arg1);
 
839
  virtual Item *create(Session *thd, Item *arg1);
840
840
 
841
841
  static Create_func_log2 s_singleton;
842
842
 
849
849
class Create_func_lpad : public Create_func_arg3
850
850
{
851
851
public:
852
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
 
852
  virtual Item *create(Session *thd, Item *arg1, Item *arg2, Item *arg3);
853
853
 
854
854
  static Create_func_lpad s_singleton;
855
855
 
862
862
class Create_func_ltrim : public Create_func_arg1
863
863
{
864
864
public:
865
 
  virtual Item *create(THD *thd, Item *arg1);
 
865
  virtual Item *create(Session *thd, Item *arg1);
866
866
 
867
867
  static Create_func_ltrim s_singleton;
868
868
 
875
875
class Create_func_makedate : public Create_func_arg2
876
876
{
877
877
public:
878
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
878
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
879
879
 
880
880
  static Create_func_makedate s_singleton;
881
881
 
888
888
class Create_func_maketime : public Create_func_arg3
889
889
{
890
890
public:
891
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
 
891
  virtual Item *create(Session *thd, Item *arg1, Item *arg2, Item *arg3);
892
892
 
893
893
  static Create_func_maketime s_singleton;
894
894
 
901
901
class Create_func_make_set : public Create_native_func
902
902
{
903
903
public:
904
 
  virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
 
904
  virtual Item *create_native(Session *thd, LEX_STRING name, List<Item> *item_list);
905
905
 
906
906
  static Create_func_make_set s_singleton;
907
907
 
914
914
class Create_func_master_pos_wait : public Create_native_func
915
915
{
916
916
public:
917
 
  virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
 
917
  virtual Item *create_native(Session *thd, LEX_STRING name, List<Item> *item_list);
918
918
 
919
919
  static Create_func_master_pos_wait s_singleton;
920
920
 
926
926
class Create_func_monthname : public Create_func_arg1
927
927
{
928
928
public:
929
 
  virtual Item *create(THD *thd, Item *arg1);
 
929
  virtual Item *create(Session *thd, Item *arg1);
930
930
 
931
931
  static Create_func_monthname s_singleton;
932
932
 
939
939
class Create_func_name_const : public Create_func_arg2
940
940
{
941
941
public:
942
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
942
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
943
943
 
944
944
  static Create_func_name_const s_singleton;
945
945
 
952
952
class Create_func_nullif : public Create_func_arg2
953
953
{
954
954
public:
955
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
955
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
956
956
 
957
957
  static Create_func_nullif s_singleton;
958
958
 
965
965
class Create_func_oct : public Create_func_arg1
966
966
{
967
967
public:
968
 
  virtual Item *create(THD *thd, Item *arg1);
 
968
  virtual Item *create(Session *thd, Item *arg1);
969
969
 
970
970
  static Create_func_oct s_singleton;
971
971
 
978
978
class Create_func_ord : public Create_func_arg1
979
979
{
980
980
public:
981
 
  virtual Item *create(THD *thd, Item *arg1);
 
981
  virtual Item *create(Session *thd, Item *arg1);
982
982
 
983
983
  static Create_func_ord s_singleton;
984
984
 
991
991
class Create_func_period_add : public Create_func_arg2
992
992
{
993
993
public:
994
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
994
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
995
995
 
996
996
  static Create_func_period_add s_singleton;
997
997
 
1004
1004
class Create_func_period_diff : public Create_func_arg2
1005
1005
{
1006
1006
public:
1007
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
1007
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
1008
1008
 
1009
1009
  static Create_func_period_diff s_singleton;
1010
1010
 
1017
1017
class Create_func_pi : public Create_func_arg0
1018
1018
{
1019
1019
public:
1020
 
  virtual Item *create(THD *thd);
 
1020
  virtual Item *create(Session *thd);
1021
1021
 
1022
1022
  static Create_func_pi s_singleton;
1023
1023
 
1030
1030
class Create_func_pow : public Create_func_arg2
1031
1031
{
1032
1032
public:
1033
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
1033
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
1034
1034
 
1035
1035
  static Create_func_pow s_singleton;
1036
1036
 
1043
1043
class Create_func_quote : public Create_func_arg1
1044
1044
{
1045
1045
public:
1046
 
  virtual Item *create(THD *thd, Item *arg1);
 
1046
  virtual Item *create(Session *thd, Item *arg1);
1047
1047
 
1048
1048
  static Create_func_quote s_singleton;
1049
1049
 
1056
1056
class Create_func_radians : public Create_func_arg1
1057
1057
{
1058
1058
public:
1059
 
  virtual Item *create(THD *thd, Item *arg1);
 
1059
  virtual Item *create(Session *thd, Item *arg1);
1060
1060
 
1061
1061
  static Create_func_radians s_singleton;
1062
1062
 
1069
1069
class Create_func_rand : public Create_native_func
1070
1070
{
1071
1071
public:
1072
 
  virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
 
1072
  virtual Item *create_native(Session *thd, LEX_STRING name, List<Item> *item_list);
1073
1073
 
1074
1074
  static Create_func_rand s_singleton;
1075
1075
 
1082
1082
class Create_func_round : public Create_native_func
1083
1083
{
1084
1084
public:
1085
 
  virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
 
1085
  virtual Item *create_native(Session *thd, LEX_STRING name, List<Item> *item_list);
1086
1086
 
1087
1087
  static Create_func_round s_singleton;
1088
1088
 
1095
1095
class Create_func_row_count : public Create_func_arg0
1096
1096
{
1097
1097
public:
1098
 
  virtual Item *create(THD *thd);
 
1098
  virtual Item *create(Session *thd);
1099
1099
 
1100
1100
  static Create_func_row_count s_singleton;
1101
1101
 
1108
1108
class Create_func_rpad : public Create_func_arg3
1109
1109
{
1110
1110
public:
1111
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
 
1111
  virtual Item *create(Session *thd, Item *arg1, Item *arg2, Item *arg3);
1112
1112
 
1113
1113
  static Create_func_rpad s_singleton;
1114
1114
 
1121
1121
class Create_func_rtrim : public Create_func_arg1
1122
1122
{
1123
1123
public:
1124
 
  virtual Item *create(THD *thd, Item *arg1);
 
1124
  virtual Item *create(Session *thd, Item *arg1);
1125
1125
 
1126
1126
  static Create_func_rtrim s_singleton;
1127
1127
 
1134
1134
class Create_func_sec_to_time : public Create_func_arg1
1135
1135
{
1136
1136
public:
1137
 
  virtual Item *create(THD *thd, Item *arg1);
 
1137
  virtual Item *create(Session *thd, Item *arg1);
1138
1138
 
1139
1139
  static Create_func_sec_to_time s_singleton;
1140
1140
 
1147
1147
class Create_func_sign : public Create_func_arg1
1148
1148
{
1149
1149
public:
1150
 
  virtual Item *create(THD *thd, Item *arg1);
 
1150
  virtual Item *create(Session *thd, Item *arg1);
1151
1151
 
1152
1152
  static Create_func_sign s_singleton;
1153
1153
 
1160
1160
class Create_func_sin : public Create_func_arg1
1161
1161
{
1162
1162
public:
1163
 
  virtual Item *create(THD *thd, Item *arg1);
 
1163
  virtual Item *create(Session *thd, Item *arg1);
1164
1164
 
1165
1165
  static Create_func_sin s_singleton;
1166
1166
 
1173
1173
class Create_func_space : public Create_func_arg1
1174
1174
{
1175
1175
public:
1176
 
  virtual Item *create(THD *thd, Item *arg1);
 
1176
  virtual Item *create(Session *thd, Item *arg1);
1177
1177
 
1178
1178
  static Create_func_space s_singleton;
1179
1179
 
1186
1186
class Create_func_sqrt : public Create_func_arg1
1187
1187
{
1188
1188
public:
1189
 
  virtual Item *create(THD *thd, Item *arg1);
 
1189
  virtual Item *create(Session *thd, Item *arg1);
1190
1190
 
1191
1191
  static Create_func_sqrt s_singleton;
1192
1192
 
1199
1199
class Create_func_str_to_date : public Create_func_arg2
1200
1200
{
1201
1201
public:
1202
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
1202
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
1203
1203
 
1204
1204
  static Create_func_str_to_date s_singleton;
1205
1205
 
1212
1212
class Create_func_strcmp : public Create_func_arg2
1213
1213
{
1214
1214
public:
1215
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
1215
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
1216
1216
 
1217
1217
  static Create_func_strcmp s_singleton;
1218
1218
 
1225
1225
class Create_func_substr_index : public Create_func_arg3
1226
1226
{
1227
1227
public:
1228
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
 
1228
  virtual Item *create(Session *thd, Item *arg1, Item *arg2, Item *arg3);
1229
1229
 
1230
1230
  static Create_func_substr_index s_singleton;
1231
1231
 
1238
1238
class Create_func_subtime : public Create_func_arg2
1239
1239
{
1240
1240
public:
1241
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
1241
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
1242
1242
 
1243
1243
  static Create_func_subtime s_singleton;
1244
1244
 
1251
1251
class Create_func_tan : public Create_func_arg1
1252
1252
{
1253
1253
public:
1254
 
  virtual Item *create(THD *thd, Item *arg1);
 
1254
  virtual Item *create(Session *thd, Item *arg1);
1255
1255
 
1256
1256
  static Create_func_tan s_singleton;
1257
1257
 
1264
1264
class Create_func_time_format : public Create_func_arg2
1265
1265
{
1266
1266
public:
1267
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
1267
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
1268
1268
 
1269
1269
  static Create_func_time_format s_singleton;
1270
1270
 
1277
1277
class Create_func_time_to_sec : public Create_func_arg1
1278
1278
{
1279
1279
public:
1280
 
  virtual Item *create(THD *thd, Item *arg1);
 
1280
  virtual Item *create(Session *thd, Item *arg1);
1281
1281
 
1282
1282
  static Create_func_time_to_sec s_singleton;
1283
1283
 
1290
1290
class Create_func_timediff : public Create_func_arg2
1291
1291
{
1292
1292
public:
1293
 
  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
 
1293
  virtual Item *create(Session *thd, Item *arg1, Item *arg2);
1294
1294
 
1295
1295
  static Create_func_timediff s_singleton;
1296
1296
 
1303
1303
class Create_func_to_days : public Create_func_arg1
1304
1304
{
1305
1305
public:
1306
 
  virtual Item *create(THD *thd, Item *arg1);
 
1306
  virtual Item *create(Session *thd, Item *arg1);
1307
1307
 
1308
1308
  static Create_func_to_days s_singleton;
1309
1309
 
1316
1316
class Create_func_ucase : public Create_func_arg1
1317
1317
{
1318
1318
public:
1319
 
  virtual Item *create(THD *thd, Item *arg1);
 
1319
  virtual Item *create(Session *thd, Item *arg1);
1320
1320
 
1321
1321
  static Create_func_ucase s_singleton;
1322
1322
 
1329
1329
class Create_func_unhex : public Create_func_arg1
1330
1330
{
1331
1331
public:
1332
 
  virtual Item *create(THD *thd, Item *arg1);
 
1332
  virtual Item *create(Session *thd, Item *arg1);
1333
1333
 
1334
1334
  static Create_func_unhex s_singleton;
1335
1335
 
1342
1342
class Create_func_unix_timestamp : public Create_native_func
1343
1343
{
1344
1344
public:
1345
 
  virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
 
1345
  virtual Item *create_native(Session *thd, LEX_STRING name, List<Item> *item_list);
1346
1346
 
1347
1347
  static Create_func_unix_timestamp s_singleton;
1348
1348
 
1355
1355
class Create_func_uuid : public Create_func_arg0
1356
1356
{
1357
1357
public:
1358
 
  virtual Item *create(THD *thd);
 
1358
  virtual Item *create(Session *thd);
1359
1359
 
1360
1360
  static Create_func_uuid s_singleton;
1361
1361
 
1368
1368
class Create_func_version : public Create_func_arg0
1369
1369
{
1370
1370
public:
1371
 
  virtual Item *create(THD *thd);
 
1371
  virtual Item *create(Session *thd);
1372
1372
 
1373
1373
  static Create_func_version s_singleton;
1374
1374
 
1381
1381
class Create_func_weekday : public Create_func_arg1
1382
1382
{
1383
1383
public:
1384
 
  virtual Item *create(THD *thd, Item *arg1);
 
1384
  virtual Item *create(Session *thd, Item *arg1);
1385
1385
 
1386
1386
  static Create_func_weekday s_singleton;
1387
1387
 
1394
1394
class Create_func_weekofyear : public Create_func_arg1
1395
1395
{
1396
1396
public:
1397
 
  virtual Item *create(THD *thd, Item *arg1);
 
1397
  virtual Item *create(Session *thd, Item *arg1);
1398
1398
 
1399
1399
  static Create_func_weekofyear s_singleton;
1400
1400
 
1407
1407
class Create_func_year_week : public Create_native_func
1408
1408
{
1409
1409
public:
1410
 
  virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list);
 
1410
  virtual Item *create_native(Session *thd, LEX_STRING name, List<Item> *item_list);
1411
1411
 
1412
1412
  static Create_func_year_week s_singleton;
1413
1413
 
1450
1450
Create_udf_func Create_udf_func::s_singleton;
1451
1451
 
1452
1452
Item*
1453
 
Create_udf_func::create(THD *thd, LEX_STRING name, List<Item> *item_list)
 
1453
Create_udf_func::create(Session *thd, LEX_STRING name, List<Item> *item_list)
1454
1454
{
1455
1455
  udf_func *udf= find_udf(name.str, name.length);
1456
1456
  assert(udf);
1459
1459
 
1460
1460
 
1461
1461
Item*
1462
 
Create_udf_func::create(THD *thd, udf_func *udf, List<Item> *item_list)
 
1462
Create_udf_func::create(Session *thd, udf_func *udf, List<Item> *item_list)
1463
1463
{
1464
1464
  Item_func *func= NULL;
1465
1465
  int arg_count= 0;
1478
1478
 
1479
1479
 
1480
1480
Item*
1481
 
Create_native_func::create(THD *thd, LEX_STRING name, List<Item> *item_list)
 
1481
Create_native_func::create(Session *thd, LEX_STRING name, List<Item> *item_list)
1482
1482
{
1483
1483
  if (has_named_parameters(item_list))
1484
1484
  {
1491
1491
 
1492
1492
 
1493
1493
Item*
1494
 
Create_func_arg0::create(THD *thd, LEX_STRING name, List<Item> *item_list)
 
1494
Create_func_arg0::create(Session *thd, LEX_STRING name, List<Item> *item_list)
1495
1495
{
1496
1496
  int arg_count= 0;
1497
1497
 
1509
1509
 
1510
1510
 
1511
1511
Item*
1512
 
Create_func_arg1::create(THD *thd, LEX_STRING name, List<Item> *item_list)
 
1512
Create_func_arg1::create(Session *thd, LEX_STRING name, List<Item> *item_list)
1513
1513
{
1514
1514
  int arg_count= 0;
1515
1515
 
1535
1535
 
1536
1536
 
1537
1537
Item*
1538
 
Create_func_arg2::create(THD *thd, LEX_STRING name, List<Item> *item_list)
 
1538
Create_func_arg2::create(Session *thd, LEX_STRING name, List<Item> *item_list)
1539
1539
{
1540
1540
  int arg_count= 0;
1541
1541
 
1563
1563
 
1564
1564
 
1565
1565
Item*
1566
 
Create_func_arg3::create(THD *thd, LEX_STRING name, List<Item> *item_list)
 
1566
Create_func_arg3::create(Session *thd, LEX_STRING name, List<Item> *item_list)
1567
1567
{
1568
1568
  int arg_count= 0;
1569
1569
 
1595
1595
Create_func_abs Create_func_abs::s_singleton;
1596
1596
 
1597
1597
Item*
1598
 
Create_func_abs::create(THD *thd, Item *arg1)
 
1598
Create_func_abs::create(Session *thd, Item *arg1)
1599
1599
{
1600
1600
  return new (thd->mem_root) Item_func_abs(arg1);
1601
1601
}
1604
1604
Create_func_acos Create_func_acos::s_singleton;
1605
1605
 
1606
1606
Item*
1607
 
Create_func_acos::create(THD *thd, Item *arg1)
 
1607
Create_func_acos::create(Session *thd, Item *arg1)
1608
1608
{
1609
1609
  return new (thd->mem_root) Item_func_acos(arg1);
1610
1610
}
1613
1613
Create_func_addtime Create_func_addtime::s_singleton;
1614
1614
 
1615
1615
Item*
1616
 
Create_func_addtime::create(THD *thd, Item *arg1, Item *arg2)
 
1616
Create_func_addtime::create(Session *thd, Item *arg1, Item *arg2)
1617
1617
{
1618
1618
  return new (thd->mem_root) Item_func_add_time(arg1, arg2, 0, 0);
1619
1619
}
1622
1622
Create_func_asin Create_func_asin::s_singleton;
1623
1623
 
1624
1624
Item*
1625
 
Create_func_asin::create(THD *thd, Item *arg1)
 
1625
Create_func_asin::create(Session *thd, Item *arg1)
1626
1626
{
1627
1627
  return new (thd->mem_root) Item_func_asin(arg1);
1628
1628
}
1631
1631
Create_func_atan Create_func_atan::s_singleton;
1632
1632
 
1633
1633
Item*
1634
 
Create_func_atan::create_native(THD *thd, LEX_STRING name,
 
1634
Create_func_atan::create_native(Session *thd, LEX_STRING name,
1635
1635
                                List<Item> *item_list)
1636
1636
{
1637
1637
  Item* func= NULL;
1668
1668
Create_func_benchmark Create_func_benchmark::s_singleton;
1669
1669
 
1670
1670
Item*
1671
 
Create_func_benchmark::create(THD *thd, Item *arg1, Item *arg2)
 
1671
Create_func_benchmark::create(Session *thd, Item *arg1, Item *arg2)
1672
1672
{
1673
1673
  return new (thd->mem_root) Item_func_benchmark(arg1, arg2);
1674
1674
}
1677
1677
Create_func_bin Create_func_bin::s_singleton;
1678
1678
 
1679
1679
Item*
1680
 
Create_func_bin::create(THD *thd, Item *arg1)
 
1680
Create_func_bin::create(Session *thd, Item *arg1)
1681
1681
{
1682
1682
  Item *i10= new (thd->mem_root) Item_int((int32_t) 10,2);
1683
1683
  Item *i2= new (thd->mem_root) Item_int((int32_t) 2,1);
1688
1688
Create_func_bit_count Create_func_bit_count::s_singleton;
1689
1689
 
1690
1690
Item*
1691
 
Create_func_bit_count::create(THD *thd, Item *arg1)
 
1691
Create_func_bit_count::create(Session *thd, Item *arg1)
1692
1692
{
1693
1693
  return new (thd->mem_root) Item_func_bit_count(arg1);
1694
1694
}
1697
1697
Create_func_bit_length Create_func_bit_length::s_singleton;
1698
1698
 
1699
1699
Item*
1700
 
Create_func_bit_length::create(THD *thd, Item *arg1)
 
1700
Create_func_bit_length::create(Session *thd, Item *arg1)
1701
1701
{
1702
1702
  return new (thd->mem_root) Item_func_bit_length(arg1);
1703
1703
}
1706
1706
Create_func_ceiling Create_func_ceiling::s_singleton;
1707
1707
 
1708
1708
Item*
1709
 
Create_func_ceiling::create(THD *thd, Item *arg1)
 
1709
Create_func_ceiling::create(Session *thd, Item *arg1)
1710
1710
{
1711
1711
  return new (thd->mem_root) Item_func_ceiling(arg1);
1712
1712
}
1715
1715
Create_func_char_length Create_func_char_length::s_singleton;
1716
1716
 
1717
1717
Item*
1718
 
Create_func_char_length::create(THD *thd, Item *arg1)
 
1718
Create_func_char_length::create(Session *thd, Item *arg1)
1719
1719
{
1720
1720
  return new (thd->mem_root) Item_func_char_length(arg1);
1721
1721
}
1724
1724
Create_func_coercibility Create_func_coercibility::s_singleton;
1725
1725
 
1726
1726
Item*
1727
 
Create_func_coercibility::create(THD *thd, Item *arg1)
 
1727
Create_func_coercibility::create(Session *thd, Item *arg1)
1728
1728
{
1729
1729
  return new (thd->mem_root) Item_func_coercibility(arg1);
1730
1730
}
1733
1733
Create_func_concat Create_func_concat::s_singleton;
1734
1734
 
1735
1735
Item*
1736
 
Create_func_concat::create_native(THD *thd, LEX_STRING name,
 
1736
Create_func_concat::create_native(Session *thd, LEX_STRING name,
1737
1737
                                  List<Item> *item_list)
1738
1738
{
1739
1739
  int arg_count= 0;
1754
1754
Create_func_concat_ws Create_func_concat_ws::s_singleton;
1755
1755
 
1756
1756
Item*
1757
 
Create_func_concat_ws::create_native(THD *thd, LEX_STRING name,
 
1757
Create_func_concat_ws::create_native(Session *thd, LEX_STRING name,
1758
1758
                                     List<Item> *item_list)
1759
1759
{
1760
1760
  int arg_count= 0;
1776
1776
Create_func_connection_id Create_func_connection_id::s_singleton;
1777
1777
 
1778
1778
Item*
1779
 
Create_func_connection_id::create(THD *thd)
 
1779
Create_func_connection_id::create(Session *thd)
1780
1780
{
1781
1781
  return new (thd->mem_root) Item_func_connection_id();
1782
1782
}
1785
1785
Create_func_conv Create_func_conv::s_singleton;
1786
1786
 
1787
1787
Item*
1788
 
Create_func_conv::create(THD *thd, Item *arg1, Item *arg2, Item *arg3)
 
1788
Create_func_conv::create(Session *thd, Item *arg1, Item *arg2, Item *arg3)
1789
1789
{
1790
1790
  return new (thd->mem_root) Item_func_conv(arg1, arg2, arg3);
1791
1791
}
1794
1794
Create_func_cos Create_func_cos::s_singleton;
1795
1795
 
1796
1796
Item*
1797
 
Create_func_cos::create(THD *thd, Item *arg1)
 
1797
Create_func_cos::create(Session *thd, Item *arg1)
1798
1798
{
1799
1799
  return new (thd->mem_root) Item_func_cos(arg1);
1800
1800
}
1803
1803
Create_func_cot Create_func_cot::s_singleton;
1804
1804
 
1805
1805
Item*
1806
 
Create_func_cot::create(THD *thd, Item *arg1)
 
1806
Create_func_cot::create(Session *thd, Item *arg1)
1807
1807
{
1808
1808
  Item *i1= new (thd->mem_root) Item_int((char*) "1", 1, 1);
1809
1809
  Item *i2= new (thd->mem_root) Item_func_tan(arg1);
1813
1813
Create_func_date_format Create_func_date_format::s_singleton;
1814
1814
 
1815
1815
Item*
1816
 
Create_func_date_format::create(THD *thd, Item *arg1, Item *arg2)
 
1816
Create_func_date_format::create(Session *thd, Item *arg1, Item *arg2)
1817
1817
{
1818
1818
  return new (thd->mem_root) Item_func_date_format(arg1, arg2, 0);
1819
1819
}
1822
1822
Create_func_datediff Create_func_datediff::s_singleton;
1823
1823
 
1824
1824
Item*
1825
 
Create_func_datediff::create(THD *thd, Item *arg1, Item *arg2)
 
1825
Create_func_datediff::create(Session *thd, Item *arg1, Item *arg2)
1826
1826
{
1827
1827
  Item *i1= new (thd->mem_root) Item_func_to_days(arg1);
1828
1828
  Item *i2= new (thd->mem_root) Item_func_to_days(arg2);
1834
1834
Create_func_dayname Create_func_dayname::s_singleton;
1835
1835
 
1836
1836
Item*
1837
 
Create_func_dayname::create(THD *thd, Item *arg1)
 
1837
Create_func_dayname::create(Session *thd, Item *arg1)
1838
1838
{
1839
1839
  return new (thd->mem_root) Item_func_dayname(arg1);
1840
1840
}
1843
1843
Create_func_dayofmonth Create_func_dayofmonth::s_singleton;
1844
1844
 
1845
1845
Item*
1846
 
Create_func_dayofmonth::create(THD *thd, Item *arg1)
 
1846
Create_func_dayofmonth::create(Session *thd, Item *arg1)
1847
1847
{
1848
1848
  return new (thd->mem_root) Item_func_dayofmonth(arg1);
1849
1849
}
1852
1852
Create_func_dayofweek Create_func_dayofweek::s_singleton;
1853
1853
 
1854
1854
Item*
1855
 
Create_func_dayofweek::create(THD *thd, Item *arg1)
 
1855
Create_func_dayofweek::create(Session *thd, Item *arg1)
1856
1856
{
1857
1857
  return new (thd->mem_root) Item_func_weekday(arg1, 1);
1858
1858
}
1861
1861
Create_func_dayofyear Create_func_dayofyear::s_singleton;
1862
1862
 
1863
1863
Item*
1864
 
Create_func_dayofyear::create(THD *thd, Item *arg1)
 
1864
Create_func_dayofyear::create(Session *thd, Item *arg1)
1865
1865
{
1866
1866
  return new (thd->mem_root) Item_func_dayofyear(arg1);
1867
1867
}
1870
1870
Create_func_degrees Create_func_degrees::s_singleton;
1871
1871
 
1872
1872
Item*
1873
 
Create_func_degrees::create(THD *thd, Item *arg1)
 
1873
Create_func_degrees::create(Session *thd, Item *arg1)
1874
1874
{
1875
1875
  return new (thd->mem_root) Item_func_units((char*) "degrees", arg1,
1876
1876
                                             180/M_PI, 0.0);
1880
1880
Create_func_elt Create_func_elt::s_singleton;
1881
1881
 
1882
1882
Item*
1883
 
Create_func_elt::create_native(THD *thd, LEX_STRING name,
 
1883
Create_func_elt::create_native(Session *thd, LEX_STRING name,
1884
1884
                               List<Item> *item_list)
1885
1885
{
1886
1886
  int arg_count= 0;
1901
1901
Create_func_exp Create_func_exp::s_singleton;
1902
1902
 
1903
1903
Item*
1904
 
Create_func_exp::create(THD *thd, Item *arg1)
 
1904
Create_func_exp::create(Session *thd, Item *arg1)
1905
1905
{
1906
1906
  return new (thd->mem_root) Item_func_exp(arg1);
1907
1907
}
1910
1910
Create_func_export_set Create_func_export_set::s_singleton;
1911
1911
 
1912
1912
Item*
1913
 
Create_func_export_set::create_native(THD *thd, LEX_STRING name,
 
1913
Create_func_export_set::create_native(Session *thd, LEX_STRING name,
1914
1914
                                      List<Item> *item_list)
1915
1915
{
1916
1916
  Item *func= NULL;
1963
1963
Create_func_field Create_func_field::s_singleton;
1964
1964
 
1965
1965
Item*
1966
 
Create_func_field::create_native(THD *thd, LEX_STRING name,
 
1966
Create_func_field::create_native(Session *thd, LEX_STRING name,
1967
1967
                                 List<Item> *item_list)
1968
1968
{
1969
1969
  int arg_count= 0;
1984
1984
Create_func_find_in_set Create_func_find_in_set::s_singleton;
1985
1985
 
1986
1986
Item*
1987
 
Create_func_find_in_set::create(THD *thd, Item *arg1, Item *arg2)
 
1987
Create_func_find_in_set::create(Session *thd, Item *arg1, Item *arg2)
1988
1988
{
1989
1989
  return new (thd->mem_root) Item_func_find_in_set(arg1, arg2);
1990
1990
}
1993
1993
Create_func_floor Create_func_floor::s_singleton;
1994
1994
 
1995
1995
Item*
1996
 
Create_func_floor::create(THD *thd, Item *arg1)
 
1996
Create_func_floor::create(Session *thd, Item *arg1)
1997
1997
{
1998
1998
  return new (thd->mem_root) Item_func_floor(arg1);
1999
1999
}
2002
2002
Create_func_format Create_func_format::s_singleton;
2003
2003
 
2004
2004
Item*
2005
 
Create_func_format::create(THD *thd, Item *arg1, Item *arg2)
 
2005
Create_func_format::create(Session *thd, Item *arg1, Item *arg2)
2006
2006
{
2007
2007
  return new (thd->mem_root) Item_func_format(arg1, arg2);
2008
2008
}
2011
2011
Create_func_found_rows Create_func_found_rows::s_singleton;
2012
2012
 
2013
2013
Item*
2014
 
Create_func_found_rows::create(THD *thd)
 
2014
Create_func_found_rows::create(Session *thd)
2015
2015
{
2016
2016
  thd->lex->set_stmt_unsafe();
2017
2017
  return new (thd->mem_root) Item_func_found_rows();
2021
2021
Create_func_from_days Create_func_from_days::s_singleton;
2022
2022
 
2023
2023
Item*
2024
 
Create_func_from_days::create(THD *thd, Item *arg1)
 
2024
Create_func_from_days::create(Session *thd, Item *arg1)
2025
2025
{
2026
2026
  return new (thd->mem_root) Item_func_from_days(arg1);
2027
2027
}
2030
2030
Create_func_from_unixtime Create_func_from_unixtime::s_singleton;
2031
2031
 
2032
2032
Item*
2033
 
Create_func_from_unixtime::create_native(THD *thd, LEX_STRING name,
 
2033
Create_func_from_unixtime::create_native(Session *thd, LEX_STRING name,
2034
2034
                                         List<Item> *item_list)
2035
2035
{
2036
2036
  Item *func= NULL;
2068
2068
Create_func_greatest Create_func_greatest::s_singleton;
2069
2069
 
2070
2070
Item*
2071
 
Create_func_greatest::create_native(THD *thd, LEX_STRING name,
 
2071
Create_func_greatest::create_native(Session *thd, LEX_STRING name,
2072
2072
                                    List<Item> *item_list)
2073
2073
{
2074
2074
  int arg_count= 0;
2089
2089
Create_func_hex Create_func_hex::s_singleton;
2090
2090
 
2091
2091
Item*
2092
 
Create_func_hex::create(THD *thd, Item *arg1)
 
2092
Create_func_hex::create(Session *thd, Item *arg1)
2093
2093
{
2094
2094
  return new (thd->mem_root) Item_func_hex(arg1);
2095
2095
}
2098
2098
Create_func_ifnull Create_func_ifnull::s_singleton;
2099
2099
 
2100
2100
Item*
2101
 
Create_func_ifnull::create(THD *thd, Item *arg1, Item *arg2)
 
2101
Create_func_ifnull::create(Session *thd, Item *arg1, Item *arg2)
2102
2102
{
2103
2103
  return new (thd->mem_root) Item_func_ifnull(arg1, arg2);
2104
2104
}
2107
2107
Create_func_instr Create_func_instr::s_singleton;
2108
2108
 
2109
2109
Item*
2110
 
Create_func_instr::create(THD *thd, Item *arg1, Item *arg2)
 
2110
Create_func_instr::create(Session *thd, Item *arg1, Item *arg2)
2111
2111
{
2112
2112
  return new (thd->mem_root) Item_func_locate(arg1, arg2);
2113
2113
}
2116
2116
Create_func_isnull Create_func_isnull::s_singleton;
2117
2117
 
2118
2118
Item*
2119
 
Create_func_isnull::create(THD *thd, Item *arg1)
 
2119
Create_func_isnull::create(Session *thd, Item *arg1)
2120
2120
{
2121
2121
  return new (thd->mem_root) Item_func_isnull(arg1);
2122
2122
}
2125
2125
Create_func_last_day Create_func_last_day::s_singleton;
2126
2126
 
2127
2127
Item*
2128
 
Create_func_last_day::create(THD *thd, Item *arg1)
 
2128
Create_func_last_day::create(Session *thd, Item *arg1)
2129
2129
{
2130
2130
  return new (thd->mem_root) Item_func_last_day(arg1);
2131
2131
}
2134
2134
Create_func_last_insert_id Create_func_last_insert_id::s_singleton;
2135
2135
 
2136
2136
Item*
2137
 
Create_func_last_insert_id::create_native(THD *thd, LEX_STRING name,
 
2137
Create_func_last_insert_id::create_native(Session *thd, LEX_STRING name,
2138
2138
                                          List<Item> *item_list)
2139
2139
{
2140
2140
  Item *func= NULL;
2169
2169
Create_func_lcase Create_func_lcase::s_singleton;
2170
2170
 
2171
2171
Item*
2172
 
Create_func_lcase::create(THD *thd, Item *arg1)
 
2172
Create_func_lcase::create(Session *thd, Item *arg1)
2173
2173
{
2174
2174
  return new (thd->mem_root) Item_func_lcase(arg1);
2175
2175
}
2178
2178
Create_func_least Create_func_least::s_singleton;
2179
2179
 
2180
2180
Item*
2181
 
Create_func_least::create_native(THD *thd, LEX_STRING name,
 
2181
Create_func_least::create_native(Session *thd, LEX_STRING name,
2182
2182
                                 List<Item> *item_list)
2183
2183
{
2184
2184
  int arg_count= 0;
2199
2199
Create_func_length Create_func_length::s_singleton;
2200
2200
 
2201
2201
Item*
2202
 
Create_func_length::create(THD *thd, Item *arg1)
 
2202
Create_func_length::create(Session *thd, Item *arg1)
2203
2203
{
2204
2204
  return new (thd->mem_root) Item_func_length(arg1);
2205
2205
}
2208
2208
Create_func_ln Create_func_ln::s_singleton;
2209
2209
 
2210
2210
Item*
2211
 
Create_func_ln::create(THD *thd, Item *arg1)
 
2211
Create_func_ln::create(Session *thd, Item *arg1)
2212
2212
{
2213
2213
  return new (thd->mem_root) Item_func_ln(arg1);
2214
2214
}
2217
2217
Create_func_load_file Create_func_load_file::s_singleton;
2218
2218
 
2219
2219
Item*
2220
 
Create_func_load_file::create(THD *thd, Item *arg1)
 
2220
Create_func_load_file::create(Session *thd, Item *arg1)
2221
2221
{
2222
2222
  return new (thd->mem_root) Item_load_file(arg1);
2223
2223
}
2226
2226
Create_func_locate Create_func_locate::s_singleton;
2227
2227
 
2228
2228
Item*
2229
 
Create_func_locate::create_native(THD *thd, LEX_STRING name,
 
2229
Create_func_locate::create_native(Session *thd, LEX_STRING name,
2230
2230
                                  List<Item> *item_list)
2231
2231
{
2232
2232
  Item *func= NULL;
2267
2267
Create_func_log Create_func_log::s_singleton;
2268
2268
 
2269
2269
Item*
2270
 
Create_func_log::create_native(THD *thd, LEX_STRING name,
 
2270
Create_func_log::create_native(Session *thd, LEX_STRING name,
2271
2271
                               List<Item> *item_list)
2272
2272
{
2273
2273
  Item *func= NULL;
2304
2304
Create_func_log10 Create_func_log10::s_singleton;
2305
2305
 
2306
2306
Item*
2307
 
Create_func_log10::create(THD *thd, Item *arg1)
 
2307
Create_func_log10::create(Session *thd, Item *arg1)
2308
2308
{
2309
2309
  return new (thd->mem_root) Item_func_log10(arg1);
2310
2310
}
2313
2313
Create_func_log2 Create_func_log2::s_singleton;
2314
2314
 
2315
2315
Item*
2316
 
Create_func_log2::create(THD *thd, Item *arg1)
 
2316
Create_func_log2::create(Session *thd, Item *arg1)
2317
2317
{
2318
2318
  return new (thd->mem_root) Item_func_log2(arg1);
2319
2319
}
2322
2322
Create_func_lpad Create_func_lpad::s_singleton;
2323
2323
 
2324
2324
Item*
2325
 
Create_func_lpad::create(THD *thd, Item *arg1, Item *arg2, Item *arg3)
 
2325
Create_func_lpad::create(Session *thd, Item *arg1, Item *arg2, Item *arg3)
2326
2326
{
2327
2327
  return new (thd->mem_root) Item_func_lpad(arg1, arg2, arg3);
2328
2328
}
2331
2331
Create_func_ltrim Create_func_ltrim::s_singleton;
2332
2332
 
2333
2333
Item*
2334
 
Create_func_ltrim::create(THD *thd, Item *arg1)
 
2334
Create_func_ltrim::create(Session *thd, Item *arg1)
2335
2335
{
2336
2336
  return new (thd->mem_root) Item_func_ltrim(arg1);
2337
2337
}
2340
2340
Create_func_makedate Create_func_makedate::s_singleton;
2341
2341
 
2342
2342
Item*
2343
 
Create_func_makedate::create(THD *thd, Item *arg1, Item *arg2)
 
2343
Create_func_makedate::create(Session *thd, Item *arg1, Item *arg2)
2344
2344
{
2345
2345
  return new (thd->mem_root) Item_func_makedate(arg1, arg2);
2346
2346
}
2349
2349
Create_func_maketime Create_func_maketime::s_singleton;
2350
2350
 
2351
2351
Item*
2352
 
Create_func_maketime::create(THD *thd, Item *arg1, Item *arg2, Item *arg3)
 
2352
Create_func_maketime::create(Session *thd, Item *arg1, Item *arg2, Item *arg3)
2353
2353
{
2354
2354
  return new (thd->mem_root) Item_func_maketime(arg1, arg2, arg3);
2355
2355
}
2358
2358
Create_func_make_set Create_func_make_set::s_singleton;
2359
2359
 
2360
2360
Item*
2361
 
Create_func_make_set::create_native(THD *thd, LEX_STRING name,
 
2361
Create_func_make_set::create_native(Session *thd, LEX_STRING name,
2362
2362
                                    List<Item> *item_list)
2363
2363
{
2364
2364
  int arg_count= 0;
2380
2380
Create_func_master_pos_wait Create_func_master_pos_wait::s_singleton;
2381
2381
 
2382
2382
Item*
2383
 
Create_func_master_pos_wait::create_native(THD *thd, LEX_STRING name,
 
2383
Create_func_master_pos_wait::create_native(Session *thd, LEX_STRING name,
2384
2384
                                           List<Item> *item_list)
2385
2385
 
2386
2386
{
2420
2420
Create_func_monthname Create_func_monthname::s_singleton;
2421
2421
 
2422
2422
Item*
2423
 
Create_func_monthname::create(THD *thd, Item *arg1)
 
2423
Create_func_monthname::create(Session *thd, Item *arg1)
2424
2424
{
2425
2425
  return new (thd->mem_root) Item_func_monthname(arg1);
2426
2426
}
2429
2429
Create_func_nullif Create_func_nullif::s_singleton;
2430
2430
 
2431
2431
Item*
2432
 
Create_func_nullif::create(THD *thd, Item *arg1, Item *arg2)
 
2432
Create_func_nullif::create(Session *thd, Item *arg1, Item *arg2)
2433
2433
{
2434
2434
  return new (thd->mem_root) Item_func_nullif(arg1, arg2);
2435
2435
}
2438
2438
Create_func_oct Create_func_oct::s_singleton;
2439
2439
 
2440
2440
Item*
2441
 
Create_func_oct::create(THD *thd, Item *arg1)
 
2441
Create_func_oct::create(Session *thd, Item *arg1)
2442
2442
{
2443
2443
  Item *i10= new (thd->mem_root) Item_int((int32_t) 10,2);
2444
2444
  Item *i8= new (thd->mem_root) Item_int((int32_t) 8,1);
2449
2449
Create_func_ord Create_func_ord::s_singleton;
2450
2450
 
2451
2451
Item*
2452
 
Create_func_ord::create(THD *thd, Item *arg1)
 
2452
Create_func_ord::create(Session *thd, Item *arg1)
2453
2453
{
2454
2454
  return new (thd->mem_root) Item_func_ord(arg1);
2455
2455
}
2458
2458
Create_func_period_add Create_func_period_add::s_singleton;
2459
2459
 
2460
2460
Item*
2461
 
Create_func_period_add::create(THD *thd, Item *arg1, Item *arg2)
 
2461
Create_func_period_add::create(Session *thd, Item *arg1, Item *arg2)
2462
2462
{
2463
2463
  return new (thd->mem_root) Item_func_period_add(arg1, arg2);
2464
2464
}
2467
2467
Create_func_period_diff Create_func_period_diff::s_singleton;
2468
2468
 
2469
2469
Item*
2470
 
Create_func_period_diff::create(THD *thd, Item *arg1, Item *arg2)
 
2470
Create_func_period_diff::create(Session *thd, Item *arg1, Item *arg2)
2471
2471
{
2472
2472
  return new (thd->mem_root) Item_func_period_diff(arg1, arg2);
2473
2473
}
2476
2476
Create_func_pi Create_func_pi::s_singleton;
2477
2477
 
2478
2478
Item*
2479
 
Create_func_pi::create(THD *thd)
 
2479
Create_func_pi::create(Session *thd)
2480
2480
{
2481
2481
  return new (thd->mem_root) Item_static_float_func("pi()", M_PI, 6, 8);
2482
2482
}
2485
2485
Create_func_pow Create_func_pow::s_singleton;
2486
2486
 
2487
2487
Item*
2488
 
Create_func_pow::create(THD *thd, Item *arg1, Item *arg2)
 
2488
Create_func_pow::create(Session *thd, Item *arg1, Item *arg2)
2489
2489
{
2490
2490
  return new (thd->mem_root) Item_func_pow(arg1, arg2);
2491
2491
}
2494
2494
Create_func_quote Create_func_quote::s_singleton;
2495
2495
 
2496
2496
Item*
2497
 
Create_func_quote::create(THD *thd, Item *arg1)
 
2497
Create_func_quote::create(Session *thd, Item *arg1)
2498
2498
{
2499
2499
  return new (thd->mem_root) Item_func_quote(arg1);
2500
2500
}
2503
2503
Create_func_radians Create_func_radians::s_singleton;
2504
2504
 
2505
2505
Item*
2506
 
Create_func_radians::create(THD *thd, Item *arg1)
 
2506
Create_func_radians::create(Session *thd, Item *arg1)
2507
2507
{
2508
2508
  return new (thd->mem_root) Item_func_units((char*) "radians", arg1,
2509
2509
                                             M_PI/180, 0.0);
2513
2513
Create_func_rand Create_func_rand::s_singleton;
2514
2514
 
2515
2515
Item*
2516
 
Create_func_rand::create_native(THD *thd, LEX_STRING name,
 
2516
Create_func_rand::create_native(Session *thd, LEX_STRING name,
2517
2517
                                List<Item> *item_list)
2518
2518
{
2519
2519
  Item *func= NULL;
2548
2548
Create_func_round Create_func_round::s_singleton;
2549
2549
 
2550
2550
Item*
2551
 
Create_func_round::create_native(THD *thd, LEX_STRING name,
 
2551
Create_func_round::create_native(Session *thd, LEX_STRING name,
2552
2552
                                 List<Item> *item_list)
2553
2553
{
2554
2554
  Item *func= NULL;
2586
2586
Create_func_row_count Create_func_row_count::s_singleton;
2587
2587
 
2588
2588
Item*
2589
 
Create_func_row_count::create(THD *thd)
 
2589
Create_func_row_count::create(Session *thd)
2590
2590
{
2591
2591
  thd->lex->set_stmt_unsafe();
2592
2592
  return new (thd->mem_root) Item_func_row_count();
2596
2596
Create_func_rpad Create_func_rpad::s_singleton;
2597
2597
 
2598
2598
Item*
2599
 
Create_func_rpad::create(THD *thd, Item *arg1, Item *arg2, Item *arg3)
 
2599
Create_func_rpad::create(Session *thd, Item *arg1, Item *arg2, Item *arg3)
2600
2600
{
2601
2601
  return new (thd->mem_root) Item_func_rpad(arg1, arg2, arg3);
2602
2602
}
2605
2605
Create_func_rtrim Create_func_rtrim::s_singleton;
2606
2606
 
2607
2607
Item*
2608
 
Create_func_rtrim::create(THD *thd, Item *arg1)
 
2608
Create_func_rtrim::create(Session *thd, Item *arg1)
2609
2609
{
2610
2610
  return new (thd->mem_root) Item_func_rtrim(arg1);
2611
2611
}
2614
2614
Create_func_sec_to_time Create_func_sec_to_time::s_singleton;
2615
2615
 
2616
2616
Item*
2617
 
Create_func_sec_to_time::create(THD *thd, Item *arg1)
 
2617
Create_func_sec_to_time::create(Session *thd, Item *arg1)
2618
2618
{
2619
2619
  return new (thd->mem_root) Item_func_sec_to_time(arg1);
2620
2620
}
2623
2623
Create_func_sign Create_func_sign::s_singleton;
2624
2624
 
2625
2625
Item*
2626
 
Create_func_sign::create(THD *thd, Item *arg1)
 
2626
Create_func_sign::create(Session *thd, Item *arg1)
2627
2627
{
2628
2628
  return new (thd->mem_root) Item_func_sign(arg1);
2629
2629
}
2632
2632
Create_func_sin Create_func_sin::s_singleton;
2633
2633
 
2634
2634
Item*
2635
 
Create_func_sin::create(THD *thd, Item *arg1)
 
2635
Create_func_sin::create(Session *thd, Item *arg1)
2636
2636
{
2637
2637
  return new (thd->mem_root) Item_func_sin(arg1);
2638
2638
}
2641
2641
Create_func_space Create_func_space::s_singleton;
2642
2642
 
2643
2643
Item*
2644
 
Create_func_space::create(THD *thd, Item *arg1)
 
2644
Create_func_space::create(Session *thd, Item *arg1)
2645
2645
{
2646
2646
  /**
2647
2647
    TODO: Fix Bug#23637
2669
2669
Create_func_sqrt Create_func_sqrt::s_singleton;
2670
2670
 
2671
2671
Item*
2672
 
Create_func_sqrt::create(THD *thd, Item *arg1)
 
2672
Create_func_sqrt::create(Session *thd, Item *arg1)
2673
2673
{
2674
2674
  return new (thd->mem_root) Item_func_sqrt(arg1);
2675
2675
}
2678
2678
Create_func_str_to_date Create_func_str_to_date::s_singleton;
2679
2679
 
2680
2680
Item*
2681
 
Create_func_str_to_date::create(THD *thd, Item *arg1, Item *arg2)
 
2681
Create_func_str_to_date::create(Session *thd, Item *arg1, Item *arg2)
2682
2682
{
2683
2683
  return new (thd->mem_root) Item_func_str_to_date(arg1, arg2);
2684
2684
}
2687
2687
Create_func_strcmp Create_func_strcmp::s_singleton;
2688
2688
 
2689
2689
Item*
2690
 
Create_func_strcmp::create(THD *thd, Item *arg1, Item *arg2)
 
2690
Create_func_strcmp::create(Session *thd, Item *arg1, Item *arg2)
2691
2691
{
2692
2692
  return new (thd->mem_root) Item_func_strcmp(arg1, arg2);
2693
2693
}
2696
2696
Create_func_substr_index Create_func_substr_index::s_singleton;
2697
2697
 
2698
2698
Item*
2699
 
Create_func_substr_index::create(THD *thd, Item *arg1, Item *arg2, Item *arg3)
 
2699
Create_func_substr_index::create(Session *thd, Item *arg1, Item *arg2, Item *arg3)
2700
2700
{
2701
2701
  return new (thd->mem_root) Item_func_substr_index(arg1, arg2, arg3);
2702
2702
}
2705
2705
Create_func_subtime Create_func_subtime::s_singleton;
2706
2706
 
2707
2707
Item*
2708
 
Create_func_subtime::create(THD *thd, Item *arg1, Item *arg2)
 
2708
Create_func_subtime::create(Session *thd, Item *arg1, Item *arg2)
2709
2709
{
2710
2710
  return new (thd->mem_root) Item_func_add_time(arg1, arg2, 0, 1);
2711
2711
}
2714
2714
Create_func_tan Create_func_tan::s_singleton;
2715
2715
 
2716
2716
Item*
2717
 
Create_func_tan::create(THD *thd, Item *arg1)
 
2717
Create_func_tan::create(Session *thd, Item *arg1)
2718
2718
{
2719
2719
  return new (thd->mem_root) Item_func_tan(arg1);
2720
2720
}
2723
2723
Create_func_time_format Create_func_time_format::s_singleton;
2724
2724
 
2725
2725
Item*
2726
 
Create_func_time_format::create(THD *thd, Item *arg1, Item *arg2)
 
2726
Create_func_time_format::create(Session *thd, Item *arg1, Item *arg2)
2727
2727
{
2728
2728
  return new (thd->mem_root) Item_func_date_format(arg1, arg2, 1);
2729
2729
}
2732
2732
Create_func_time_to_sec Create_func_time_to_sec::s_singleton;
2733
2733
 
2734
2734
Item*
2735
 
Create_func_time_to_sec::create(THD *thd, Item *arg1)
 
2735
Create_func_time_to_sec::create(Session *thd, Item *arg1)
2736
2736
{
2737
2737
  return new (thd->mem_root) Item_func_time_to_sec(arg1);
2738
2738
}
2741
2741
Create_func_timediff Create_func_timediff::s_singleton;
2742
2742
 
2743
2743
Item*
2744
 
Create_func_timediff::create(THD *thd, Item *arg1, Item *arg2)
 
2744
Create_func_timediff::create(Session *thd, Item *arg1, Item *arg2)
2745
2745
{
2746
2746
  return new (thd->mem_root) Item_func_timediff(arg1, arg2);
2747
2747
}
2750
2750
Create_func_to_days Create_func_to_days::s_singleton;
2751
2751
 
2752
2752
Item*
2753
 
Create_func_to_days::create(THD *thd, Item *arg1)
 
2753
Create_func_to_days::create(Session *thd, Item *arg1)
2754
2754
{
2755
2755
  return new (thd->mem_root) Item_func_to_days(arg1);
2756
2756
}
2759
2759
Create_func_ucase Create_func_ucase::s_singleton;
2760
2760
 
2761
2761
Item*
2762
 
Create_func_ucase::create(THD *thd, Item *arg1)
 
2762
Create_func_ucase::create(Session *thd, Item *arg1)
2763
2763
{
2764
2764
  return new (thd->mem_root) Item_func_ucase(arg1);
2765
2765
}
2768
2768
Create_func_unhex Create_func_unhex::s_singleton;
2769
2769
 
2770
2770
Item*
2771
 
Create_func_unhex::create(THD *thd, Item *arg1)
 
2771
Create_func_unhex::create(Session *thd, Item *arg1)
2772
2772
{
2773
2773
  return new (thd->mem_root) Item_func_unhex(arg1);
2774
2774
}
2777
2777
Create_func_unix_timestamp Create_func_unix_timestamp::s_singleton;
2778
2778
 
2779
2779
Item*
2780
 
Create_func_unix_timestamp::create_native(THD *thd, LEX_STRING name,
 
2780
Create_func_unix_timestamp::create_native(Session *thd, LEX_STRING name,
2781
2781
                                          List<Item> *item_list)
2782
2782
{
2783
2783
  Item *func= NULL;
2812
2812
Create_func_uuid Create_func_uuid::s_singleton;
2813
2813
 
2814
2814
Item*
2815
 
Create_func_uuid::create(THD *thd)
 
2815
Create_func_uuid::create(Session *thd)
2816
2816
{
2817
2817
  thd->lex->set_stmt_unsafe();
2818
2818
  return new (thd->mem_root) Item_func_uuid();
2822
2822
Create_func_version Create_func_version::s_singleton;
2823
2823
 
2824
2824
Item*
2825
 
Create_func_version::create(THD *thd)
 
2825
Create_func_version::create(Session *thd)
2826
2826
{
2827
2827
  return new (thd->mem_root) Item_static_string_func("version()",
2828
2828
                                                     server_version,
2835
2835
Create_func_weekday Create_func_weekday::s_singleton;
2836
2836
 
2837
2837
Item*
2838
 
Create_func_weekday::create(THD *thd, Item *arg1)
 
2838
Create_func_weekday::create(Session *thd, Item *arg1)
2839
2839
{
2840
2840
  return new (thd->mem_root) Item_func_weekday(arg1, 0);
2841
2841
}
2844
2844
Create_func_weekofyear Create_func_weekofyear::s_singleton;
2845
2845
 
2846
2846
Item*
2847
 
Create_func_weekofyear::create(THD *thd, Item *arg1)
 
2847
Create_func_weekofyear::create(Session *thd, Item *arg1)
2848
2848
{
2849
2849
  Item *i1= new (thd->mem_root) Item_int((char*) "0", 3, 1);
2850
2850
  return new (thd->mem_root) Item_func_week(arg1, i1);
2854
2854
Create_func_year_week Create_func_year_week::s_singleton;
2855
2855
 
2856
2856
Item*
2857
 
Create_func_year_week::create_native(THD *thd, LEX_STRING name,
 
2857
Create_func_year_week::create_native(Session *thd, LEX_STRING name,
2858
2858
                                     List<Item> *item_list)
2859
2859
{
2860
2860
  Item *func= NULL;
3064
3064
}
3065
3065
 
3066
3066
Create_func *
3067
 
find_native_function_builder(THD *thd __attribute__((unused)),
 
3067
find_native_function_builder(Session *thd __attribute__((unused)),
3068
3068
                             LEX_STRING name)
3069
3069
{
3070
3070
  Native_func_registry *func;
3085
3085
 
3086
3086
 
3087
3087
Item*
3088
 
create_func_char_cast(THD *thd, Item *a, int len, const CHARSET_INFO * const cs)
 
3088
create_func_char_cast(Session *thd, Item *a, int len, const CHARSET_INFO * const cs)
3089
3089
{
3090
3090
  const CHARSET_INFO * const real_cs= (cs ? cs : thd->variables.collation_connection);
3091
3091
  return new (thd->mem_root) Item_char_typecast(a, len, real_cs);
3093
3093
 
3094
3094
 
3095
3095
Item *
3096
 
create_func_cast(THD *thd, Item *a, Cast_target cast_type,
 
3096
create_func_cast(Session *thd, Item *a, Cast_target cast_type,
3097
3097
                 const char *c_len, const char *c_dec,
3098
3098
                 const CHARSET_INFO * const cs)
3099
3099
{