Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
5931e8b1
Commit
5931e8b1
authored
Mar 03, 2003
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge work.mysql.com:/home/bk/mysql-4.1
into myvenu.com:/home/venu/work/sql/dev-4.1
parents
8fed78b6
c68620e6
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
133 additions
and
123 deletions
+133
-123
bdb/os_win32/os_rename.c
bdb/os_win32/os_rename.c
+5
-2
sql/item.cc
sql/item.cc
+10
-10
sql/item.h
sql/item.h
+5
-5
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+2
-2
sql/item_func.cc
sql/item_func.cc
+26
-21
sql/item_func.h
sql/item_func.h
+2
-1
sql/item_strfunc.cc
sql/item_strfunc.cc
+6
-6
sql/item_strfunc.h
sql/item_strfunc.h
+6
-6
sql/item_subselect.cc
sql/item_subselect.cc
+2
-2
sql/item_sum.cc
sql/item_sum.cc
+9
-9
sql/item_timefunc.cc
sql/item_timefunc.cc
+14
-14
sql/item_timefunc.h
sql/item_timefunc.h
+39
-39
sql/log_event.cc
sql/log_event.cc
+1
-1
sql/procedure.h
sql/procedure.h
+5
-5
sql/sql_class.h
sql/sql_class.h
+1
-0
No files found.
bdb/os_win32/os_rename.c
View file @
5931e8b1
...
...
@@ -47,8 +47,11 @@ __os_rename(dbenv, oldname, newname, flags)
* There is no MoveFileEx for Win9x/Me, so we have to
* do the best we can.
*/
if
(
!
GetLongPathName
(
oldname
,
oldbuf
,
sizeof
oldbuf
)
||
!
GetLongPathName
(
newname
,
newbuf
,
sizeof
newbuf
))
{
LPTSTR
FilePath
;
if
(
!
GetFullPathName
(
oldname
,
sizeof
(
oldbuf
),
oldbuf
,
&
FilePath
)
||
!
GetFullPathName
(
newname
,
sizeof
(
newbuf
),
newbuf
,
&
FilePath
))
{
ret
=
__os_win32_errno
();
goto
done
;
}
...
...
sql/item.cc
View file @
5931e8b1
...
...
@@ -163,9 +163,9 @@ bool Item::get_time(TIME *ltime)
return
0
;
}
CHARSET_INFO
*
Item
::
thd
_charset
()
const
CHARSET_INFO
*
Item
::
default
_charset
()
const
{
return
current_thd
->
variables
.
thd
_charset
;
return
current_thd
->
db
_charset
;
}
Item_field
::
Item_field
(
Field
*
f
)
:
Item_ident
(
NullS
,
f
->
table_name
,
f
->
field_name
)
...
...
@@ -303,7 +303,7 @@ Item *Item_field::get_tmp_table_item(THD *thd)
String
*
Item_int
::
val_str
(
String
*
str
)
{
str
->
set
(
value
,
thd
_charset
());
str
->
set
(
value
,
default
_charset
());
return
str
;
}
...
...
@@ -311,7 +311,7 @@ void Item_int::print(String *str)
{
if
(
!
name
)
{
str_value
.
set
(
value
,
thd
_charset
());
str_value
.
set
(
value
,
default
_charset
());
name
=
str_value
.
c_ptr
();
}
str
->
append
(
name
);
...
...
@@ -319,7 +319,7 @@ void Item_int::print(String *str)
String
*
Item_uint
::
val_str
(
String
*
str
)
{
str
->
set
((
ulonglong
)
value
,
thd
_charset
());
str
->
set
((
ulonglong
)
value
,
default
_charset
());
return
str
;
}
...
...
@@ -327,7 +327,7 @@ void Item_uint::print(String *str)
{
if
(
!
name
)
{
str_value
.
set
((
ulonglong
)
value
,
thd
_charset
());
str_value
.
set
((
ulonglong
)
value
,
default
_charset
());
name
=
str_value
.
c_ptr
();
}
str
->
append
(
name
);
...
...
@@ -336,7 +336,7 @@ void Item_uint::print(String *str)
String
*
Item_real
::
val_str
(
String
*
str
)
{
str
->
set
(
value
,
decimals
,
thd
_charset
());
str
->
set
(
value
,
decimals
,
default
_charset
());
return
str
;
}
...
...
@@ -377,7 +377,7 @@ void Item_param::set_double(double value)
void
Item_param
::
set_value
(
const
char
*
str
,
uint
length
)
{
str_value
.
set
(
str
,
length
,
thd
_charset
());
str_value
.
set
(
str
,
length
,
default
_charset
());
item_type
=
STRING_ITEM
;
}
...
...
@@ -474,10 +474,10 @@ String *Item_param::val_str(String* str)
{
switch
(
item_result_type
)
{
case
INT_RESULT
:
str
->
set
(
int_value
,
thd
_charset
());
str
->
set
(
int_value
,
default
_charset
());
return
str
;
case
REAL_RESULT
:
str
->
set
(
real_value
,
2
,
thd
_charset
());
str
->
set
(
real_value
,
2
,
default
_charset
());
return
str
;
default:
return
(
String
*
)
&
str_value
;
...
...
sql/item.h
View file @
5931e8b1
...
...
@@ -39,8 +39,8 @@ public:
SUBSELECT_ITEM
,
ROW_ITEM
,
CACHE_ITEM
};
enum
cond_result
{
COND_UNDEF
,
COND_OK
,
COND_TRUE
,
COND_FALSE
};
enum
coercion
{
COER_NOCOLL
=
0
,
COER_COERCIBLE
=
1
,
COER_IMPLICIT
=
2
,
COER_EXPLICIT
=
3
};
enum
coercion
{
COER_NOCOLL
=
3
,
COER_COERCIBLE
=
2
,
COER_IMPLICIT
=
1
,
COER_EXPLICIT
=
0
};
String
str_value
;
/* used to store value */
my_string
name
;
/* Name from select */
...
...
@@ -110,7 +110,7 @@ public:
virtual
bool
binary
()
const
{
return
str_value
.
charset
()
->
state
&
MY_CS_BINSORT
?
1
:
0
;
}
CHARSET_INFO
*
thd
_charset
()
const
;
CHARSET_INFO
*
default
_charset
()
const
;
CHARSET_INFO
*
charset
()
const
{
return
str_value
.
charset
();
};
void
set_charset
(
CHARSET_INFO
*
cs
)
{
str_value
.
set_charset
(
cs
);
}
virtual
void
set_outer_resolving
()
{}
...
...
@@ -773,7 +773,7 @@ public:
}
double
val
()
{
return
(
double
)
value
;
}
longlong
val_int
()
{
return
value
;
}
String
*
val_str
(
String
*
str
)
{
str
->
set
(
value
,
thd
_charset
());
return
str
;
}
String
*
val_str
(
String
*
str
)
{
str
->
set
(
value
,
default
_charset
());
return
str
;
}
enum
Item_result
result_type
()
const
{
return
INT_RESULT
;
}
};
...
...
@@ -792,7 +792,7 @@ public:
longlong
val_int
()
{
return
(
longlong
)
(
value
+
(
value
>
0
?
0.5
:
-
0.5
));
}
String
*
val_str
(
String
*
str
)
{
str
->
set
(
value
,
decimals
,
thd
_charset
());
str
->
set
(
value
,
decimals
,
default
_charset
());
return
str
;
}
enum
Item_result
result_type
()
const
{
return
REAL_RESULT
;
}
...
...
sql/item_cmpfunc.cc
View file @
5931e8b1
...
...
@@ -873,7 +873,7 @@ String *Item_func_case::val_str(String *str)
longlong
Item_func_case
::
val_int
()
{
char
buff
[
MAX_FIELD_WIDTH
];
String
dummy_str
(
buff
,
sizeof
(
buff
),
thd
_charset
());
String
dummy_str
(
buff
,
sizeof
(
buff
),
default
_charset
());
Item
*
item
=
find_item
(
&
dummy_str
);
longlong
res
;
...
...
@@ -890,7 +890,7 @@ longlong Item_func_case::val_int()
double
Item_func_case
::
val
()
{
char
buff
[
MAX_FIELD_WIDTH
];
String
dummy_str
(
buff
,
sizeof
(
buff
),
thd
_charset
());
String
dummy_str
(
buff
,
sizeof
(
buff
),
default
_charset
());
Item
*
item
=
find_item
(
&
dummy_str
);
double
res
;
...
...
sql/item_func.cc
View file @
5931e8b1
...
...
@@ -132,7 +132,7 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
coercibility
=
(
*
arg
)
->
coercibility
;
set_charset
((
*
arg
)
->
charset
());
}
else
if
((
*
arg
)
->
coercibility
>
coercibility
)
else
if
((
*
arg
)
->
coercibility
<
coercibility
)
{
if
(
strcmp
(
charset
()
->
csname
,(
*
arg
)
->
charset
()
->
csname
))
{
...
...
@@ -286,7 +286,7 @@ String *Item_real_func::val_str(String *str)
if
(
null_value
)
return
0
;
/* purecov: inspected */
else
str
->
set
(
nr
,
decimals
,
thd
_charset
());
str
->
set
(
nr
,
decimals
,
default
_charset
());
return
str
;
}
...
...
@@ -299,9 +299,9 @@ String *Item_num_func::val_str(String *str)
if
(
null_value
)
return
0
;
/* purecov: inspected */
else
if
(
!
unsigned_flag
)
str
->
set
(
nr
,
thd
_charset
());
str
->
set
(
nr
,
default
_charset
());
else
str
->
set
((
ulonglong
)
nr
,
thd
_charset
());
str
->
set
((
ulonglong
)
nr
,
default
_charset
());
}
else
{
...
...
@@ -309,7 +309,7 @@ String *Item_num_func::val_str(String *str)
if
(
null_value
)
return
0
;
/* purecov: inspected */
else
str
->
set
(
nr
,
decimals
,
thd
_charset
());
str
->
set
(
nr
,
decimals
,
default
_charset
());
}
return
str
;
}
...
...
@@ -336,9 +336,9 @@ String *Item_int_func::val_str(String *str)
if
(
null_value
)
return
0
;
else
if
(
!
unsigned_flag
)
str
->
set
(
nr
,
thd
_charset
());
str
->
set
(
nr
,
default
_charset
());
else
str
->
set
((
ulonglong
)
nr
,
thd
_charset
());
str
->
set
((
ulonglong
)
nr
,
default
_charset
());
return
str
;
}
...
...
@@ -365,9 +365,9 @@ String *Item_num_op::val_str(String *str)
if
(
null_value
)
return
0
;
/* purecov: inspected */
else
if
(
!
unsigned_flag
)
str
->
set
(
nr
,
thd
_charset
());
str
->
set
(
nr
,
default
_charset
());
else
str
->
set
((
ulonglong
)
nr
,
thd
_charset
());
str
->
set
((
ulonglong
)
nr
,
default
_charset
());
}
else
{
...
...
@@ -375,7 +375,7 @@ String *Item_num_op::val_str(String *str)
if
(
null_value
)
return
0
;
/* purecov: inspected */
else
str
->
set
(
nr
,
decimals
,
thd
_charset
());
str
->
set
(
nr
,
decimals
,
default
_charset
());
}
return
str
;
}
...
...
@@ -890,9 +890,9 @@ String *Item_func_min_max::val_str(String *str)
if
(
null_value
)
return
0
;
else
if
(
!
unsigned_flag
)
str
->
set
(
nr
,
thd
_charset
());
str
->
set
(
nr
,
default
_charset
());
else
str
->
set
((
ulonglong
)
nr
,
thd
_charset
());
str
->
set
((
ulonglong
)
nr
,
default
_charset
());
return
str
;
}
case
REAL_RESULT
:
...
...
@@ -901,7 +901,7 @@ String *Item_func_min_max::val_str(String *str)
if
(
null_value
)
return
0
;
/* purecov: inspected */
else
str
->
set
(
nr
,
decimals
,
thd
_charset
());
str
->
set
(
nr
,
decimals
,
default
_charset
());
return
str
;
}
case
STRING_RESULT
:
...
...
@@ -1563,7 +1563,7 @@ String *Item_func_udf_float::val_str(String *str)
if
(
null_value
)
return
0
;
/* purecov: inspected */
else
str
->
set
(
nr
,
decimals
,
thd
_charset
());
str
->
set
(
nr
,
decimals
,
default
_charset
());
return
str
;
}
...
...
@@ -1584,9 +1584,9 @@ String *Item_func_udf_int::val_str(String *str)
if
(
null_value
)
return
0
;
else
if
(
!
unsigned_flag
)
str
->
set
(
nr
,
thd
_charset
());
str
->
set
(
nr
,
default
_charset
());
else
str
->
set
((
ulonglong
)
nr
,
thd
_charset
());
str
->
set
((
ulonglong
)
nr
,
default
_charset
());
return
str
;
}
...
...
@@ -2007,6 +2007,7 @@ static user_var_entry *get_variable(HASH *hash, LEX_STRING &name,
}
bool
Item_func_set_user_var
::
fix_fields
(
THD
*
thd
,
TABLE_LIST
*
tables
,
Item
**
ref
)
{
...
...
@@ -2030,7 +2031,8 @@ Item_func_set_user_var::fix_length_and_dec()
void
Item_func_set_user_var
::
update_hash
(
void
*
ptr
,
uint
length
,
Item_result
type
,
CHARSET_INFO
*
cs
)
CHARSET_INFO
*
cs
,
enum
coercion
coercibility
)
{
if
((
null_value
=
args
[
0
]
->
null_value
))
{
...
...
@@ -2040,6 +2042,7 @@ void Item_func_set_user_var::update_hash(void *ptr, uint length,
entry
->
value
=
0
;
entry
->
length
=
0
;
entry
->
var_charset
=
cs
;
entry
->
var_coercibility
=
coercibility
;
}
else
{
...
...
@@ -2071,6 +2074,7 @@ void Item_func_set_user_var::update_hash(void *ptr, uint length,
entry
->
length
=
length
;
entry
->
type
=
type
;
entry
->
var_charset
=
cs
;
entry
->
var_coercibility
=
coercibility
;
}
return
;
...
...
@@ -2112,7 +2116,8 @@ double
Item_func_set_user_var
::
val
()
{
double
value
=
args
[
0
]
->
val
();
update_hash
((
void
*
)
&
value
,
sizeof
(
value
),
REAL_RESULT
,
default_charset_info
);
update_hash
((
void
*
)
&
value
,
sizeof
(
value
),
REAL_RESULT
,
&
my_charset_bin
,
COER_NOCOLL
);
return
value
;
}
...
...
@@ -2121,7 +2126,7 @@ Item_func_set_user_var::val_int()
{
longlong
value
=
args
[
0
]
->
val_int
();
update_hash
((
void
*
)
&
value
,
sizeof
(
longlong
),
INT_RESULT
,
default_charset_info
);
&
my_charset_bin
,
COER_NOCOLL
);
return
value
;
}
...
...
@@ -2130,10 +2135,10 @@ Item_func_set_user_var::val_str(String *str)
{
String
*
res
=
args
[
0
]
->
val_str
(
str
);
if
(
!
res
)
// Null value
update_hash
((
void
*
)
0
,
0
,
STRING_RESULT
,
&
my_charset_bin
);
update_hash
((
void
*
)
0
,
0
,
STRING_RESULT
,
&
my_charset_bin
,
COER_NOCOLL
);
else
update_hash
((
void
*
)
res
->
ptr
(),
res
->
length
(),
STRING_RESULT
,
res
->
charset
());
res
->
charset
()
,
args
[
0
]
->
coercibility
);
return
res
;
}
...
...
sql/item_func.h
View file @
5931e8b1
...
...
@@ -934,7 +934,8 @@ public:
double
val
();
longlong
val_int
();
String
*
val_str
(
String
*
str
);
void
update_hash
(
void
*
ptr
,
uint
length
,
enum
Item_result
type
,
CHARSET_INFO
*
cs
);
void
update_hash
(
void
*
ptr
,
uint
length
,
enum
Item_result
type
,
CHARSET_INFO
*
cs
,
enum
coercion
coercibility
);
bool
update
();
enum
Item_result
result_type
()
const
{
return
cached_result_type
;
}
bool
fix_fields
(
THD
*
thd
,
struct
st_table_list
*
tables
,
Item
**
ref
);
...
...
sql/item_strfunc.cc
View file @
5931e8b1
...
...
@@ -1429,14 +1429,14 @@ String *Item_func_database::val_str(String *str)
str
->
length
(
0
);
else
str
->
copy
((
const
char
*
)
thd
->
db
,(
uint
)
strlen
(
thd
->
db
),
system_charset_info
,
thd
->
variables
.
thd_charset
);
system_charset_info
,
default_charset
()
);
return
str
;
}
String
*
Item_func_user
::
val_str
(
String
*
str
)
{
THD
*
thd
=
current_thd
;
CHARSET_INFO
*
cs
=
thd
->
variables
.
thd_charset
;
CHARSET_INFO
*
cs
=
default_charset
()
;
const
char
*
host
=
thd
->
host
?
thd
->
host
:
thd
->
ip
?
thd
->
ip
:
""
;
uint32
res_length
=
(
strlen
(
thd
->
user
)
+
strlen
(
host
)
+
10
)
*
cs
->
mbmaxlen
;
...
...
@@ -1543,7 +1543,7 @@ String *Item_func_format::val_str(String *str)
if
((
null_value
=
args
[
0
]
->
null_value
))
return
0
;
/* purecov: inspected */
dec
=
decimals
?
decimals
+
1
:
0
;
str
->
set
(
nr
,
decimals
,
thd
_charset
());
str
->
set
(
nr
,
decimals
,
default
_charset
());
str_length
=
str
->
length
();
if
(
nr
<
0
)
str_length
--
;
// Don't count sign
...
...
@@ -2007,7 +2007,7 @@ String *Item_func_conv::val_str(String *str)
else
dec
=
(
longlong
)
my_strntoull
(
res
->
charset
(),
res
->
ptr
(),
res
->
length
(),
from_base
,
&
endptr
,
&
err
);
ptr
=
longlong2str
(
dec
,
ans
,
to_base
);
if
(
str
->
copy
(
ans
,(
uint32
)
(
ptr
-
ans
),
thd
_charset
()))
if
(
str
->
copy
(
ans
,(
uint32
)
(
ptr
-
ans
),
default
_charset
()))
return
&
empty_string
;
return
str
;
}
...
...
@@ -2242,7 +2242,7 @@ String *Item_func_charset::val_str(String *str)
if
((
null_value
=
(
args
[
0
]
->
null_value
||
!
res
->
charset
())))
return
0
;
str
->
copy
(
res
->
charset
()
->
csname
,
strlen
(
res
->
charset
()
->
csname
),
&
my_charset_latin1
,
thd
_charset
());
&
my_charset_latin1
,
default
_charset
());
return
str
;
}
...
...
@@ -2253,7 +2253,7 @@ String *Item_func_collation::val_str(String *str)
if
((
null_value
=
(
args
[
0
]
->
null_value
||
!
res
->
charset
())))
return
0
;
str
->
copy
(
res
->
charset
()
->
name
,
strlen
(
res
->
charset
()
->
name
),
&
my_charset_latin1
,
thd
_charset
());
&
my_charset_latin1
,
default
_charset
());
return
str
;
}
...
...
sql/item_strfunc.h
View file @
5931e8b1
...
...
@@ -333,8 +333,8 @@ public:
String
*
val_str
(
String
*
);
void
fix_length_and_dec
()
{
max_length
=
MAX_FIELD_NAME
*
thd
_charset
()
->
mbmaxlen
;
set_charset
(
thd
_charset
());
max_length
=
MAX_FIELD_NAME
*
default
_charset
()
->
mbmaxlen
;
set_charset
(
default
_charset
());
}
const
char
*
func_name
()
const
{
return
"database"
;
}
};
...
...
@@ -346,8 +346,8 @@ public:
String
*
val_str
(
String
*
);
void
fix_length_and_dec
()
{
max_length
=
(
USERNAME_LENGTH
+
HOSTNAME_LENGTH
+
1
)
*
thd
_charset
()
->
mbmaxlen
;
set_charset
(
thd
_charset
());
max_length
=
(
USERNAME_LENGTH
+
HOSTNAME_LENGTH
+
1
)
*
default
_charset
()
->
mbmaxlen
;
set_charset
(
default
_charset
());
}
const
char
*
func_name
()
const
{
return
"user"
;
}
};
...
...
@@ -612,7 +612,7 @@ public:
void
fix_length_and_dec
()
{
max_length
=
40
;
// should be enough
set_charset
(
thd
_charset
());
set_charset
(
default
_charset
());
};
};
...
...
@@ -625,7 +625,7 @@ public:
void
fix_length_and_dec
()
{
max_length
=
40
;
// should be enough
set_charset
(
thd
_charset
());
set_charset
(
default
_charset
());
};
};
...
...
sql/item_subselect.cc
View file @
5931e8b1
...
...
@@ -372,7 +372,7 @@ String *Item_exists_subselect::val_str(String *str)
reset
();
return
0
;
}
str
->
set
(
value
,
thd
_charset
());
str
->
set
(
value
,
default
_charset
());
return
str
;
}
...
...
@@ -415,7 +415,7 @@ String *Item_in_subselect::val_str(String *str)
null_value
=
1
;
return
0
;
}
str
->
set
(
value
,
thd
_charset
());
str
->
set
(
value
,
default
_charset
());
return
str
;
}
...
...
sql/item_sum.cc
View file @
5931e8b1
...
...
@@ -124,7 +124,7 @@ Item_sum_num::val_str(String *str)
double
nr
=
val
();
if
(
null_value
)
return
0
;
str
->
set
(
nr
,
decimals
,
thd
_charset
());
str
->
set
(
nr
,
decimals
,
default
_charset
());
return
str
;
}
...
...
@@ -135,7 +135,7 @@ Item_sum_int::val_str(String *str)
longlong
nr
=
val_int
();
if
(
null_value
)
return
0
;
str
->
set
(
nr
,
thd
_charset
());
str
->
set
(
nr
,
default
_charset
());
return
str
;
}
...
...
@@ -416,13 +416,13 @@ Item_sum_hybrid::val_str(String *str)
case
STRING_RESULT
:
return
&
value
;
case
REAL_RESULT
:
str
->
set
(
sum
,
decimals
,
thd
_charset
());
str
->
set
(
sum
,
decimals
,
default
_charset
());
break
;
case
INT_RESULT
:
if
(
unsigned_flag
)
str
->
set
((
ulonglong
)
sum_int
,
thd
_charset
());
str
->
set
((
ulonglong
)
sum_int
,
default
_charset
());
else
str
->
set
((
longlong
)
sum_int
,
thd
_charset
());
str
->
set
((
longlong
)
sum_int
,
default
_charset
());
break
;
case
ROW_RESULT
:
default:
...
...
@@ -879,7 +879,7 @@ String *Item_avg_field::val_str(String *str)
double
nr
=
Item_avg_field
::
val
();
if
(
null_value
)
return
0
;
str
->
set
(
nr
,
decimals
,
thd
_charset
());
str
->
set
(
nr
,
decimals
,
default
_charset
());
return
str
;
}
...
...
@@ -927,7 +927,7 @@ String *Item_variance_field::val_str(String *str)
double
nr
=
val
();
if
(
null_value
)
return
0
;
str
->
set
(
nr
,
decimals
,
thd
_charset
());
str
->
set
(
nr
,
decimals
,
default
_charset
());
return
str
;
}
...
...
@@ -1281,7 +1281,7 @@ String *Item_sum_udf_float::val_str(String *str)
if
(
null_value
)
return
0
;
/* purecov: inspected */
else
str
->
set
(
nr
,
decimals
,
thd
_charset
());
str
->
set
(
nr
,
decimals
,
default
_charset
());
return
str
;
}
...
...
@@ -1300,7 +1300,7 @@ String *Item_sum_udf_int::val_str(String *str)
if
(
null_value
)
return
0
;
else
str
->
set
(
nr
,
thd
_charset
());
str
->
set
(
nr
,
default
_charset
());
return
str
;
}
...
...
sql/item_timefunc.cc
View file @
5931e8b1
...
...
@@ -162,7 +162,7 @@ String* Item_func_monthname::val_str(String* str)
null_value
=
0
;
String
*
m
=&
month_names
[
month
-
1
];
str
->
copy
(
m
->
ptr
(),
m
->
length
(),
m
->
charset
(),
thd
_charset
());
str
->
copy
(
m
->
ptr
(),
m
->
length
(),
m
->
charset
(),
default
_charset
());
return
str
;
}
...
...
@@ -252,7 +252,7 @@ String* Item_func_dayname::val_str(String* str)
return
(
String
*
)
0
;
String
*
d
=&
day_names
[
weekday
];
str
->
copy
(
d
->
ptr
(),
d
->
length
(),
d
->
charset
(),
thd
_charset
());
str
->
copy
(
d
->
ptr
(),
d
->
length
(),
d
->
charset
(),
default
_charset
());
return
str
;
}
...
...
@@ -416,7 +416,7 @@ String *Item_date::val_str(String *str)
return
(
String
*
)
0
;
if
(
!
value
)
// zero daynr
{
str
->
copy
(
"0000-00-00"
,
10
,
&
my_charset_latin1
,
thd
_charset
());
str
->
copy
(
"0000-00-00"
,
10
,
&
my_charset_latin1
,
default
_charset
());
return
str
;
}
...
...
@@ -425,7 +425,7 @@ String *Item_date::val_str(String *str)
(
int
)
(
value
/
10000L
)
%
10000
,
(
int
)
(
value
/
100
)
%
100
,
(
int
)
(
value
%
100
));
str
->
copy
(
tmpbuff
,
10
,
&
my_charset_latin1
,
thd
_charset
());
str
->
copy
(
tmpbuff
,
10
,
&
my_charset_latin1
,
default
_charset
());
return
str
;
}
...
...
@@ -463,9 +463,9 @@ void Item_func_curdate::fix_length_and_dec()
struct
tm
tm_tmp
,
*
start
;
time_t
query_start
=
current_thd
->
query_start
();
set_charset
(
thd
_charset
());
set_charset
(
default
_charset
());
decimals
=
0
;
max_length
=
10
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
10
*
default
_charset
()
->
mbmaxlen
;
localtime_r
(
&
query_start
,
&
tm_tmp
);
start
=&
tm_tmp
;
value
=
(
longlong
)
((
ulong
)
((
uint
)
start
->
tm_year
+
1900
)
*
10000L
+
...
...
@@ -492,7 +492,7 @@ bool Item_func_curdate::get_date(TIME *res,
String
*
Item_func_curtime
::
val_str
(
String
*
str
)
{
str_value
.
set
(
buff
,
buff_length
,
thd
_charset
());
str_value
.
set
(
buff
,
buff_length
,
default
_charset
());
return
&
str_value
;
}
...
...
@@ -500,7 +500,7 @@ void Item_func_curtime::fix_length_and_dec()
{
struct
tm
tm_tmp
,
*
start
;
time_t
query_start
=
current_thd
->
query_start
();
CHARSET_INFO
*
cs
=
thd
_charset
();
CHARSET_INFO
*
cs
=
default
_charset
();
decimals
=
0
;
max_length
=
8
*
cs
->
mbmaxlen
;
...
...
@@ -520,7 +520,7 @@ void Item_func_curtime::fix_length_and_dec()
String
*
Item_func_now
::
val_str
(
String
*
str
)
{
str_value
.
set
(
buff
,
buff_length
,
thd
_charset
());
str_value
.
set
(
buff
,
buff_length
,
default
_charset
());
return
&
str_value
;
}
...
...
@@ -595,7 +595,7 @@ String *Item_func_sec_to_time::val_str(String *str)
uint
sec
=
(
uint
)
((
ulonglong
)
seconds
%
3600
);
length
=
my_sprintf
(
buff
,(
buff
,
"%s%02lu:%02u:%02u"
,
sign
,(
long
)
(
seconds
/
3600
),
sec
/
60
,
sec
%
60
));
str
->
copy
(
buff
,
length
,
&
my_charset_latin1
,
thd
_charset
());
str
->
copy
(
buff
,
length
,
&
my_charset_latin1
,
default
_charset
());
return
str
;
}
...
...
@@ -940,7 +940,7 @@ String *Item_func_from_unixtime::val_str(String *str)
struct
tm
tm_tmp
,
*
start
;
time_t
tmp
=
(
time_t
)
args
[
0
]
->
val_int
();
uint32
l
;
CHARSET_INFO
*
cs
=
thd
_charset
();
CHARSET_INFO
*
cs
=
default
_charset
();
if
((
null_value
=
args
[
0
]
->
null_value
))
return
0
;
...
...
@@ -1003,9 +1003,9 @@ bool Item_func_from_unixtime::get_date(TIME *ltime,
void
Item_date_add_interval
::
fix_length_and_dec
()
{
enum_field_types
arg0_field_type
;
set_charset
(
thd
_charset
());
set_charset
(
default
_charset
());
maybe_null
=
1
;
max_length
=
19
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
19
*
default
_charset
()
->
mbmaxlen
;
value
.
alloc
(
32
);
/*
...
...
@@ -1124,7 +1124,7 @@ bool Item_date_add_interval::get_date(TIME *ltime, bool fuzzy_date)
String
*
Item_date_add_interval
::
val_str
(
String
*
str
)
{
TIME
ltime
;
CHARSET_INFO
*
cs
=
thd
_charset
();
CHARSET_INFO
*
cs
=
default
_charset
();
uint32
l
;
if
(
Item_date_add_interval
::
get_date
(
&
ltime
,
0
))
...
...
sql/item_timefunc.h
View file @
5931e8b1
...
...
@@ -29,7 +29,7 @@ public:
const
char
*
func_name
()
const
{
return
"period_add"
;
}
void
fix_length_and_dec
()
{
max_length
=
6
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
6
*
default
_charset
()
->
mbmaxlen
;
}
};
...
...
@@ -43,7 +43,7 @@ public:
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
6
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
6
*
default
_charset
()
->
mbmaxlen
;
}
};
...
...
@@ -57,7 +57,7 @@ public:
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
6
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
6
*
default
_charset
()
->
mbmaxlen
;
maybe_null
=
1
;
}
};
...
...
@@ -72,7 +72,7 @@ public:
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
2
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
2
*
default
_charset
()
->
mbmaxlen
;
maybe_null
=
1
;
}
};
...
...
@@ -86,16 +86,16 @@ public:
double
val
()
{
return
(
double
)
Item_func_month
::
val_int
();
}
String
*
val_str
(
String
*
str
)
{
str
->
set
(
val_int
(),
thd
_charset
());
str
->
set
(
val_int
(),
default
_charset
());
return
null_value
?
0
:
str
;
}
const
char
*
func_name
()
const
{
return
"month"
;
}
enum
Item_result
result_type
()
const
{
return
INT_RESULT
;
}
void
fix_length_and_dec
()
{
set_charset
(
thd
_charset
());
set_charset
(
default
_charset
());
decimals
=
0
;
max_length
=
2
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
2
*
default
_charset
()
->
mbmaxlen
;
maybe_null
=
1
;
}
};
...
...
@@ -110,9 +110,9 @@ public:
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
void
fix_length_and_dec
()
{
set_charset
(
thd
_charset
());
set_charset
(
default
_charset
());
decimals
=
0
;
max_length
=
10
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
10
*
default
_charset
()
->
mbmaxlen
;
maybe_null
=
1
;
}
};
...
...
@@ -127,7 +127,7 @@ public:
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
3
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
3
*
default
_charset
()
->
mbmaxlen
;
maybe_null
=
1
;
}
};
...
...
@@ -142,7 +142,7 @@ public:
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
2
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
2
*
default
_charset
()
->
mbmaxlen
;
maybe_null
=
1
;
}
};
...
...
@@ -157,7 +157,7 @@ public:
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
2
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
2
*
default
_charset
()
->
mbmaxlen
;
maybe_null
=
1
;
}
};
...
...
@@ -172,7 +172,7 @@ public:
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
1
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
1
*
default
_charset
()
->
mbmaxlen
;
maybe_null
=
1
;
}
};
...
...
@@ -187,7 +187,7 @@ public:
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
2
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
2
*
default
_charset
()
->
mbmaxlen
;
maybe_null
=
1
;
}
};
...
...
@@ -202,7 +202,7 @@ public:
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
2
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
2
*
default
_charset
()
->
mbmaxlen
;
maybe_null
=
1
;
}
};
...
...
@@ -216,7 +216,7 @@ public:
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
6
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
6
*
default
_charset
()
->
mbmaxlen
;
maybe_null
=
1
;
}
};
...
...
@@ -231,7 +231,7 @@ public:
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
4
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
4
*
default
_charset
()
->
mbmaxlen
;
maybe_null
=
1
;
}
};
...
...
@@ -247,16 +247,16 @@ public:
double
val
()
{
return
(
double
)
val_int
();
}
String
*
val_str
(
String
*
str
)
{
str
->
set
(
val_int
(),
thd
_charset
());
str
->
set
(
val_int
(),
default
_charset
());
return
null_value
?
0
:
str
;
}
const
char
*
func_name
()
const
{
return
"weekday"
;
}
enum
Item_result
result_type
()
const
{
return
INT_RESULT
;
}
void
fix_length_and_dec
()
{
set_charset
(
thd
_charset
());
set_charset
(
default
_charset
());
decimals
=
0
;
max_length
=
1
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
1
*
default
_charset
()
->
mbmaxlen
;
maybe_null
=
1
;
}
};
...
...
@@ -270,9 +270,9 @@ class Item_func_dayname :public Item_func_weekday
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
void
fix_length_and_dec
()
{
set_charset
(
thd
_charset
());
set_charset
(
default
_charset
());
decimals
=
0
;
max_length
=
9
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
9
*
default
_charset
()
->
mbmaxlen
;
maybe_null
=
1
;
}
};
...
...
@@ -289,7 +289,7 @@ public:
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
10
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
10
*
default
_charset
()
->
mbmaxlen
;
}
};
...
...
@@ -303,7 +303,7 @@ public:
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
10
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
10
*
default
_charset
()
->
mbmaxlen
;
}
};
...
...
@@ -322,15 +322,15 @@ public:
const
char
*
func_name
()
const
{
return
"date"
;
}
void
fix_length_and_dec
()
{
set_charset
(
thd
_charset
());
set_charset
(
default
_charset
());
decimals
=
0
;
max_length
=
10
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
10
*
default
_charset
()
->
mbmaxlen
;
}
int
save_in_field
(
Field
*
to
,
bool
no_conversions
);
Field
*
tmp_table_field
()
{
return
result_field
;
}
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
{
return
(
new
Field_date
(
maybe_null
,
name
,
t_arg
,
thd
_charset
()));
return
(
new
Field_date
(
maybe_null
,
name
,
t_arg
,
default
_charset
()));
}
};
...
...
@@ -345,7 +345,7 @@ public:
Field
*
tmp_table_field
()
{
return
result_field
;
}
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
{
return
(
new
Field_datetime
(
maybe_null
,
name
,
t_arg
,
thd
_charset
()));
return
(
new
Field_datetime
(
maybe_null
,
name
,
t_arg
,
default
_charset
()));
}
};
...
...
@@ -368,7 +368,7 @@ public:
Field
*
tmp_table_field
()
{
return
result_field
;
}
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
{
return
(
new
Field_time
(
maybe_null
,
name
,
t_arg
,
thd
_charset
()));
return
(
new
Field_time
(
maybe_null
,
name
,
t_arg
,
default
_charset
()));
}
};
...
...
@@ -440,9 +440,9 @@ class Item_func_from_unixtime :public Item_date_func
const
char
*
func_name
()
const
{
return
"from_unixtime"
;
}
void
fix_length_and_dec
()
{
set_charset
(
thd
_charset
());
set_charset
(
default
_charset
());
decimals
=
0
;
max_length
=
19
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
19
*
default
_charset
()
->
mbmaxlen
;
}
bool
get_date
(
TIME
*
res
,
bool
fuzzy_date
);
};
...
...
@@ -457,16 +457,16 @@ public:
String
*
val_str
(
String
*
);
void
fix_length_and_dec
()
{
set_charset
(
thd
_charset
());
set_charset
(
default
_charset
());
maybe_null
=
1
;
max_length
=
13
*
thd
_charset
()
->
mbmaxlen
;
max_length
=
13
*
default
_charset
()
->
mbmaxlen
;
}
enum_field_types
field_type
()
const
{
return
MYSQL_TYPE_TIME
;
}
const
char
*
func_name
()
const
{
return
"sec_to_time"
;
}
Field
*
tmp_table_field
()
{
return
result_field
;
}
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
{
return
(
new
Field_time
(
maybe_null
,
name
,
t_arg
,
thd
_charset
()));
return
(
new
Field_time
(
maybe_null
,
name
,
t_arg
,
default
_charset
()));
}
};
...
...
@@ -532,7 +532,7 @@ public:
}
void
fix_length_and_dec
()
{
set_charset
(
thd
_charset
());
set_charset
(
default
_charset
());
max_length
=
args
[
0
]
->
max_length
;
}
void
print
(
String
*
str
);
...
...
@@ -545,7 +545,7 @@ public:
Item_char_typecast
(
Item
*
a
)
:
Item_typecast
(
a
)
{}
void
fix_length_and_dec
()
{
set_charset
(
thd
_charset
());
set_charset
(
default
_charset
());
max_length
=
args
[
0
]
->
max_length
;
}
};
...
...
@@ -560,7 +560,7 @@ public:
Field
*
tmp_table_field
()
{
return
result_field
;
}
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
{
return
(
new
Field_date
(
maybe_null
,
name
,
t_arg
,
thd
_charset
()));
return
(
new
Field_date
(
maybe_null
,
name
,
t_arg
,
default
_charset
()));
}
};
...
...
@@ -574,7 +574,7 @@ public:
Field
*
tmp_table_field
()
{
return
result_field
;
}
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
{
return
(
new
Field_time
(
maybe_null
,
name
,
t_arg
,
thd
_charset
()));
return
(
new
Field_time
(
maybe_null
,
name
,
t_arg
,
default
_charset
()));
}
};
...
...
@@ -588,6 +588,6 @@ public:
Field
*
tmp_table_field
()
{
return
result_field
;
}
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
{
return
(
new
Field_datetime
(
maybe_null
,
name
,
t_arg
,
thd
_charset
()));
return
(
new
Field_datetime
(
maybe_null
,
name
,
t_arg
,
default
_charset
()));
}
};
sql/log_event.cc
View file @
5931e8b1
...
...
@@ -2177,7 +2177,7 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli)
}
Item_func_set_user_var
e
(
user_var_name
,
it
);
e
.
fix_fields
(
thd
,
0
,
0
);
e
.
update_hash
(
val
,
val_len
,
type
,
charset
);
e
.
update_hash
(
val
,
val_len
,
type
,
charset
,
Item
::
COER_NOCOLL
);
free_root
(
&
thd
->
mem_root
,
0
);
rli
->
inc_pending
(
get_event_len
());
...
...
sql/procedure.h
View file @
5931e8b1
...
...
@@ -38,7 +38,7 @@ public:
virtual
void
set
(
const
char
*
str
,
uint
length
,
CHARSET_INFO
*
cs
)
=
0
;
virtual
void
set
(
longlong
nr
)
=
0
;
virtual
enum_field_types
field_type
()
const
=
0
;
void
set
(
const
char
*
str
)
{
set
(
str
,(
uint
)
strlen
(
str
),
thd
_charset
());
}
void
set
(
const
char
*
str
)
{
set
(
str
,(
uint
)
strlen
(
str
),
default
_charset
());
}
void
make_field
(
Send_field
*
tmp_field
)
{
init_make_field
(
tmp_field
,
field_type
());
...
...
@@ -62,7 +62,7 @@ public:
{
int
err
;
value
=
my_strntod
(
cs
,(
char
*
)
str
,
length
,(
char
**
)
0
,
&
err
);
}
double
val
()
{
return
value
;
}
longlong
val_int
()
{
return
(
longlong
)
value
;
}
String
*
val_str
(
String
*
s
)
{
s
->
set
(
value
,
decimals
,
thd
_charset
());
return
s
;
}
String
*
val_str
(
String
*
s
)
{
s
->
set
(
value
,
decimals
,
default
_charset
());
return
s
;
}
unsigned
int
size_of
()
{
return
sizeof
(
*
this
);}
};
...
...
@@ -80,7 +80,7 @@ public:
{
int
err
;
value
=
my_strntoll
(
cs
,
str
,
length
,
10
,
NULL
,
&
err
);
}
double
val
()
{
return
(
double
)
value
;
}
longlong
val_int
()
{
return
value
;
}
String
*
val_str
(
String
*
s
)
{
s
->
set
(
value
,
thd
_charset
());
return
s
;
}
String
*
val_str
(
String
*
s
)
{
s
->
set
(
value
,
default
_charset
());
return
s
;
}
unsigned
int
size_of
()
{
return
sizeof
(
*
this
);}
};
...
...
@@ -92,8 +92,8 @@ public:
{
this
->
max_length
=
length
;
}
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
enum_field_types
field_type
()
const
{
return
MYSQL_TYPE_STRING
;
}
void
set
(
double
nr
)
{
str_value
.
set
(
nr
,
2
,
thd
_charset
());
}
void
set
(
longlong
nr
)
{
str_value
.
set
(
nr
,
thd
_charset
());
}
void
set
(
double
nr
)
{
str_value
.
set
(
nr
,
2
,
default
_charset
());
}
void
set
(
longlong
nr
)
{
str_value
.
set
(
nr
,
default
_charset
());
}
void
set
(
const
char
*
str
,
uint
length
,
CHARSET_INFO
*
cs
)
{
str_value
.
copy
(
str
,
length
,
cs
);
}
double
val
()
...
...
sql/sql_class.h
View file @
5931e8b1
...
...
@@ -935,6 +935,7 @@ class user_var_entry
ulong
length
,
update_query_id
,
used_query_id
;
Item_result
type
;
CHARSET_INFO
*
var_charset
;
enum
Item
::
coercion
var_coercibility
;
};
/* Class for unique (removing of duplicates) */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment