~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_class.cc

  • Committer: Brian Aker
  • Date: 2008-08-07 16:29:49 UTC
  • mfrom: (264.1.20 codestyle)
  • Revision ID: brian@tangent.org-20080807162949-7o8eyjgdn8ms3n1a
Merge from Monty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
** Especially the classes to handle a result from a select
21
21
**
22
22
*****************************************************************************/
23
 
 
24
 
#ifdef USE_PRAGMA_IMPLEMENTATION
25
 
#pragma implementation                          // gcc: Class implementation
26
 
#endif
27
 
 
28
 
#include "mysql_priv.h"
 
23
#include <drizzled/server_includes.h>
29
24
#include "rpl_rli.h"
30
25
#include "rpl_record.h"
31
 
#include "slave.h"
32
26
#include "log_event.h"
33
27
#include <sys/stat.h>
34
28
#include <mysys/thr_alarm.h>
978
972
        In this case to->str will point to 0 and to->length will be 0.
979
973
*/
980
974
 
981
 
bool THD::convert_string(LEX_STRING *to, CHARSET_INFO *to_cs,
 
975
bool THD::convert_string(LEX_STRING *to, const CHARSET_INFO * const to_cs,
982
976
                         const char *from, uint from_length,
983
 
                         CHARSET_INFO *from_cs)
 
977
                         const CHARSET_INFO * const from_cs)
984
978
{
985
979
  size_t new_length= to_cs->mbmaxlen * from_length;
986
980
  uint dummy_errors;
1011
1005
   !0   out of memory
1012
1006
*/
1013
1007
 
1014
 
bool THD::convert_string(String *s, CHARSET_INFO *from_cs, CHARSET_INFO *to_cs)
 
1008
bool THD::convert_string(String *s, const CHARSET_INFO * const from_cs,
 
1009
                         const CHARSET_INFO * const to_cs)
1015
1010
{
1016
1011
  uint dummy_errors;
1017
1012
  if (convert_buffer.copy(s->ptr(), s->length(), from_cs, to_cs, &dummy_errors))
1128
1123
{
1129
1124
  List<Item> field_list;
1130
1125
  Item *item;
1131
 
  CHARSET_INFO *cs= system_charset_info;
 
1126
  const CHARSET_INFO * const cs= system_charset_info;
1132
1127
  field_list.push_back(new Item_return_int("id",3, DRIZZLE_TYPE_LONGLONG));
1133
1128
  field_list.push_back(new Item_empty_string("select_type", 19, cs));
1134
1129
  field_list.push_back(item= new Item_empty_string("table", NAME_CHAR_LEN, cs));
1659
1654
           escape_char != -1)
1660
1655
      {
1661
1656
        char *pos, *start, *end;
1662
 
        CHARSET_INFO *res_charset= res->charset();
1663
 
        CHARSET_INFO *character_set_client= thd->variables.
1664
 
                                            character_set_client;
 
1657
        const CHARSET_INFO * const res_charset= res->charset();
 
1658
        const CHARSET_INFO * const character_set_client= thd->variables.
 
1659
                                                            character_set_client;
1665
1660
        bool check_second_byte= (res_charset == &my_charset_bin) &&
1666
1661
                                 character_set_client->
1667
1662
                                 escape_with_backslash_is_dangerous;
2310
2305
 
2311
2306
 
2312
2307
#ifdef INNODB_COMPATIBILITY_HOOKS
2313
 
extern "C" struct charset_info_st *thd_charset(MYSQL_THD thd)
 
2308
extern "C" const struct charset_info_st *thd_charset(MYSQL_THD thd)
2314
2309
{
2315
2310
  return(thd->charset());
2316
2311
}