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
147afc0f
Commit
147afc0f
authored
Feb 04, 2004
by
bar@bar.intranet.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Client character set is now not set from the server value.
parent
7e9944d3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
38 deletions
+30
-38
mysql-test/r/ctype_latin1_de.result
mysql-test/r/ctype_latin1_de.result
+2
-0
mysql-test/t/ctype_latin1_de.test
mysql-test/t/ctype_latin1_de.test
+3
-0
sql-common/client.c
sql-common/client.c
+25
-38
No files found.
mysql-test/r/ctype_latin1_de.result
View file @
147afc0f
set names latin1;
set @@collation_connection=latin1_german2_ci;
select @@collation_connection;
select @@collation_connection;
@@collation_connection
@@collation_connection
latin1_german2_ci
latin1_german2_ci
...
...
mysql-test/t/ctype_latin1_de.test
View file @
147afc0f
...
@@ -2,6 +2,9 @@
...
@@ -2,6 +2,9 @@
# Test latin_de character set
# Test latin_de character set
#
#
set
names
latin1
;
set
@@
collation_connection
=
latin1_german2_ci
;
select
@@
collation_connection
;
select
@@
collation_connection
;
--
disable_warnings
--
disable_warnings
...
...
sql-common/client.c
View file @
147afc0f
...
@@ -1429,14 +1429,13 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
...
@@ -1429,14 +1429,13 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
const
char
*
passwd
,
const
char
*
db
,
const
char
*
passwd
,
const
char
*
db
,
uint
port
,
const
char
*
unix_socket
,
ulong
client_flag
)
uint
port
,
const
char
*
unix_socket
,
ulong
client_flag
)
{
{
char
buff
[
NAME_LEN
+
USERNAME_LENGTH
+
100
]
,
charset_name_buff
[
16
]
;
char
buff
[
NAME_LEN
+
USERNAME_LENGTH
+
100
];
char
*
end
,
*
host_info
,
*
charset_name
;
char
*
end
,
*
host_info
;
my_socket
sock
;
my_socket
sock
;
in_addr_t
ip_addr
;
in_addr_t
ip_addr
;
struct
sockaddr_in
sock_addr
;
struct
sockaddr_in
sock_addr
;
ulong
pkt_length
;
ulong
pkt_length
;
NET
*
net
=
&
mysql
->
net
;
NET
*
net
=
&
mysql
->
net
;
uint
charset_number
;
#ifdef MYSQL_SERVER
#ifdef MYSQL_SERVER
thr_alarm_t
alarmed
;
thr_alarm_t
alarmed
;
ALARM
alarm_buff
;
ALARM
alarm_buff
;
...
@@ -1762,10 +1761,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
...
@@ -1762,10 +1761,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
goto
error
;
goto
error
;
}
}
charset_number
=
mysql
->
server_language
;
/* Set character set */
/* Set character set */
if
(
(
charset_name
=
mysql
->
options
.
charset_name
)
)
if
(
mysql
->
options
.
charset_name
)
{
{
const
char
*
save
=
charsets_dir
;
const
char
*
save
=
charsets_dir
;
if
(
mysql
->
options
.
charset_dir
)
if
(
mysql
->
options
.
charset_dir
)
...
@@ -1773,44 +1770,34 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
...
@@ -1773,44 +1770,34 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
mysql
->
charset
=
get_charset_by_csname
(
mysql
->
options
.
charset_name
,
mysql
->
charset
=
get_charset_by_csname
(
mysql
->
options
.
charset_name
,
MY_CS_PRIMARY
,
MY_CS_PRIMARY
,
MYF
(
MY_WME
));
MYF
(
MY_WME
));
charset_number
=
mysql
->
charset
?
mysql
->
charset
->
number
:
0
;
charsets_dir
=
save
;
charsets_dir
=
save
;
}
else
if
(
mysql
->
server_language
)
{
charset_name
=
charset_name_buff
;
/* Save name in case of errors */
int10_to_str
(
mysql
->
server_language
,
charset_name
,
10
);
if
(
!
(
mysql
->
charset
=
get_charset
((
uint8
)
mysql
->
server_language
,
MYF
(
0
))))
mysql
->
charset
=
default_charset_info
;
/* shouldn't be fatal */
}
else
{
mysql
->
charset
=
default_charset_info
;
charset_number
=
mysql
->
charset
->
number
;
}
if
(
!
mysql
->
charset
)
if
(
!
mysql
->
charset
)
{
net
->
last_errno
=
CR_CANT_READ_CHARSET
;
strmov
(
net
->
sqlstate
,
unknown_sqlstate
);
if
(
mysql
->
options
.
charset_dir
)
my_snprintf
(
net
->
last_error
,
sizeof
(
net
->
last_error
)
-
1
,
ER
(
net
->
last_errno
),
charset_name
?
charset_name
:
"unknown"
,
mysql
->
options
.
charset_dir
);
else
{
{
char
cs_dir_name
[
FN_REFLEN
];
net
->
last_errno
=
CR_CANT_READ_CHARSET
;
get_charsets_dir
(
cs_dir_name
);
strmov
(
net
->
sqlstate
,
unknown_sqlstate
);
my_snprintf
(
net
->
last_error
,
sizeof
(
net
->
last_error
)
-
1
,
if
(
mysql
->
options
.
charset_dir
)
my_snprintf
(
net
->
last_error
,
sizeof
(
net
->
last_error
)
-
1
,
ER
(
net
->
last_errno
),
mysql
->
options
.
charset_name
,
mysql
->
options
.
charset_dir
);
else
{
char
cs_dir_name
[
FN_REFLEN
];
get_charsets_dir
(
cs_dir_name
);
my_snprintf
(
net
->
last_error
,
sizeof
(
net
->
last_error
)
-
1
,
ER
(
net
->
last_errno
),
ER
(
net
->
last_errno
),
charset_name
?
charset_name
:
"unknown"
,
mysql
->
options
.
charset_name
,
cs_dir_name
);
cs_dir_name
);
}
goto
error
;
}
}
goto
error
;
}
}
else
{
mysql
->
charset
=
default_charset_info
;
}
/* Save connection information */
/* Save connection information */
if
(
!
my_multi_malloc
(
MYF
(
0
),
if
(
!
my_multi_malloc
(
MYF
(
0
),
...
@@ -1870,7 +1857,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
...
@@ -1870,7 +1857,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
/* 4.1 server and 4.1 client has a 32 byte option flag */
/* 4.1 server and 4.1 client has a 32 byte option flag */
int4store
(
buff
,
client_flag
);
int4store
(
buff
,
client_flag
);
int4store
(
buff
+
4
,
net
->
max_packet_size
);
int4store
(
buff
+
4
,
net
->
max_packet_size
);
buff
[
8
]
=
(
char
)
charset_
number
;
buff
[
8
]
=
(
char
)
mysql
->
charset
->
number
;
bzero
(
buff
+
9
,
32
-
9
);
bzero
(
buff
+
9
,
32
-
9
);
end
=
buff
+
32
;
end
=
buff
+
32
;
}
}
...
...
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