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
fd4ab361
Commit
fd4ab361
authored
Jan 19, 2006
by
bar@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into mysql.com:/usr/home/bar/mysql-5.1-new.12448
parents
a3063826
4e4b37a8
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
125 additions
and
4 deletions
+125
-4
mysql-test/r/loaddata.result
mysql-test/r/loaddata.result
+27
-0
mysql-test/t/loaddata.test
mysql-test/t/loaddata.test
+24
-0
sql/mysqld.cc
sql/mysqld.cc
+16
-0
sql/set_var.cc
sql/set_var.cc
+28
-0
sql/set_var.h
sql/set_var.h
+9
-0
sql/sql_class.cc
sql/sql_class.cc
+3
-0
sql/sql_class.h
sql/sql_class.h
+2
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+16
-4
No files found.
mysql-test/r/loaddata.result
View file @
fd4ab361
...
...
@@ -139,3 +139,30 @@ a b c
10 NULL Ten
15 NULL Fifteen
drop table t1, t2;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (1);
SET NAMES latin1;
SET character_set_filesystem=filename;
select @@character_set_filesystem;
@@character_set_filesystem
filename
SELECT * INTO OUTFILE 't-1' FROM t1;
DELETE FROM t1;
LOAD DATA INFILE 't-1' INTO TABLE t1;
SELECT * FROM t1;
a
1
DELETE FROM t1;
SET character_set_filesystem=latin1;
select @@character_set_filesystem;
@@character_set_filesystem
latin1
LOAD DATA INFILE 't@002d1' INTO TABLE t1;
SELECT * FROM t1;
a
1
DROP TABLE t1;
SET character_set_filesystem=default;
select @@character_set_filesystem;
@@character_set_filesystem
binary
mysql-test/t/loaddata.test
View file @
fd4ab361
...
...
@@ -114,3 +114,27 @@ select * from t1;
drop
table
t1
,
t2
;
# End of 5.0 tests
#
# Bug#12448 LOAD DATA / SELECT INTO OUTFILE
# doesn't work with multibyte path name
#
CREATE
TABLE
t1
(
a
int
);
INSERT
INTO
t1
VALUES
(
1
);
SET
NAMES
latin1
;
SET
character_set_filesystem
=
filename
;
select
@@
character_set_filesystem
;
SELECT
*
INTO
OUTFILE
't-1'
FROM
t1
;
DELETE
FROM
t1
;
LOAD
DATA
INFILE
't-1'
INTO
TABLE
t1
;
SELECT
*
FROM
t1
;
DELETE
FROM
t1
;
SET
character_set_filesystem
=
latin1
;
select
@@
character_set_filesystem
;
LOAD
DATA
INFILE
't@002d1'
INTO
TABLE
t1
;
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
--
exec
rm
$MYSQL_TEST_DIR
/
var
/
master
-
data
/
test
/
t
@
002
d1
SET
character_set_filesystem
=
default
;
select
@@
character_set_filesystem
;
sql/mysqld.cc
View file @
fd4ab361
...
...
@@ -315,6 +315,7 @@ static const char *sql_mode_str= "OFF";
static
char
*
mysqld_user
,
*
mysqld_chroot
,
*
log_error_file_ptr
;
static
char
*
opt_init_slave
,
*
language_ptr
,
*
opt_init_connect
;
static
char
*
default_character_set_name
;
static
char
*
character_set_filesystem_name
;
static
char
*
my_bind_addr_str
;
static
char
*
default_collation_name
;
static
char
mysql_data_home_buff
[
2
];
...
...
@@ -565,6 +566,7 @@ MY_BITMAP temp_pool;
CHARSET_INFO
*
system_charset_info
,
*
files_charset_info
;
CHARSET_INFO
*
national_charset_info
,
*
table_alias_charset
;
CHARSET_INFO
*
character_set_filesystem
;
SHOW_COMP_OPTION
have_row_based_replication
;
SHOW_COMP_OPTION
have_raid
,
have_openssl
,
have_symlink
,
have_query_cache
;
...
...
@@ -2806,6 +2808,12 @@ static int init_common_variables(const char *conf_file_name, int argc,
global_system_variables
.
character_set_client
=
default_charset_info
;
global_system_variables
.
collation_connection
=
default_charset_info
;
if
(
!
(
character_set_filesystem
=
get_charset_by_csname
(
character_set_filesystem_name
,
MY_CS_PRIMARY
,
MYF
(
MY_WME
))))
return
1
;
global_system_variables
.
character_set_filesystem
=
character_set_filesystem
;
sys_init_connect
.
value_length
=
0
;
if
((
sys_init_connect
.
value
=
opt_init_connect
))
sys_init_connect
.
value_length
=
strlen
(
opt_init_connect
);
...
...
@@ -4792,6 +4800,7 @@ enum options_mysqld
OPT_GROUP_CONCAT_MAX_LEN
,
OPT_DEFAULT_COLLATION
,
OPT_CHARACTER_SET_CLIENT_HANDSHAKE
,
OPT_CHARACTER_SET_FILESYSTEM
,
OPT_INIT_CONNECT
,
OPT_INIT_SLAVE
,
OPT_SECURE_AUTH
,
...
...
@@ -4945,6 +4954,11 @@ Disable with --skip-bdb (will save memory).",
(
gptr
*
)
&
opt_character_set_client_handshake
,
(
gptr
*
)
&
opt_character_set_client_handshake
,
0
,
GET_BOOL
,
NO_ARG
,
1
,
0
,
0
,
0
,
0
,
0
},
{
"character-set-filesystem"
,
OPT_CHARACTER_SET_FILESYSTEM
,
"Set the filesystem character set."
,
(
gptr
*
)
&
character_set_filesystem_name
,
(
gptr
*
)
&
character_set_filesystem_name
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"character-set-server"
,
'C'
,
"Set the default character set."
,
(
gptr
*
)
&
default_character_set_name
,
(
gptr
*
)
&
default_character_set_name
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
...
...
@@ -6969,6 +6983,7 @@ static void mysql_init_variables(void)
files_charset_info
=
&
my_charset_utf8_general_ci
;
national_charset_info
=
&
my_charset_utf8_general_ci
;
table_alias_charset
=
&
my_charset_bin
;
character_set_filesystem
=
&
my_charset_bin
;
opt_date_time_formats
[
0
]
=
opt_date_time_formats
[
1
]
=
opt_date_time_formats
[
2
]
=
0
;
...
...
@@ -7022,6 +7037,7 @@ static void mysql_init_variables(void)
default_character_set_name
=
(
char
*
)
MYSQL_DEFAULT_CHARSET_NAME
;
default_collation_name
=
(
char
*
)
MYSQL_DEFAULT_COLLATION_NAME
;
sys_charset_system
.
value
=
(
char
*
)
system_charset_info
->
csname
;
character_set_filesystem_name
=
(
char
*
)
"binary"
;
/* Set default values for some option variables */
...
...
sql/set_var.cc
View file @
fd4ab361
...
...
@@ -193,6 +193,7 @@ sys_var_character_set_database sys_character_set_database("character_set_databas
sys_var_character_set_client
sys_character_set_client
(
"character_set_client"
);
sys_var_character_set_connection
sys_character_set_connection
(
"character_set_connection"
);
sys_var_character_set_results
sys_character_set_results
(
"character_set_results"
);
sys_var_character_set_filesystem
sys_character_set_filesystem
(
"character_set_filesystem"
);
sys_var_thd_ulong
sys_completion_type
(
"completion_type"
,
&
SV
::
completion_type
,
check_completion_type
,
...
...
@@ -706,6 +707,7 @@ SHOW_VAR init_vars[]= {
{
sys_character_set_client
.
name
,(
char
*
)
&
sys_character_set_client
,
SHOW_SYS
},
{
sys_character_set_connection
.
name
,(
char
*
)
&
sys_character_set_connection
,
SHOW_SYS
},
{
sys_character_set_database
.
name
,
(
char
*
)
&
sys_character_set_database
,
SHOW_SYS
},
{
sys_character_set_filesystem
.
name
,(
char
*
)
&
sys_character_set_filesystem
,
SHOW_SYS
},
{
sys_character_set_results
.
name
,(
char
*
)
&
sys_character_set_results
,
SHOW_SYS
},
{
sys_character_set_server
.
name
,
(
char
*
)
&
sys_character_set_server
,
SHOW_SYS
},
{
sys_charset_system
.
name
,
(
char
*
)
&
sys_charset_system
,
SHOW_SYS
},
...
...
@@ -2021,6 +2023,32 @@ void sys_var_character_set_client::set_default(THD *thd, enum_var_type type)
}
CHARSET_INFO
**
sys_var_character_set_filesystem
::
ci_ptr
(
THD
*
thd
,
enum_var_type
type
)
{
if
(
type
==
OPT_GLOBAL
)
return
&
global_system_variables
.
character_set_filesystem
;
else
return
&
thd
->
variables
.
character_set_filesystem
;
}
extern
CHARSET_INFO
*
character_set_filesystem
;
void
sys_var_character_set_filesystem
::
set_default
(
THD
*
thd
,
enum_var_type
type
)
{
if
(
type
==
OPT_GLOBAL
)
global_system_variables
.
character_set_filesystem
=
character_set_filesystem
;
else
{
thd
->
variables
.
character_set_filesystem
=
(
global_system_variables
.
character_set_filesystem
);
thd
->
update_charset
();
}
}
CHARSET_INFO
**
sys_var_character_set_results
::
ci_ptr
(
THD
*
thd
,
enum_var_type
type
)
{
...
...
sql/set_var.h
View file @
fd4ab361
...
...
@@ -549,6 +549,15 @@ class sys_var_character_set :public sys_var_thd
virtual
CHARSET_INFO
**
ci_ptr
(
THD
*
thd
,
enum_var_type
type
)
=
0
;
};
class
sys_var_character_set_filesystem
:
public
sys_var_character_set
{
public:
sys_var_character_set_filesystem
(
const
char
*
name_arg
)
:
sys_var_character_set
(
name_arg
)
{}
void
set_default
(
THD
*
thd
,
enum_var_type
type
);
CHARSET_INFO
**
ci_ptr
(
THD
*
thd
,
enum_var_type
type
);
};
class
sys_var_character_set_client
:
public
sys_var_character_set
{
public:
...
...
sql/sql_class.cc
View file @
fd4ab361
...
...
@@ -658,6 +658,9 @@ void THD::update_charset()
charset_is_collation_connection
=
!
String
::
needs_conversion
(
0
,
charset
(),
variables
.
collation_connection
,
&
not_used
);
charset_is_character_set_filesystem
=
!
String
::
needs_conversion
(
0
,
charset
(),
variables
.
character_set_filesystem
,
&
not_used
);
}
...
...
sql/sql_class.h
View file @
fd4ab361
...
...
@@ -258,6 +258,7 @@ struct system_variables
my_bool
old_passwords
;
/* Only charset part of these variables is sensible */
CHARSET_INFO
*
character_set_filesystem
;
CHARSET_INFO
*
character_set_client
;
CHARSET_INFO
*
character_set_results
;
...
...
@@ -1126,6 +1127,7 @@ class THD :public Statement,
bool
query_error
,
bootstrap
,
cleanup_done
;
bool
tmp_table_used
;
bool
charset_is_system_charset
,
charset_is_collation_connection
;
bool
charset_is_character_set_filesystem
;
bool
enable_slow_log
;
/* enable slow log for current statement */
bool
no_trans_update
,
abort_on_warning
;
bool
got_warning
;
/* Set on call to push_warning() */
...
...
sql/sql_yacc.yy
View file @
fd4ab361
...
...
@@ -730,7 +730,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
LEX_HOSTNAME ULONGLONG_NUM field_ident select_alias ident ident_or_text
UNDERSCORE_CHARSET IDENT_sys TEXT_STRING_sys TEXT_STRING_literal
NCHAR_STRING opt_component key_cache_name
sp_opt_label BIN_NUM label_ident
sp_opt_label BIN_NUM label_ident
TEXT_STRING_filesystem
%type <lex_str_ptr>
opt_table_alias opt_fulltext_parser
...
...
@@ -7524,7 +7524,7 @@ select_var_ident:
;
into:
INTO OUTFILE TEXT_STRING_
sys
INTO OUTFILE TEXT_STRING_
filesystem
{
LEX *lex= Lex;
lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
...
...
@@ -7533,7 +7533,7 @@ into:
YYABORT;
}
opt_field_term opt_line_term
| INTO DUMPFILE TEXT_STRING_
sys
| INTO DUMPFILE TEXT_STRING_
filesystem
{
LEX *lex=Lex;
if (!lex->describe)
...
...
@@ -8596,7 +8596,7 @@ load: LOAD DATA_SYM
};
load_data:
load_data_lock opt_local INFILE TEXT_STRING_
sys
load_data_lock opt_local INFILE TEXT_STRING_
filesystem
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_LOAD;
...
...
@@ -9124,6 +9124,18 @@ TEXT_STRING_literal:
;
TEXT_STRING_filesystem:
TEXT_STRING
{
THD *thd= YYTHD;
if (thd->charset_is_character_set_filesystem)
$$= $1;
else
thd->convert_string(&$$, thd->variables.character_set_filesystem,
$1.str, $1.length, thd->charset());
}
;
ident:
IDENT_sys { $$=$1; }
| READ_ONLY_SYM
...
...
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