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
44347c5a
Commit
44347c5a
authored
Jun 20, 2002
by
bar@gw.udmsearch.izhnet.ru
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
5eafe401
Changes
4
Show 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 @
44347c5a
...
@@ -133,6 +133,9 @@ void Item_field::set_field(Field *field_par)
...
@@ -133,6 +133,9 @@ void Item_field::set_field(Field *field_par)
field_name
=
field_par
->
field_name
;
field_name
=
field_par
->
field_name
;
binary
=
field_par
->
binary
();
binary
=
field_par
->
binary
();
unsigned_flag
=
test
(
field_par
->
flags
&
UNSIGNED_FLAG
);
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
const
char
*
Item_ident
::
full_name
()
const
...
...
sql/item_func.cc
View file @
44347c5a
...
@@ -78,6 +78,17 @@ Item_func::fix_fields(THD *thd,TABLE_LIST *tables)
...
@@ -78,6 +78,17 @@ Item_func::fix_fields(THD *thd,TABLE_LIST *tables)
maybe_null
=
1
;
maybe_null
=
1
;
if
((
*
arg
)
->
binary
)
if
((
*
arg
)
->
binary
)
binary
=
1
;
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
;
with_sum_func
=
with_sum_func
||
(
*
arg
)
->
with_sum_func
;
used_tables_cache
|=
(
*
arg
)
->
used_tables
();
used_tables_cache
|=
(
*
arg
)
->
used_tables
();
const_item_cache
&=
(
*
arg
)
->
const_item
();
const_item_cache
&=
(
*
arg
)
->
const_item
();
...
...
sql/item_strfunc.cc
View file @
44347c5a
...
@@ -759,6 +759,7 @@ String *Item_func_left::val_str(String *str)
...
@@ -759,6 +759,7 @@ String *Item_func_left::val_str(String *str)
if
(
!
res
->
alloced_length
())
if
(
!
res
->
alloced_length
())
{
// Don't change const str
{
// Don't change const str
str_value
=
*
res
;
// Not malloced string
str_value
=
*
res
;
// Not malloced string
str_value
.
set_charset
(
res
->
charset
());
res
=
&
str_value
;
res
=
&
str_value
;
}
}
res
->
length
((
uint
)
length
);
res
->
length
((
uint
)
length
);
...
...
sql/sql_select.cc
View file @
44347c5a
...
@@ -3579,7 +3579,8 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
...
@@ -3579,7 +3579,8 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
item
->
name
,
table
,
item
->
binary
);
item
->
name
,
table
,
item
->
binary
);
else
else
new_field
=
new
Field_string
(
item
->
max_length
,
maybe_null
,
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
;
break
;
}
}
if
(
copy_func
)
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