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
0148b062
Commit
0148b062
authored
Mar 21, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New variable to turn off automatic charset conversion of query results
Some speed improvements
parent
74f46ace
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
12 deletions
+23
-12
sql/mysqld.cc
sql/mysqld.cc
+1
-0
sql/protocol.cc
sql/protocol.cc
+15
-11
sql/protocol.h
sql/protocol.h
+2
-0
sql/set_var.cc
sql/set_var.cc
+4
-1
sql/sql_class.h
sql/sql_class.h
+1
-0
No files found.
sql/mysqld.cc
View file @
0148b062
...
...
@@ -4551,6 +4551,7 @@ static void set_options(void)
sizeof
(
mysql_real_data_home
)
-
1
);
/* Set default values for some variables */
global_system_variables
.
convert_result_charset
=
TRUE
;
global_system_variables
.
table_type
=
DB_TYPE_MYISAM
;
global_system_variables
.
tx_isolation
=
ISO_REPEATABLE_READ
;
global_system_variables
.
select_limit
=
(
ulonglong
)
HA_POS_ERROR
;
...
...
sql/protocol.cc
View file @
0148b062
...
...
@@ -703,11 +703,13 @@ bool Protocol_simple::store(const char *from, uint length, CHARSET_INFO *cs)
field_types
[
field_pos
]
<=
MYSQL_TYPE_GEOMETRY
));
field_pos
++
;
#endif
if
(
cs
!=
this
->
thd
->
charset
())
if
(
!
my_charset_same
(
cs
,
this
->
thd
->
charset
())
&&
(
cs
!=
&
my_charset_bin
)
&&
(
this
->
thd
->
charset
()
!=
&
my_charset_bin
)
&&
(
this
->
thd
->
variables
.
convert_result_charset
))
{
String
tmp
;
tmp
.
copy
(
from
,
length
,
cs
,
this
->
thd
->
charset
());
return
net_store_data
(
tmp
.
ptr
(),
tmp
.
length
());
convert
.
copy
(
from
,
length
,
cs
,
this
->
thd
->
charset
());
return
net_store_data
(
convert
.
ptr
(),
convert
.
length
());
}
else
return
net_store_data
(
from
,
length
);
...
...
@@ -800,16 +802,18 @@ bool Protocol_simple::store(Field *field)
field_pos
++
;
#endif
char
buff
[
MAX_FIELD_WIDTH
];
String
tmp1
(
buff
,
sizeof
(
buff
),
&
my_charset_bin
);
field
->
val_str
(
&
tmp1
,
&
tmp1
);
if
(
field
->
charset
()
!=
this
->
thd
->
charset
())
String
str
(
buff
,
sizeof
(
buff
),
&
my_charset_bin
);
field
->
val_str
(
&
str
,
&
str
);
if
(
!
my_charset_same
(
field
->
charset
(),
this
->
thd
->
charset
())
&&
(
field
->
charset
()
!=
&
my_charset_bin
)
&&
(
this
->
thd
->
charset
()
!=
&
my_charset_bin
)
&&
(
this
->
thd
->
variables
.
convert_result_charset
))
{
String
tmp
;
tmp
.
copy
(
tmp1
.
ptr
(),
tmp1
.
length
(),
tmp1
.
charset
(),
this
->
thd
->
charset
());
return
net_store_data
(
tmp
.
ptr
(),
tmp
.
length
());
convert
.
copy
(
str
.
ptr
(),
str
.
length
(),
str
.
charset
(),
this
->
thd
->
charset
());
return
net_store_data
(
convert
.
ptr
(),
convert
.
length
());
}
else
return
net_store_data
(
tmp1
.
ptr
(),
tmp1
.
length
());
return
net_store_data
(
str
.
ptr
(),
str
.
length
());
}
...
...
sql/protocol.h
View file @
0148b062
...
...
@@ -30,6 +30,7 @@ class Protocol
protected:
THD
*
thd
;
String
*
packet
;
String
convert
;
uint
field_pos
;
#ifndef DEBUG_OFF
enum
enum_field_types
*
field_types
;
...
...
@@ -44,6 +45,7 @@ class Protocol
public:
Protocol
()
{}
Protocol
(
THD
*
thd
)
{
init
(
thd
);
}
virtual
~
Protocol
()
{}
void
init
(
THD
*
thd
);
bool
send_fields
(
List
<
Item
>
*
list
,
uint
flag
);
bool
send_records_num
(
List
<
Item
>
*
list
,
ulonglong
records
);
...
...
sql/set_var.cc
View file @
0148b062
...
...
@@ -109,6 +109,8 @@ sys_var_bool_ptr sys_concurrent_insert("concurrent_insert",
&
myisam_concurrent_insert
);
sys_var_long_ptr
sys_connect_timeout
(
"connect_timeout"
,
&
connect_timeout
);
sys_var_thd_bool
sys_convert_result_charset
(
"convert_result_charset"
,
&
SV
::
convert_result_charset
);
sys_var_enum
sys_delay_key_write
(
"delay_key_write"
,
&
delay_key_write_options
,
&
delay_key_write_typelib
,
...
...
@@ -337,6 +339,7 @@ sys_var *sys_variables[]=
&
sys_client_collation
,
&
sys_concurrent_insert
,
&
sys_connect_timeout
,
&
sys_convert_result_charset
,
&
sys_default_week_format
,
&
sys_delay_key_write
,
&
sys_delayed_insert_limit
,
...
...
@@ -445,6 +448,7 @@ struct show_var_st init_vars[]= {
{
sys_client_collation
.
name
,
(
char
*
)
&
sys_client_collation
,
SHOW_SYS
},
{
sys_concurrent_insert
.
name
,(
char
*
)
&
sys_concurrent_insert
,
SHOW_SYS
},
{
sys_connect_timeout
.
name
,
(
char
*
)
&
sys_connect_timeout
,
SHOW_SYS
},
{
sys_convert_result_charset
.
name
,
(
char
*
)
&
sys_convert_result_charset
,
SHOW_SYS
},
{
"datadir"
,
mysql_real_data_home
,
SHOW_CHAR
},
{
"default_week_format"
,
(
char
*
)
&
sys_default_week_format
,
SHOW_SYS
},
{
sys_delay_key_write
.
name
,
(
char
*
)
&
sys_delay_key_write
,
SHOW_SYS
},
...
...
@@ -1455,7 +1459,6 @@ void set_var_init()
(
*
var
)
->
option_limits
=
find_option
(
my_long_options
,
(
*
var
)
->
name
);
hash_insert
(
&
system_variable_hash
,
(
byte
*
)
*
var
);
}
/*
Special cases
Needed because MySQL can't find the limits for a variable it it has
...
...
sql/sql_class.h
View file @
0148b062
...
...
@@ -374,6 +374,7 @@ struct system_variables
my_bool
log_warnings
;
my_bool
low_priority_updates
;
my_bool
new_mode
;
my_bool
convert_result_charset
;
CHARSET_INFO
*
thd_charset
;
};
...
...
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