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
2583ecd6
Commit
2583ecd6
authored
Jun 20, 2002
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SELECT left(non_default_charset_field,n) GROUP BY 1
now works more correctly. Still needs fixes.
parent
2753972c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
1 deletion
+17
-1
sql/item.cc
sql/item.cc
+3
-0
sql/item_func.cc
sql/item_func.cc
+11
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+1
-0
sql/sql_select.cc
sql/sql_select.cc
+2
-1
No files found.
sql/item.cc
View file @
2583ecd6
...
...
@@ -133,6 +133,9 @@ void Item_field::set_field(Field *field_par)
field_name
=
field_par
->
field_name
;
binary
=
field_par
->
binary
();
unsigned_flag
=
test
(
field_par
->
flags
&
UNSIGNED_FLAG
);
/* For string fields copy character set from original field */
if
(
!
field_par
->
binary
())
str_value
.
set_charset
(((
Field_str
*
)
field_par
)
->
charset
());
}
const
char
*
Item_ident
::
full_name
()
const
...
...
sql/item_func.cc
View file @
2583ecd6
...
...
@@ -78,6 +78,17 @@ Item_func::fix_fields(THD *thd,TABLE_LIST *tables)
maybe_null
=
1
;
if
((
*
arg
)
->
binary
)
binary
=
1
;
/*
Change charset to arg charset if it is not equal to
default_charset_info. This will work for many cases,
but generally this should be done more carefull. Each string
function should have it's own fix_fields() method to correctly
setup it's result's character set taking in account arguments.
For example: left(a,b) should take in account only first argument,
but ignore the second one.
*/
if
((
*
arg
)
->
str_value
.
charset
()
!=
default_charset_info
)
str_value
.
set_charset
((
*
arg
)
->
str_value
.
charset
());
with_sum_func
=
with_sum_func
||
(
*
arg
)
->
with_sum_func
;
used_tables_cache
|=
(
*
arg
)
->
used_tables
();
const_item_cache
&=
(
*
arg
)
->
const_item
();
...
...
sql/item_strfunc.cc
View file @
2583ecd6
...
...
@@ -759,6 +759,7 @@ String *Item_func_left::val_str(String *str)
if
(
!
res
->
alloced_length
())
{
// Don't change const str
str_value
=
*
res
;
// Not malloced string
str_value
.
set_charset
(
res
->
charset
());
res
=
&
str_value
;
}
res
->
length
((
uint
)
length
);
...
...
sql/sql_select.cc
View file @
2583ecd6
...
...
@@ -3579,7 +3579,8 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
item
->
name
,
table
,
item
->
binary
);
else
new_field
=
new
Field_string
(
item
->
max_length
,
maybe_null
,
item
->
name
,
table
,
item
->
binary
,
default_charset_info
);
item
->
name
,
table
,
item
->
binary
,
item
->
str_value
.
charset
());
break
;
}
if
(
copy_func
)
...
...
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