~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/set_var.h

  • Committer: Monty Taylor
  • Date: 2009-01-28 04:37:46 UTC
  • mto: (779.7.3 devel)
  • mto: This revision was merged to the branch mainline in revision 816.
  • Revision ID: mordred@inaugust.com-20090128043746-d2yukekishwn3ftm
TurnedĀ onĀ -Wshadow.

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
  virtual void set_default(Session *, enum_var_type)
104
104
  {}
105
105
  virtual SHOW_TYPE show_type() { return SHOW_UNDEF; }
106
 
  virtual unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
 
106
  virtual unsigned char *value_ptr(Session *, enum_var_type, const LEX_STRING *)
107
107
  { return 0; }
108
108
  virtual bool check_type(enum_var_type type)
109
109
  { return type != OPT_GLOBAL; }                /* Error if not GLOBAL */
111
111
  { return type != INT_RESULT; }                /* Assume INT */
112
112
  virtual bool check_default(enum_var_type)
113
113
  { return option_limits == 0; }
114
 
  Item *item(Session *session, enum_var_type type, LEX_STRING *base);
 
114
  Item *item(Session *session, enum_var_type type, const LEX_STRING *base);
115
115
  virtual bool is_struct() { return 0; }
116
116
  virtual bool is_readonly() const { return 0; }
117
117
  virtual sys_var_pluginvar *cast_pluginvar() { return 0; }
165
165
  bool update(Session *session, set_var *var);
166
166
  void set_default(Session *session, enum_var_type type);
167
167
  SHOW_TYPE show_type() { return SHOW_LONG; }
168
 
  unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
 
168
  unsigned char *value_ptr(Session *, enum_var_type, const LEX_STRING *)
169
169
  { return (unsigned char*) value; }
170
170
};
171
171
 
198
198
  bool update(Session *session, set_var *var);
199
199
  void set_default(Session *session, enum_var_type type);
200
200
  SHOW_TYPE show_type() { return SHOW_LONG; }
201
 
  unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
 
201
  unsigned char *value_ptr(Session *, enum_var_type, const LEX_STRING *)
202
202
  { return (unsigned char*) value; }
203
203
};
204
204
 
217
217
  bool update(Session *session, set_var *var);
218
218
  void set_default(Session *session, enum_var_type type);
219
219
  SHOW_TYPE show_type() { return SHOW_LONGLONG; }
220
 
  unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
 
220
  unsigned char *value_ptr(Session *, enum_var_type,
 
221
                           const LEX_STRING *)
221
222
  { return (unsigned char*) value; }
222
223
};
223
224
 
235
236
  bool update(Session *session, set_var *var);
236
237
  void set_default(Session *session, enum_var_type type);
237
238
  SHOW_TYPE show_type() { return SHOW_SIZE; }
238
 
  unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
 
239
  unsigned char *value_ptr(Session *, enum_var_type, const LEX_STRING *)
239
240
  { return (unsigned char*) value; }
240
241
};
241
242
 
253
254
  bool update(Session *session, set_var *var);
254
255
  void set_default(Session *session, enum_var_type type);
255
256
  SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
256
 
  unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
 
257
  unsigned char *value_ptr(Session *, enum_var_type, const LEX_STRING *)
257
258
  { return (unsigned char*) value; }
258
259
  bool check_update_type(Item_result)
259
260
  { return 0; }
296
297
    (*set_default_func)(session, type);
297
298
  }
298
299
  SHOW_TYPE show_type() { return SHOW_CHAR; }
299
 
  unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
 
300
  unsigned char *value_ptr(Session *, enum_var_type, const LEX_STRING *)
300
301
  { return (unsigned char*) value; }
301
302
  bool check_update_type(Item_result type)
302
303
  {
328
329
    return 1;
329
330
  }
330
331
  SHOW_TYPE show_type() { return SHOW_CHAR; }
331
 
  unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
 
332
  unsigned char *value_ptr(Session *, enum_var_type, const LEX_STRING *)
332
333
  {
333
334
    return (unsigned char*) value;
334
335
  }
358
359
    return 1;
359
360
  }
360
361
  SHOW_TYPE show_type() { return SHOW_CHAR; }
361
 
  unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
 
362
  unsigned char *value_ptr(Session *, enum_var_type, const LEX_STRING *)
362
363
  {
363
364
    return (unsigned char*) *value;
364
365
  }
387
388
  }
388
389
  bool update(Session *session, set_var *var);
389
390
  SHOW_TYPE show_type() { return SHOW_CHAR; }
390
 
  unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
 
391
  unsigned char *value_ptr(Session *session, enum_var_type type,
 
392
                           const LEX_STRING *base);
391
393
  bool check_update_type(Item_result)
392
394
  { return 0; }
393
395
};
410
412
  bool check_update_type(Item_result)
411
413
  { return 1; }
412
414
  bool is_readonly() const { return 1; }
413
 
  unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
 
415
  unsigned char *value_ptr(Session *session, enum_var_type type,
 
416
                           const LEX_STRING *base);
414
417
};
415
418
 
416
419
 
447
450
  bool update(Session *session, set_var *var);
448
451
  void set_default(Session *session, enum_var_type type);
449
452
  SHOW_TYPE show_type() { return SHOW_LONG; }
450
 
  unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
 
453
  unsigned char *value_ptr(Session *session, enum_var_type type,
 
454
                           const LEX_STRING *base);
451
455
};
452
456
 
453
457
 
467
471
  bool update(Session *session, set_var *var);
468
472
  void set_default(Session *session, enum_var_type type);
469
473
  SHOW_TYPE show_type() { return SHOW_HA_ROWS; }
470
 
  unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
 
474
  unsigned char *value_ptr(Session *session, enum_var_type type,
 
475
                           const LEX_STRING *base);
471
476
};
472
477
 
473
478
 
500
505
  bool update(Session *session, set_var *var);
501
506
  void set_default(Session *session, enum_var_type type);
502
507
  SHOW_TYPE show_type() { return SHOW_LONGLONG; }
503
 
  unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
 
508
  unsigned char *value_ptr(Session *session, enum_var_type type,
 
509
                           const LEX_STRING *base);
504
510
  bool check(Session *session, set_var *var);
505
511
  bool check_default(enum_var_type type)
506
512
  {
541
547
  bool update(Session *session, set_var *var);
542
548
  void set_default(Session *session, enum_var_type type);
543
549
  SHOW_TYPE show_type() { return SHOW_SIZE; }
544
 
  unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
 
550
  unsigned char *value_ptr(Session *session, enum_var_type type,
 
551
                           const LEX_STRING *base);
545
552
  bool check(Session *session, set_var *var);
546
553
  bool check_default(enum_var_type type)
547
554
  {
568
575
  bool update(Session *session, set_var *var);
569
576
  void set_default(Session *session, enum_var_type type);
570
577
  SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
571
 
  unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
 
578
  unsigned char *value_ptr(Session *session, enum_var_type type,
 
579
                           const LEX_STRING *base);
572
580
  bool check(Session *session, set_var *var)
573
581
  {
574
582
    return check_enum(session, var, &bool_typelib);
602
610
  bool update(Session *session, set_var *var);
603
611
  void set_default(Session *session, enum_var_type type);
604
612
  SHOW_TYPE show_type() { return SHOW_CHAR; }
605
 
  unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
 
613
  unsigned char *value_ptr(Session *session, enum_var_type type,
 
614
                           const LEX_STRING *base);
606
615
  bool check_update_type(Item_result)
607
616
  { return 0; }
608
617
};
621
630
    return check_set(session, var, enum_names);
622
631
  }
623
632
  void set_default(Session *session, enum_var_type type);
624
 
  unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
 
633
  unsigned char *value_ptr(Session *session, enum_var_type type,
 
634
                           const LEX_STRING *base);
625
635
  static bool symbolic_mode_representation(Session *session, uint32_t sql_mode,
626
636
                                           LEX_STRING *rep);
627
637
};
644
654
  }
645
655
  void set_default(Session *session, enum_var_type type);
646
656
  bool update(Session *session, set_var *var);
647
 
  unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
 
657
  unsigned char *value_ptr(Session *session, enum_var_type type,
 
658
                           const LEX_STRING *base);
648
659
};
649
660
 
650
661
class sys_var_session_bit :public sys_var_session
667
678
  { return 0; }
668
679
  bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
669
680
  SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
670
 
  unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
 
681
  unsigned char *value_ptr(Session *session, enum_var_type type,
 
682
                           const LEX_STRING *base);
671
683
};
672
684
 
673
685
/* some variables that require special handling */
685
697
  bool check_default(enum_var_type)
686
698
  { return 0; }
687
699
  SHOW_TYPE show_type(void) { return SHOW_LONG; }
688
 
  unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
 
700
  unsigned char *value_ptr(Session *session, enum_var_type type,
 
701
                           const LEX_STRING *base);
689
702
};
690
703
 
691
704
 
699
712
  bool update(Session *session, set_var *var);
700
713
  bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
701
714
  SHOW_TYPE show_type() { return SHOW_LONGLONG; }
702
 
  unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
 
715
  unsigned char *value_ptr(Session *session, enum_var_type type,
 
716
                           const LEX_STRING *base);
703
717
};
704
718
 
705
719
 
736
750
  }
737
751
  bool update(Session *session, set_var *var);
738
752
  void set_default(Session *session, enum_var_type type);
739
 
  unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
 
753
  unsigned char *value_ptr(Session *session, enum_var_type type,
 
754
                           const LEX_STRING *base);
740
755
};
741
756
 
742
757
 
749
764
                          size_t offset_arg)
750
765
    :sys_var(name_arg), offset(offset_arg)
751
766
  { chain_sys_var(chain); }
752
 
  unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
 
767
  unsigned char *value_ptr(Session *session, enum_var_type type,
 
768
                           const LEX_STRING *base);
753
769
  bool check_default(enum_var_type)
754
770
  { return 1; }
755
771
  bool is_struct() { return 1; }
800
816
  bool check(Session *session, set_var *var);
801
817
  bool update(Session *session, set_var *var);
802
818
  void update2(Session *session, enum_var_type type, DATE_TIME_FORMAT *new_value);
803
 
  unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
 
819
  unsigned char *value_ptr(Session *session, enum_var_type type,
 
820
                           const LEX_STRING *base);
804
821
  void set_default(Session *session, enum_var_type type);
805
822
};
806
823
 
826
843
  bool check_type(enum_var_type type) { return type != var_type; }
827
844
  bool check_update_type(Item_result)
828
845
  { return 1; }
829
 
  unsigned char *value_ptr(Session *session, enum_var_type, LEX_STRING *)
 
846
  unsigned char *value_ptr(Session *session, enum_var_type,
 
847
                           const LEX_STRING *)
830
848
  {
831
849
    return (*value_ptr_func)(session);
832
850
  }
843
861
  sys_var_have_option(sys_var_chain *chain, const char *variable_name):
844
862
    sys_var(variable_name)
845
863
  { chain_sys_var(chain); }
846
 
  unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
 
864
  unsigned char *value_ptr(Session *, enum_var_type,
 
865
                           const LEX_STRING *)
847
866
  {
848
867
    return (unsigned char*) show_comp_option_name[get_option()];
849
868
  }
909
928
  bool check_default(enum_var_type)
910
929
  { return 0; }
911
930
  bool update(Session *session, set_var *var);
912
 
  unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
 
931
  unsigned char *value_ptr(Session *session, enum_var_type type,
 
932
                           const LEX_STRING *base);
913
933
  virtual void set_default(Session *session, enum_var_type type);
914
934
};
915
935
 
930
950
  {
931
951
    return (type != INT_RESULT && type != REAL_RESULT && type != DECIMAL_RESULT);
932
952
  }
933
 
  unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
 
953
  unsigned char *value_ptr(Session *session, enum_var_type type,
 
954
                           const LEX_STRING *base);
934
955
};
935
956
 
936
957
class sys_var_session_lc_time_names :public sys_var_session
951
972
  bool check_default(enum_var_type)
952
973
  { return 0; }
953
974
  bool update(Session *session, set_var *var);
954
 
  unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
 
975
  unsigned char *value_ptr(Session *session, enum_var_type type,
 
976
                           const LEX_STRING *base);
955
977
  virtual void set_default(Session *session, enum_var_type type);
956
978
};
957
979
 
1090
1112
extern sys_var_str sys_var_general_log_path, sys_var_slow_log_path;
1091
1113
 
1092
1114
/* key_cache functions */
1093
 
KEY_CACHE *get_key_cache(LEX_STRING *cache_name);
 
1115
KEY_CACHE *get_key_cache(const LEX_STRING *cache_name);
1094
1116
KEY_CACHE *get_or_create_key_cache(const char *name, uint32_t length);
1095
1117
void free_key_cache(const char *name, KEY_CACHE *key_cache);
1096
1118
bool process_key_caches(process_key_cache_t func);