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
6688bfdb
Commit
6688bfdb
authored
Jul 12, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/bkroot/mysql-5.0
into mysql.com:/home/bk/mysql-5.0
parents
2e9d4bef
b7dde192
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
114 additions
and
46 deletions
+114
-46
include/my_global.h
include/my_global.h
+1
-4
include/mysql.h
include/mysql.h
+14
-0
libmysql/libmysql.c
libmysql/libmysql.c
+15
-0
libmysql/libmysql.def
libmysql/libmysql.def
+1
-0
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+11
-0
mysql-test/r/ndb_autodiscover.result
mysql-test/r/ndb_autodiscover.result
+0
-14
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+10
-0
mysql-test/t/ndb_autodiscover.test
mysql-test/t/ndb_autodiscover.test
+14
-13
ndb/include/mgmcommon/ConfigRetriever.hpp
ndb/include/mgmcommon/ConfigRetriever.hpp
+1
-0
ndb/src/common/mgmcommon/ConfigRetriever.cpp
ndb/src/common/mgmcommon/ConfigRetriever.cpp
+6
-0
ndb/src/mgmsrv/main.cpp
ndb/src/mgmsrv/main.cpp
+2
-1
sql/field_conv.cc
sql/field_conv.cc
+20
-13
tests/mysql_client_test.c
tests/mysql_client_test.c
+18
-0
vio/viossl.c
vio/viossl.c
+1
-1
No files found.
include/my_global.h
View file @
6688bfdb
...
...
@@ -396,10 +396,7 @@ int __void__;
#endif
/* Define some useful general macros */
#if defined(__cplusplus) && defined(__GNUC__)
#define max(a, b) ((a) >? (b))
#define min(a, b) ((a) <? (b))
#elif !defined(max)
#if !defined(max)
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#endif
...
...
include/mysql.h
View file @
6688bfdb
...
...
@@ -218,6 +218,18 @@ enum mysql_rpl_type
MYSQL_RPL_MASTER
,
MYSQL_RPL_SLAVE
,
MYSQL_RPL_ADMIN
};
typedef
struct
character_set
{
unsigned
int
number
;
/* character set number */
unsigned
int
state
;
/* character set state */
const
char
*
csname
;
/* collation name */
const
char
*
name
;
/* character set name */
const
char
*
comment
;
/* comment */
const
char
*
dir
;
/* character set directory */
unsigned
int
mbminlen
;
/* min. length for multibyte strings */
unsigned
int
mbmaxlen
;
/* max. length for multibyte strings */
}
MY_CHARSET_INFO
;
struct
st_mysql_methods
;
typedef
struct
st_mysql
...
...
@@ -418,6 +430,8 @@ my_bool STDCALL mysql_slave_query(MYSQL *mysql, const char *q,
unsigned
long
length
);
my_bool
STDCALL
mysql_slave_send_query
(
MYSQL
*
mysql
,
const
char
*
q
,
unsigned
long
length
);
void
STDCALL
mysql_get_character_set_info
(
MYSQL
*
mysql
,
MY_CHARSET_INFO
*
charset
);
/* local infile support */
...
...
libmysql/libmysql.c
View file @
6688bfdb
...
...
@@ -1495,6 +1495,21 @@ const char * STDCALL mysql_character_set_name(MYSQL *mysql)
return
mysql
->
charset
->
csname
;
}
void
STDCALL
mysql_get_character_set_info
(
MYSQL
*
mysql
,
MY_CHARSET_INFO
*
csinfo
)
{
csinfo
->
number
=
mysql
->
charset
->
number
;
csinfo
->
state
=
mysql
->
charset
->
state
;
csinfo
->
csname
=
mysql
->
charset
->
csname
;
csinfo
->
name
=
mysql
->
charset
->
name
;
csinfo
->
comment
=
mysql
->
charset
->
comment
;
csinfo
->
mbminlen
=
mysql
->
charset
->
mbminlen
;
csinfo
->
mbmaxlen
=
mysql
->
charset
->
mbmaxlen
;
if
(
mysql
->
options
.
charset_dir
)
csinfo
->
dir
=
mysql
->
options
.
charset_dir
;
else
csinfo
->
dir
=
charsets_dir
;
}
int
STDCALL
mysql_set_character_set
(
MYSQL
*
mysql
,
char
*
cs_name
)
{
...
...
libmysql/libmysql.def
View file @
6688bfdb
...
...
@@ -149,5 +149,6 @@ EXPORTS
mysql_server_init
mysql_server_end
mysql_set_character_set
mysql_get_character_set_info
get_defaults_files
modify_defaults_file
mysql-test/r/ctype_utf8.result
View file @
6688bfdb
...
...
@@ -939,6 +939,17 @@ content msisdn
ERR Имри.Афимим.Аеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ад.Д имдимримрад.Адимримримрмдиримримримр м.Дадимфшьмримд им.Адимимрн имадми 1234567890
11 g 1234567890
DROP TABLE t1,t2;
create table t1 (a char(20) character set utf8);
insert into t1 values ('123456'),('андрей');
alter table t1 modify a char(2) character set utf8;
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
Warning 1265 Data truncated for column 'a' at row 2
select char_length(a), length(a), a from t1 order by a;
char_length(a) length(a) a
2 2 12
2 4 ан
drop table t1;
CREATE TABLE t1 (
a varchar(255) NOT NULL default '',
KEY a (a)
...
...
mysql-test/r/ndb_autodiscover.result
View file @
6688bfdb
...
...
@@ -383,20 +383,6 @@ select * from t1;
ERROR HY000: Can't lock file (errno: 4009)
use test;
drop database test_only_ndb_tables;
CREATE TABLE sys.SYSTAB_0 (a int);
ERROR 42S01: Table 'SYSTAB_0' already exists
select * from sys.SYSTAB_0;
ERROR HY000: Failed to open 'SYSTAB_0', error while unpacking from engine
CREATE TABLE IF NOT EXISTS sys.SYSTAB_0 (a int);
show warnings;
Level Code Message
select * from sys.SYSTAB_0;
ERROR HY000: Failed to open 'SYSTAB_0', error while unpacking from engine
drop table sys.SYSTAB_0;
ERROR 42S02: Unknown table 'SYSTAB_0'
drop table IF EXISTS sys.SYSTAB_0;
Warnings:
Note 1051 Unknown table 'SYSTAB_0'
CREATE TABLE t9 (
a int NOT NULL PRIMARY KEY,
b int
...
...
mysql-test/t/ctype_utf8.test
View file @
6688bfdb
...
...
@@ -789,6 +789,16 @@ SELECT content, t2.msisdn FROM t1, t2 WHERE t1.msisdn = '1234567890';
DROP
TABLE
t1
,
t2
;
#
# Bug#11591: CHAR column with utf8 does not work properly
# (more chars than expected)
#
create
table
t1
(
a
char
(
20
)
character
set
utf8
);
insert
into
t1
values
(
'123456'
),(
'андрей'
);
alter
table
t1
modify
a
char
(
2
)
character
set
utf8
;
select
char_length
(
a
),
length
(
a
),
a
from
t1
order
by
a
;
drop
table
t1
;
#
# Bug#9557 MyISAM utf8 table crash
#
...
...
mysql-test/t/ndb_autodiscover.test
View file @
6688bfdb
...
...
@@ -501,19 +501,20 @@ drop database test_only_ndb_tables;
# a table with tha same name as a table that can't be
# discovered( for example a table created via NDBAPI)
--
error
1050
CREATE
TABLE
sys
.
SYSTAB_0
(
a
int
);
--
error
1105
select
*
from
sys
.
SYSTAB_0
;
CREATE
TABLE
IF
NOT
EXISTS
sys
.
SYSTAB_0
(
a
int
);
show
warnings
;
--
error
1105
select
*
from
sys
.
SYSTAB_0
;
--
error
1051
drop
table
sys
.
SYSTAB_0
;
drop
table
IF
EXISTS
sys
.
SYSTAB_0
;
# Test disabled since it doesn't work on case insensitive systems
#--error 1050
#CREATE TABLE sys.SYSTAB_0 (a int);
#--error 1105
#select * from sys.SYSTAB_0;
#CREATE TABLE IF NOT EXISTS sys.SYSTAB_0 (a int);
#show warnings;
#--error 1105
#select * from sys.SYSTAB_0;
#--error 1051
#drop table sys.SYSTAB_0;
#drop table IF EXISTS sys.SYSTAB_0;
######################################################
# Note! This should always be the last step in this
...
...
ndb/include/mgmcommon/ConfigRetriever.hpp
View file @
6688bfdb
...
...
@@ -32,6 +32,7 @@ public:
~
ConfigRetriever
();
int
do_connect
(
int
no_retries
,
int
retry_delay_in_seconds
,
int
verbose
);
int
disconnect
();
/**
* Get configuration for current node.
...
...
ndb/src/common/mgmcommon/ConfigRetriever.cpp
View file @
6688bfdb
...
...
@@ -107,6 +107,12 @@ ConfigRetriever::do_connect(int no_retries,
0
:
-
1
;
}
int
ConfigRetriever
::
disconnect
()
{
return
ndb_mgm_disconnect
(
m_handle
);
}
//****************************************************************************
//****************************************************************************
//****************************************************************************
...
...
ndb/src/mgmsrv/main.cpp
View file @
6688bfdb
...
...
@@ -353,7 +353,8 @@ int main(int argc, char** argv)
g_eventLogger
.
info
(
"Shutting down server..."
);
glob
.
socketServer
->
stopServer
();
glob
.
socketServer
->
stopSessions
();
glob
.
mgmObject
->
get_config_retriever
()
->
disconnect
();
glob
.
socketServer
->
stopSessions
(
true
);
g_eventLogger
.
info
(
"Shutdown complete"
);
return
0
;
error_end:
...
...
sql/field_conv.cc
View file @
6688bfdb
...
...
@@ -324,21 +324,28 @@ static void do_field_real(Copy_field *copy)
static
void
do_cut_string
(
Copy_field
*
copy
)
{
// Shorter string field
memcpy
(
copy
->
to_ptr
,
copy
->
from_ptr
,
copy
->
to_length
);
/* Check if we loosed any important characters */
char
*
ptr
,
*
end
;
for
(
ptr
=
copy
->
from_ptr
+
copy
->
to_length
,
end
=
copy
->
from_ptr
+
copy
->
from_length
;
ptr
!=
end
;
ptr
++
)
int
well_formed_error
;
CHARSET_INFO
*
cs
=
copy
->
from_field
->
charset
();
const
char
*
from_end
=
copy
->
from_ptr
+
copy
->
from_length
;
uint
copy_length
=
cs
->
cset
->
well_formed_len
(
cs
,
copy
->
from_ptr
,
from_end
,
copy
->
to_length
/
cs
->
mbmaxlen
,
&
well_formed_error
);
if
(
copy
->
to_length
<
copy_length
)
copy_length
=
copy
->
to_length
;
memcpy
(
copy
->
to_ptr
,
copy
->
from_ptr
,
copy_length
);
/* Check if we lost any important characters */
if
(
well_formed_error
||
cs
->
cset
->
scan
(
cs
,
copy
->
from_ptr
+
copy_length
,
from_end
,
MY_SEQ_SPACES
)
<
(
copy
->
from_length
-
copy_length
))
{
if
(
!
my_isspace
(
system_charset_info
,
*
ptr
))
// QQ: ucs incompatible
{
copy
->
to_field
->
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
1
);
break
;
}
copy
->
to_field
->
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
WARN_DATA_TRUNCATED
,
1
);
}
if
(
copy_length
<
copy
->
to_length
)
cs
->
cset
->
fill
(
cs
,
copy
->
to_ptr
+
copy_length
,
copy
->
to_length
-
copy_length
,
' '
);
}
...
...
tests/mysql_client_test.c
View file @
6688bfdb
...
...
@@ -13626,6 +13626,23 @@ static void test_bug10214()
mysql_query
(
mysql
,
"set sql_mode=''"
);
}
static
void
test_client_character_set
()
{
MY_CHARSET_INFO
cs
;
const
char
*
csname
;
int
rc
;
myheader
(
"test_client_character_set"
);
csname
=
"utf8"
;
rc
=
mysql_set_character_set
(
mysql
,
csname
);
DIE_UNLESS
(
rc
==
0
);
mysql_get_character_set_info
(
mysql
,
&
cs
);
DIE_UNLESS
(
!
strcmp
(
cs
.
csname
,
"utf8"
));
DIE_UNLESS
(
!
strcmp
(
cs
.
name
,
"utf8_general_ci"
));
}
/*
Read and parse arguments and MySQL options from my.cnf
...
...
@@ -13850,6 +13867,7 @@ static struct my_tests_st my_tests[]= {
{
"test_cursors_with_union"
,
test_cursors_with_union
},
{
"test_truncation"
,
test_truncation
},
{
"test_truncation_option"
,
test_truncation_option
},
{
"test_client_character_set"
,
test_client_character_set
},
{
"test_bug8330"
,
test_bug8330
},
{
"test_bug7990"
,
test_bug7990
},
{
"test_bug8378"
,
test_bug8378
},
...
...
vio/viossl.c
View file @
6688bfdb
...
...
@@ -316,7 +316,7 @@ int sslaccept(struct st_VioSSLAcceptorFd* ptr, Vio* vio, long timeout)
vio_blocking
(
vio
,
net_blocking
,
&
unused
);
DBUG_RETURN
(
1
);
}
#ifndef DBU
F
_OFF
#ifndef DBU
G
_OFF
DBUG_PRINT
(
"info"
,(
"SSL_get_cipher_name() = '%s'"
,
SSL_get_cipher_name
((
SSL
*
)
vio
->
ssl_arg
)));
client_cert
=
SSL_get_peer_certificate
((
SSL
*
)
vio
->
ssl_arg
);
...
...
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