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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4ffd74e5
Commit
4ffd74e5
authored
Mar 03, 2003
by
bar@bar.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coercibility is now stored in user vars
parent
48cdd978
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
10 deletions
+17
-10
sql/item.h
sql/item.h
+2
-2
sql/item_func.cc
sql/item_func.cc
+11
-6
sql/item_func.h
sql/item_func.h
+2
-1
sql/log_event.cc
sql/log_event.cc
+1
-1
sql/sql_class.h
sql/sql_class.h
+1
-0
No files found.
sql/item.h
View file @
4ffd74e5
...
...
@@ -39,8 +39,8 @@ class Item {
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 */
...
...
sql/item_func.cc
View file @
4ffd74e5
...
...
@@ -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
))
{
...
...
@@ -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 @
4ffd74e5
...
...
@@ -934,7 +934,8 @@ class Item_func_set_user_var :public Item_func
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/log_event.cc
View file @
4ffd74e5
...
...
@@ -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/sql_class.h
View file @
4ffd74e5
...
...
@@ -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