Skip to content

Commit 232f89b

Browse files
committed
merge from trunk main
2 parents 26254b3 + 07936e5 commit 232f89b

164 files changed

Lines changed: 2690 additions & 1544 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

client/mysql.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2000, 2010, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
1111
1212
You should have received a copy of the GNU General Public License
1313
along with this program; if not, write to the Free Software
14-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
14+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
1515

1616
/* mysql command tool
1717
* Commands compatible with mSQL by David J. Hughes
@@ -189,7 +189,7 @@ unsigned short terminal_width= 80;
189189
static char *shared_memory_base_name=0;
190190
#endif
191191
static uint opt_protocol=0;
192-
static CHARSET_INFO *charset_info= &my_charset_latin1;
192+
static const CHARSET_INFO *charset_info= &my_charset_latin1;
193193

194194
#include "sslopt-vars.h"
195195

@@ -2944,7 +2944,7 @@ static int
29442944
com_charset(String *buffer __attribute__((unused)), char *line)
29452945
{
29462946
char buff[256], *param;
2947-
CHARSET_INFO * new_cs;
2947+
const CHARSET_INFO *new_cs;
29482948
strmake(buff, line, sizeof(buff) - 1);
29492949
param= get_arg(buff, 0);
29502950
if (!param || !*param)

client/sql_string.cc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2000 MySQL AB
1+
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
1111
1212
You should have received a copy of the GNU General Public License
1313
along with this program; if not, write to the Free Software
14-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
14+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
1515

1616
/* This file is originally from the mysql distribution. Coded by monty */
1717

@@ -88,7 +88,7 @@ bool String::realloc(uint32 alloc_length)
8888
return FALSE;
8989
}
9090

91-
bool String::set(longlong num, CHARSET_INFO *cs)
91+
bool String::set(longlong num, const CHARSET_INFO *cs)
9292
{
9393
uint l=20*cs->mbmaxlen+1;
9494

@@ -99,7 +99,7 @@ bool String::set(longlong num, CHARSET_INFO *cs)
9999
return FALSE;
100100
}
101101

102-
bool String::set(ulonglong num, CHARSET_INFO *cs)
102+
bool String::set(ulonglong num, const CHARSET_INFO *cs)
103103
{
104104
uint l=20*cs->mbmaxlen+1;
105105

@@ -110,7 +110,7 @@ bool String::set(ulonglong num, CHARSET_INFO *cs)
110110
return FALSE;
111111
}
112112

113-
bool String::set(double num,uint decimals, CHARSET_INFO *cs)
113+
bool String::set(double num,uint decimals, const CHARSET_INFO *cs)
114114
{
115115
char buff[FLOATING_POINT_BUFFER];
116116
uint dummy_errors;
@@ -149,7 +149,7 @@ bool String::copy(const String &str)
149149
return FALSE;
150150
}
151151

152-
bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *cs)
152+
bool String::copy(const char *str,uint32 arg_length, const CHARSET_INFO *cs)
153153
{
154154
if (alloc(arg_length))
155155
return TRUE;
@@ -184,8 +184,8 @@ bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *cs)
184184
*/
185185

186186
bool String::needs_conversion(uint32 arg_length,
187-
CHARSET_INFO *from_cs,
188-
CHARSET_INFO *to_cs,
187+
const CHARSET_INFO *from_cs,
188+
const CHARSET_INFO *to_cs,
189189
uint32 *offset)
190190
{
191191
*offset= 0;
@@ -226,7 +226,7 @@ bool String::needs_conversion(uint32 arg_length,
226226
*/
227227

228228
bool String::copy_aligned(const char *str,uint32 arg_length, uint32 offset,
229-
CHARSET_INFO *cs)
229+
const CHARSET_INFO *cs)
230230
{
231231
/* How many bytes are in incomplete character */
232232
offset= cs->mbmaxlen - offset; /* How many zeros we should prepend */
@@ -252,7 +252,7 @@ bool String::copy_aligned(const char *str,uint32 arg_length, uint32 offset,
252252

253253

254254
bool String::set_or_copy_aligned(const char *str,uint32 arg_length,
255-
CHARSET_INFO *cs)
255+
const CHARSET_INFO *cs)
256256
{
257257
/* How many bytes are in incomplete character */
258258
uint32 offset= (arg_length % cs->mbminlen);
@@ -268,7 +268,7 @@ bool String::set_or_copy_aligned(const char *str,uint32 arg_length,
268268
/* Copy with charset convertion */
269269

270270
bool String::copy(const char *str, uint32 arg_length,
271-
CHARSET_INFO *from_cs, CHARSET_INFO *to_cs, uint *errors)
271+
const CHARSET_INFO *from_cs, const CHARSET_INFO *to_cs, uint *errors)
272272
{
273273
uint32 offset;
274274
if (!needs_conversion(arg_length, from_cs, to_cs, &offset))
@@ -407,7 +407,7 @@ bool String::append(const char *s)
407407
with character set recoding
408408
*/
409409

410-
bool String::append(const char *s,uint32 arg_length, CHARSET_INFO *cs)
410+
bool String::append(const char *s,uint32 arg_length, const CHARSET_INFO *cs)
411411
{
412412
uint32 dummy_offset;
413413

@@ -651,7 +651,7 @@ void String::qs_append(uint i)
651651
*/
652652

653653

654-
int sortcmp(const String *s,const String *t, CHARSET_INFO *cs)
654+
int sortcmp(const String *s,const String *t, const CHARSET_INFO *cs)
655655
{
656656
return cs->coll->strnncollsp(cs,
657657
(unsigned char *) s->ptr(),s->length(),
@@ -756,5 +756,5 @@ void String::swap(String &s)
756756
swap_variables(uint32, str_length, s.str_length);
757757
swap_variables(uint32, Alloced_length, s.Alloced_length);
758758
swap_variables(bool, alloced, s.alloced);
759-
swap_variables(CHARSET_INFO*, str_charset, s.str_charset);
759+
swap_variables(const CHARSET_INFO*, str_charset, s.str_charset);
760760
}

client/sql_string.h

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef CLIENT_SQL_STRING_INCLUDED
22
#define CLIENT_SQL_STRING_INCLUDED
33

4-
/* Copyright (C) 2000 MySQL AB
4+
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
55
66
This program is free software; you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
1414
1515
You should have received a copy of the GNU General Public License
1616
along with this program; if not, write to the Free Software
17-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
17+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
1818

1919
/* This file is originally from the mysql distribution. Coded by monty */
2020

@@ -23,11 +23,12 @@
2323
#endif
2424

2525
class String;
26-
int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
26+
int sortcmp(const String *a,const String *b, const CHARSET_INFO *cs);
2727
String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
28-
inline uint32 copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
28+
inline uint32 copy_and_convert(char *to, uint32 to_length,
29+
const CHARSET_INFO *to_cs,
2930
const char *from, uint32 from_length,
30-
CHARSET_INFO *from_cs, uint *errors)
31+
const CHARSET_INFO *from_cs, uint *errors)
3132
{
3233
return my_convert(to, to_length, to_cs, from, from_length, from_cs, errors);
3334
}
@@ -37,7 +38,7 @@ class String
3738
char *Ptr;
3839
uint32 str_length,Alloced_length;
3940
bool alloced;
40-
CHARSET_INFO *str_charset;
41+
const CHARSET_INFO *str_charset;
4142
public:
4243
String()
4344
{
@@ -49,17 +50,17 @@ class String
4950
alloced=0; Alloced_length=0; (void) real_alloc(length_arg);
5051
str_charset= &my_charset_bin;
5152
}
52-
String(const char *str, CHARSET_INFO *cs)
53+
String(const char *str, const CHARSET_INFO *cs)
5354
{
5455
Ptr=(char*) str; str_length=(uint) strlen(str); Alloced_length=0; alloced=0;
5556
str_charset=cs;
5657
}
57-
String(const char *str,uint32 len, CHARSET_INFO *cs)
58+
String(const char *str,uint32 len, const CHARSET_INFO *cs)
5859
{
5960
Ptr=(char*) str; str_length=len; Alloced_length=0; alloced=0;
6061
str_charset=cs;
6162
}
62-
String(char *str,uint32 len, CHARSET_INFO *cs)
63+
String(char *str,uint32 len, const CHARSET_INFO *cs)
6364
{
6465
Ptr=(char*) str; Alloced_length=str_length=len; alloced=0;
6566
str_charset=cs;
@@ -82,9 +83,9 @@ class String
8283
{ /* never called */ }
8384
~String() { free(); }
8485

85-
inline void set_charset(CHARSET_INFO *charset_arg)
86+
inline void set_charset(const CHARSET_INFO *charset_arg)
8687
{ str_charset= charset_arg; }
87-
inline CHARSET_INFO *charset() const { return str_charset; }
88+
inline const CHARSET_INFO *charset() const { return str_charset; }
8889
inline uint32 length() const { return str_length;}
8990
inline uint32 alloced_length() const { return Alloced_length;}
9091
inline char& operator [] (uint32 i) const { return Ptr[i]; }
@@ -124,30 +125,30 @@ class String
124125
Alloced_length=0;
125126
str_charset=str.str_charset;
126127
}
127-
inline void set(char *str,uint32 arg_length, CHARSET_INFO *cs)
128+
inline void set(char *str,uint32 arg_length, const CHARSET_INFO *cs)
128129
{
129130
free();
130131
Ptr=(char*) str; str_length=Alloced_length=arg_length ; alloced=0;
131132
str_charset=cs;
132133
}
133-
inline void set(const char *str,uint32 arg_length, CHARSET_INFO *cs)
134+
inline void set(const char *str,uint32 arg_length, const CHARSET_INFO *cs)
134135
{
135136
free();
136137
Ptr=(char*) str; str_length=arg_length; Alloced_length=0 ; alloced=0;
137138
str_charset=cs;
138139
}
139140
bool set_ascii(const char *str, uint32 arg_length);
140-
inline void set_quick(char *str,uint32 arg_length, CHARSET_INFO *cs)
141+
inline void set_quick(char *str,uint32 arg_length, const CHARSET_INFO *cs)
141142
{
142143
if (!alloced)
143144
{
144145
Ptr=(char*) str; str_length=Alloced_length=arg_length;
145146
}
146147
str_charset=cs;
147148
}
148-
bool set(longlong num, CHARSET_INFO *cs);
149-
bool set(ulonglong num, CHARSET_INFO *cs);
150-
bool set(double num,uint decimals, CHARSET_INFO *cs);
149+
bool set(longlong num, const CHARSET_INFO *cs);
150+
bool set(ulonglong num, const CHARSET_INFO *cs);
151+
bool set(double num,uint decimals, const CHARSET_INFO *cs);
151152

152153
/*
153154
PMG 2004.11.12
@@ -231,19 +232,21 @@ class String
231232

232233
bool copy(); // Alloc string if not alloced
233234
bool copy(const String &s); // Allocate new string
234-
bool copy(const char *s,uint32 arg_length, CHARSET_INFO *cs); // Allocate new string
235+
/// Allocate new string
236+
bool copy(const char *s,uint32 arg_length, const CHARSET_INFO *cs);
235237
static bool needs_conversion(uint32 arg_length,
236-
CHARSET_INFO *cs_from, CHARSET_INFO *cs_to,
238+
const CHARSET_INFO *cs_from, const CHARSET_INFO *cs_to,
237239
uint32 *offset);
238240
bool copy_aligned(const char *s, uint32 arg_length, uint32 offset,
239-
CHARSET_INFO *cs);
240-
bool set_or_copy_aligned(const char *s, uint32 arg_length, CHARSET_INFO *cs);
241-
bool copy(const char*s,uint32 arg_length, CHARSET_INFO *csfrom,
242-
CHARSET_INFO *csto, uint *errors);
241+
const CHARSET_INFO *cs);
242+
bool set_or_copy_aligned(const char *s, uint32 arg_length,
243+
const CHARSET_INFO *cs);
244+
bool copy(const char*s,uint32 arg_length, const CHARSET_INFO *csfrom,
245+
const CHARSET_INFO *csto, uint *errors);
243246
bool append(const String &s);
244247
bool append(const char *s);
245248
bool append(const char *s,uint32 arg_length);
246-
bool append(const char *s,uint32 arg_length, CHARSET_INFO *cs);
249+
bool append(const char *s,uint32 arg_length, const CHARSET_INFO *cs);
247250
bool append(IO_CACHE* file, uint32 arg_length);
248251
bool append_with_prefill(const char *s, uint32 arg_length,
249252
uint32 full_length, char fill_char);
@@ -267,7 +270,7 @@ class String
267270
}
268271
bool fill(uint32 max_length,char fill);
269272
void strip_sp();
270-
friend int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
273+
friend int sortcmp(const String *a,const String *b, const CHARSET_INFO *cs);
271274
friend int stringcmp(const String *a,const String *b);
272275
friend String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
273276
uint32 numchars();

include/ft_global.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2000-2003 MySQL AB
1+
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
1111
1212
You should have received a copy of the GNU General Public License
1313
along with this program; if not, write to the Free Software
14-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
14+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
1515

1616
/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
1717

@@ -64,7 +64,8 @@ void ft_free_stopwords(void);
6464
#define FT_SORTED 2
6565
#define FT_EXPAND 4 /* query expansion */
6666

67-
FT_INFO *ft_init_search(uint,void *, uint, uchar *, uint,CHARSET_INFO *, uchar *);
67+
FT_INFO *ft_init_search(uint,void *, uint, uchar *, uint,
68+
const CHARSET_INFO *, uchar *);
6869
my_bool ft_boolean_check_syntax_string(const uchar *);
6970

7071
#ifdef __cplusplus

0 commit comments

Comments
 (0)