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
b567a1d7
Commit
b567a1d7
authored
Jun 24, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Item character set is stored in Item itself now, not in ITem->str_value
parent
3d7dbf2c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
11 deletions
+15
-11
sql/item.cc
sql/item.cc
+3
-1
sql/item.h
sql/item.h
+10
-8
sql/sql_select.cc
sql/sql_select.cc
+2
-2
No files found.
sql/item.cc
View file @
b567a1d7
...
@@ -39,7 +39,8 @@ Item::Item():
...
@@ -39,7 +39,8 @@ Item::Item():
{
{
marker
=
0
;
marker
=
0
;
maybe_null
=
null_value
=
with_sum_func
=
unsigned_flag
=
0
;
maybe_null
=
null_value
=
with_sum_func
=
unsigned_flag
=
0
;
coercibility
=
COER_COERCIBLE
;
collation
=
&
my_charset_bin
;
coercibility
=
COER_COERCIBLE
;
name
=
0
;
name
=
0
;
decimals
=
0
;
max_length
=
0
;
decimals
=
0
;
max_length
=
0
;
THD
*
thd
=
current_thd
;
THD
*
thd
=
current_thd
;
...
@@ -67,6 +68,7 @@ Item::Item(THD *thd, Item &item):
...
@@ -67,6 +68,7 @@ Item::Item(THD *thd, Item &item):
unsigned_flag
(
item
.
unsigned_flag
),
unsigned_flag
(
item
.
unsigned_flag
),
with_sum_func
(
item
.
with_sum_func
),
with_sum_func
(
item
.
with_sum_func
),
fixed
(
item
.
fixed
),
fixed
(
item
.
fixed
),
collation
(
item
.
collation
),
coercibility
(
item
.
coercibility
)
coercibility
(
item
.
coercibility
)
{
{
next
=
thd
->
free_list
;
// Put in free list
next
=
thd
->
free_list
;
// Put in free list
...
...
sql/item.h
View file @
b567a1d7
...
@@ -65,6 +65,7 @@ class Item {
...
@@ -65,6 +65,7 @@ class Item {
my_bool
unsigned_flag
;
my_bool
unsigned_flag
;
my_bool
with_sum_func
;
my_bool
with_sum_func
;
my_bool
fixed
;
/* If item fixed with fix_fields */
my_bool
fixed
;
/* If item fixed with fix_fields */
CHARSET_INFO
*
collation
;
/* character set && collation */
enum
coercion
coercibility
;
/* Precedence order of collation */
enum
coercion
coercibility
;
/* Precedence order of collation */
// alloc & destruct is done as start of select using sql_alloc
// alloc & destruct is done as start of select using sql_alloc
...
@@ -123,18 +124,17 @@ class Item {
...
@@ -123,18 +124,17 @@ class Item {
virtual
Item
*
real_item
()
{
return
this
;
}
virtual
Item
*
real_item
()
{
return
this
;
}
virtual
Item
*
get_tmp_table_item
(
THD
*
thd
)
{
return
copy_or_same
(
thd
);
}
virtual
Item
*
get_tmp_table_item
(
THD
*
thd
)
{
return
copy_or_same
(
thd
);
}
virtual
bool
binary
()
const
{
return
str_value
.
charset
()
->
state
&
MY_CS_BINSORT
?
1
:
0
;
}
CHARSET_INFO
*
default_charset
()
const
;
CHARSET_INFO
*
default_charset
()
const
;
CHARSET_INFO
*
charset
()
const
{
return
str_value
.
charset
();
};
CHARSET_INFO
*
charset
()
const
{
return
collation
;
};
void
set_charset
(
CHARSET_INFO
*
cs
)
{
str_value
.
set_charset
(
cs
);
}
void
set_charset
(
CHARSET_INFO
*
cs
)
{
collation
=
cs
;
}
void
set_charset
(
CHARSET_INFO
*
cs
,
enum
coercion
coer
)
void
set_charset
(
CHARSET_INFO
*
cs
,
enum
coercion
coer
)
{
{
collation
=
cs
;
coercibility
=
coer
;
}
str_value
.
set_charset
(
cs
);
coercibility
=
coer
;
}
bool
set_charset
(
CHARSET_INFO
*
cs1
,
enum
coercion
co1
,
bool
set_charset
(
CHARSET_INFO
*
cs1
,
enum
coercion
co1
,
CHARSET_INFO
*
cs2
,
enum
coercion
co2
);
CHARSET_INFO
*
cs2
,
enum
coercion
co2
);
bool
binary
()
const
{
return
charset
()
->
state
&
MY_CS_BINSORT
?
1
:
0
;
}
virtual
void
set_outer_resolving
()
{}
virtual
void
set_outer_resolving
()
{}
// Row emulation
// Row emulation
...
@@ -383,6 +383,7 @@ class Item_string :public Item
...
@@ -383,6 +383,7 @@ class Item_string :public Item
Item_string
(
const
char
*
str
,
uint
length
,
Item_string
(
const
char
*
str
,
uint
length
,
CHARSET_INFO
*
cs
,
enum
coercion
coer
=
COER_COERCIBLE
)
CHARSET_INFO
*
cs
,
enum
coercion
coer
=
COER_COERCIBLE
)
{
{
set_charset
(
cs
);
str_value
.
set
(
str
,
length
,
cs
);
str_value
.
set
(
str
,
length
,
cs
);
coercibility
=
coer
;
coercibility
=
coer
;
max_length
=
length
;
max_length
=
length
;
...
@@ -392,6 +393,7 @@ class Item_string :public Item
...
@@ -392,6 +393,7 @@ class Item_string :public Item
Item_string
(
const
char
*
name_par
,
const
char
*
str
,
uint
length
,
Item_string
(
const
char
*
name_par
,
const
char
*
str
,
uint
length
,
CHARSET_INFO
*
cs
,
enum
coercion
coer
=
COER_COERCIBLE
)
CHARSET_INFO
*
cs
,
enum
coercion
coer
=
COER_COERCIBLE
)
{
{
set_charset
(
cs
);
str_value
.
set
(
str
,
length
,
cs
);
str_value
.
set
(
str
,
length
,
cs
);
coercibility
=
coer
;
coercibility
=
coer
;
max_length
=
length
;
max_length
=
length
;
...
...
sql/sql_select.cc
View file @
b567a1d7
...
@@ -4142,10 +4142,10 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
...
@@ -4142,10 +4142,10 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
case
STRING_RESULT
:
case
STRING_RESULT
:
if
(
item
->
max_length
>
255
)
if
(
item
->
max_length
>
255
)
new_field
=
new
Field_blob
(
item
->
max_length
,
maybe_null
,
new_field
=
new
Field_blob
(
item
->
max_length
,
maybe_null
,
item
->
name
,
table
,
item
->
str_value
.
charset
());
item
->
name
,
table
,
item
->
charset
());
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
->
str_value
.
charset
());
item
->
name
,
table
,
item
->
charset
());
break
;
break
;
case
ROW_RESULT
:
case
ROW_RESULT
:
default:
default:
...
...
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