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
52a1639b
Commit
52a1639b
authored
Jun 30, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into moonbone.local:/work/merge-4.1
parents
1ae69b6b
3c79d36a
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
244 additions
and
163 deletions
+244
-163
include/sql_common.h
include/sql_common.h
+1
-0
libmysqld/lib_sql.cc
libmysqld/lib_sql.cc
+7
-0
libmysqld/libmysqld.c
libmysqld/libmysqld.c
+3
-45
mysql-test/r/func_sapdb.result
mysql-test/r/func_sapdb.result
+6
-0
mysql-test/r/func_time.result
mysql-test/r/func_time.result
+6
-0
mysql-test/r/gis.result
mysql-test/r/gis.result
+10
-0
mysql-test/r/key.result
mysql-test/r/key.result
+10
-0
mysql-test/r/symlink.result
mysql-test/r/symlink.result
+6
-0
mysql-test/t/func_sapdb.test
mysql-test/t/func_sapdb.test
+2
-0
mysql-test/t/func_time.test
mysql-test/t/func_time.test
+6
-0
mysql-test/t/gis.test
mysql-test/t/gis.test
+7
-0
mysql-test/t/key.test
mysql-test/t/key.test
+11
-0
ndb/src/mgmsrv/ConfigInfo.cpp
ndb/src/mgmsrv/ConfigInfo.cpp
+1
-1
scripts/make_binary_distribution.sh
scripts/make_binary_distribution.sh
+14
-4
sql-common/client.c
sql-common/client.c
+48
-36
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+59
-24
sql/item_geofunc.h
sql/item_geofunc.h
+2
-0
sql/item_timefunc.cc
sql/item_timefunc.cc
+6
-5
sql/sql_parse.cc
sql/sql_parse.cc
+38
-27
sql/table.cc
sql/table.cc
+0
-21
support-files/mysql.spec.sh
support-files/mysql.spec.sh
+1
-0
No files found.
include/sql_common.h
View file @
52a1639b
...
@@ -22,6 +22,7 @@ extern const char *not_error_sqlstate;
...
@@ -22,6 +22,7 @@ extern const char *not_error_sqlstate;
extern
"C"
{
extern
"C"
{
#endif
#endif
extern
CHARSET_INFO
*
default_client_charset_info
;
MYSQL_FIELD
*
unpack_fields
(
MYSQL_DATA
*
data
,
MEM_ROOT
*
alloc
,
uint
fields
,
MYSQL_FIELD
*
unpack_fields
(
MYSQL_DATA
*
data
,
MEM_ROOT
*
alloc
,
uint
fields
,
my_bool
default_value
,
uint
server_capabilities
);
my_bool
default_value
,
uint
server_capabilities
);
void
free_rows
(
MYSQL_DATA
*
cur
);
void
free_rows
(
MYSQL_DATA
*
cur
);
...
...
libmysqld/lib_sql.cc
View file @
52a1639b
...
@@ -41,6 +41,8 @@ static const char *fake_groups[] = { "server", "embedded", 0 };
...
@@ -41,6 +41,8 @@ static const char *fake_groups[] = { "server", "embedded", 0 };
int
check_user
(
THD
*
thd
,
enum
enum_server_command
command
,
int
check_user
(
THD
*
thd
,
enum
enum_server_command
command
,
const
char
*
passwd
,
uint
passwd_len
,
const
char
*
db
,
const
char
*
passwd
,
uint
passwd_len
,
const
char
*
db
,
bool
check_count
);
bool
check_count
);
void
thd_init_client_charset
(
THD
*
thd
,
uint
cs_number
);
C_MODE_START
C_MODE_START
#include <mysql.h>
#include <mysql.h>
#undef ER
#undef ER
...
@@ -532,10 +534,13 @@ err:
...
@@ -532,10 +534,13 @@ err:
return
NULL
;
return
NULL
;
}
}
#ifdef NO_EMBEDDED_ACCESS_CHECKS
#ifdef NO_EMBEDDED_ACCESS_CHECKS
int
check_embedded_connection
(
MYSQL
*
mysql
)
int
check_embedded_connection
(
MYSQL
*
mysql
)
{
{
THD
*
thd
=
(
THD
*
)
mysql
->
thd
;
THD
*
thd
=
(
THD
*
)
mysql
->
thd
;
thd_init_client_charset
(
thd
,
mysql
->
charset
->
number
);
thd
->
update_charset
();
thd
->
host
=
(
char
*
)
my_localhost
;
thd
->
host
=
(
char
*
)
my_localhost
;
thd
->
host_or_ip
=
thd
->
host
;
thd
->
host_or_ip
=
thd
->
host
;
thd
->
user
=
my_strdup
(
mysql
->
user
,
MYF
(
0
));
thd
->
user
=
my_strdup
(
mysql
->
user
,
MYF
(
0
));
...
@@ -551,6 +556,8 @@ int check_embedded_connection(MYSQL *mysql)
...
@@ -551,6 +556,8 @@ int check_embedded_connection(MYSQL *mysql)
char
scramble_buff
[
SCRAMBLE_LENGTH
];
char
scramble_buff
[
SCRAMBLE_LENGTH
];
int
passwd_len
;
int
passwd_len
;
thd_init_client_charset
(
thd
,
mysql
->
charset
->
number
);
thd
->
update_charset
();
if
(
mysql
->
options
.
client_ip
)
if
(
mysql
->
options
.
client_ip
)
{
{
thd
->
host
=
my_strdup
(
mysql
->
options
.
client_ip
,
MYF
(
0
));
thd
->
host
=
my_strdup
(
mysql
->
options
.
client_ip
,
MYF
(
0
));
...
...
libmysqld/libmysqld.c
View file @
52a1639b
...
@@ -85,49 +85,7 @@ static void end_server(MYSQL *mysql)
...
@@ -85,49 +85,7 @@ static void end_server(MYSQL *mysql)
}
}
static
int
mysql_init_charset
(
MYSQL
*
mysql
)
int
mysql_init_character_set
(
MYSQL
*
mysql
);
{
char
charset_name_buff
[
16
],
*
charset_name
;
if
((
charset_name
=
mysql
->
options
.
charset_name
))
{
const
char
*
save
=
charsets_dir
;
if
(
mysql
->
options
.
charset_dir
)
charsets_dir
=
mysql
->
options
.
charset_dir
;
mysql
->
charset
=
get_charset_by_name
(
mysql
->
options
.
charset_name
,
MYF
(
MY_WME
));
charsets_dir
=
save
;
}
else
if
(
mysql
->
server_language
)
{
charset_name
=
charset_name_buff
;
sprintf
(
charset_name
,
"%d"
,
mysql
->
server_language
);
/* In case of errors */
mysql
->
charset
=
get_charset
((
uint8
)
mysql
->
server_language
,
MYF
(
MY_WME
));
}
else
mysql
->
charset
=
default_charset_info
;
if
(
!
mysql
->
charset
)
{
mysql
->
net
.
last_errno
=
CR_CANT_READ_CHARSET
;
strmov
(
mysql
->
net
.
sqlstate
,
"HY0000"
);
if
(
mysql
->
options
.
charset_dir
)
sprintf
(
mysql
->
net
.
last_error
,
ER
(
mysql
->
net
.
last_errno
),
charset_name
?
charset_name
:
"unknown"
,
mysql
->
options
.
charset_dir
);
else
{
char
cs_dir_name
[
FN_REFLEN
];
get_charsets_dir
(
cs_dir_name
);
sprintf
(
mysql
->
net
.
last_error
,
ER
(
mysql
->
net
.
last_errno
),
charset_name
?
charset_name
:
"unknown"
,
cs_dir_name
);
}
return
mysql
->
net
.
last_errno
;
}
return
0
;
}
MYSQL
*
STDCALL
MYSQL
*
STDCALL
mysql_real_connect
(
MYSQL
*
mysql
,
const
char
*
host
,
const
char
*
user
,
mysql_real_connect
(
MYSQL
*
mysql
,
const
char
*
host
,
const
char
*
user
,
...
@@ -203,10 +161,10 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
...
@@ -203,10 +161,10 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
init_embedded_mysql
(
mysql
,
client_flag
,
db_name
);
init_embedded_mysql
(
mysql
,
client_flag
,
db_name
);
if
(
check_embedded_connection
(
mysql
))
if
(
mysql_init_character_set
(
mysql
))
goto
error
;
goto
error
;
if
(
mysql_init_charset
(
mysql
))
if
(
check_embedded_connection
(
mysql
))
goto
error
;
goto
error
;
/* Send client information for access check */
/* Send client information for access check */
...
...
mysql-test/r/func_sapdb.result
View file @
52a1639b
...
@@ -71,6 +71,12 @@ makedate(1997,1)
...
@@ -71,6 +71,12 @@ makedate(1997,1)
select makedate(1997,0);
select makedate(1997,0);
makedate(1997,0)
makedate(1997,0)
NULL
NULL
select makedate(9999,365);
makedate(9999,365)
9999-12-31
select makedate(9999,366);
makedate(9999,366)
NULL
select addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002");
select addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002");
addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002")
addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002")
1998-01-02 01:01:01.000001
1998-01-02 01:01:01.000001
...
...
mysql-test/r/func_time.result
View file @
52a1639b
...
@@ -352,6 +352,12 @@ extract(SECOND FROM "1999-01-02 10:11:12")
...
@@ -352,6 +352,12 @@ extract(SECOND FROM "1999-01-02 10:11:12")
select extract(MONTH FROM "2001-02-00");
select extract(MONTH FROM "2001-02-00");
extract(MONTH FROM "2001-02-00")
extract(MONTH FROM "2001-02-00")
2
2
SELECT DATE_SUB(str_to_date('9999-12-31 00:01:00','%Y-%m-%d %H:%i:%s'), INTERVAL 1 MINUTE);
DATE_SUB(str_to_date('9999-12-31 00:01:00','%Y-%m-%d %H:%i:%s'), INTERVAL 1 MINUTE)
9999-12-31 00:00:00
SELECT DATE_ADD(str_to_date('9999-12-30 23:59:00','%Y-%m-%d %H:%i:%s'), INTERVAL 1 MINUTE);
DATE_ADD(str_to_date('9999-12-30 23:59:00','%Y-%m-%d %H:%i:%s'), INTERVAL 1 MINUTE)
9999-12-31 00:00:00
SELECT "1900-01-01 00:00:00" + INTERVAL 2147483648 SECOND;
SELECT "1900-01-01 00:00:00" + INTERVAL 2147483648 SECOND;
"1900-01-01 00:00:00" + INTERVAL 2147483648 SECOND
"1900-01-01 00:00:00" + INTERVAL 2147483648 SECOND
1968-01-20 03:14:08
1968-01-20 03:14:08
...
...
mysql-test/r/gis.result
View file @
52a1639b
...
@@ -661,3 +661,13 @@ POINT(10 10)
...
@@ -661,3 +661,13 @@ POINT(10 10)
select (asWKT(geomfromwkb((0x010100000000000000000024400000000000002440))));
select (asWKT(geomfromwkb((0x010100000000000000000024400000000000002440))));
(asWKT(geomfromwkb((0x010100000000000000000024400000000000002440))))
(asWKT(geomfromwkb((0x010100000000000000000024400000000000002440))))
POINT(10 10)
POINT(10 10)
create table t1 (g GEOMETRY);
select * from t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 t1 g g 255 4294967295 0 Y 144 0 63
g
select asbinary(g) from t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def asbinary(g) 252 8192 0 Y 128 0 63
asbinary(g)
drop table t1;
mysql-test/r/key.result
View file @
52a1639b
...
@@ -326,6 +326,16 @@ alter table t1 add key (c1,c1,c2);
...
@@ -326,6 +326,16 @@ alter table t1 add key (c1,c1,c2);
ERROR 42S21: Duplicate column name 'c1'
ERROR 42S21: Duplicate column name 'c1'
drop table t1;
drop table t1;
create table t1 (
create table t1 (
i1 INT NOT NULL,
i2 INT NOT NULL,
UNIQUE i1idx (i1),
UNIQUE i2idx (i2));
desc t1;
Field Type Null Key Default Extra
i1 int(11) UNI 0
i2 int(11) UNI 0
drop table t1;
create table t1 (
c1 int,
c1 int,
c2 varchar(20) not null,
c2 varchar(20) not null,
primary key (c1),
primary key (c1),
...
...
mysql-test/r/symlink.result
View file @
52a1639b
...
@@ -65,18 +65,24 @@ t9 CREATE TABLE `t9` (
...
@@ -65,18 +65,24 @@ t9 CREATE TABLE `t9` (
) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/'
) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/'
drop database mysqltest;
drop database mysqltest;
create table t1 (a int not null) engine=myisam;
create table t1 (a int not null) engine=myisam;
Warnings:
Warning 0 DATA DIRECTORY option ignored
show create table t1;
show create table t1;
Table Create Table
Table Create Table
t1 CREATE TABLE `t1` (
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0'
`a` int(11) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t1 add b int;
alter table t1 add b int;
Warnings:
Warning 0 DATA DIRECTORY option ignored
show create table t1;
show create table t1;
Table Create Table
Table Create Table
t1 CREATE TABLE `t1` (
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0',
`a` int(11) NOT NULL default '0',
`b` int(11) default NULL
`b` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
Warnings:
Warning 0 INDEX DIRECTORY option ignored
show create table t1;
show create table t1;
Table Create Table
Table Create Table
t1 CREATE TABLE `t1` (
t1 CREATE TABLE `t1` (
...
...
mysql-test/t/func_sapdb.test
View file @
52a1639b
...
@@ -37,6 +37,8 @@ select weekofyear("1997-11-31 23:59:59.000001");
...
@@ -37,6 +37,8 @@ select weekofyear("1997-11-31 23:59:59.000001");
select
makedate
(
1997
,
1
);
select
makedate
(
1997
,
1
);
select
makedate
(
1997
,
0
);
select
makedate
(
1997
,
0
);
select
makedate
(
9999
,
365
);
select
makedate
(
9999
,
366
);
#Time functions
#Time functions
...
...
mysql-test/t/func_time.test
View file @
52a1639b
...
@@ -139,6 +139,12 @@ select extract(MINUTE_SECOND FROM "10:11:12");
...
@@ -139,6 +139,12 @@ select extract(MINUTE_SECOND FROM "10:11:12");
select
extract
(
SECOND
FROM
"1999-01-02 10:11:12"
);
select
extract
(
SECOND
FROM
"1999-01-02 10:11:12"
);
select
extract
(
MONTH
FROM
"2001-02-00"
);
select
extract
(
MONTH
FROM
"2001-02-00"
);
#
# MySQL Bugs: #12356: DATE_SUB or DATE_ADD incorrectly returns null
#
SELECT
DATE_SUB
(
str_to_date
(
'9999-12-31 00:01:00'
,
'%Y-%m-%d %H:%i:%s'
),
INTERVAL
1
MINUTE
);
SELECT
DATE_ADD
(
str_to_date
(
'9999-12-30 23:59:00'
,
'%Y-%m-%d %H:%i:%s'
),
INTERVAL
1
MINUTE
);
#
#
# Test big intervals (Bug #3498)
# Test big intervals (Bug #3498)
#
#
...
...
mysql-test/t/gis.test
View file @
52a1639b
...
@@ -364,3 +364,10 @@ select (asWKT(geomfromwkb((0x000000000140240000000000004024000000000000))));
...
@@ -364,3 +364,10 @@ select (asWKT(geomfromwkb((0x000000000140240000000000004024000000000000))));
select
(
asWKT
(
geomfromwkb
((
0x010100000000000000000024400000000000002440
))));
select
(
asWKT
(
geomfromwkb
((
0x010100000000000000000024400000000000002440
))));
# End of 4.1 tests
# End of 4.1 tests
--
enable_metadata
create
table
t1
(
g
GEOMETRY
);
select
*
from
t1
;
select
asbinary
(
g
)
from
t1
;
--
disable_metadata
drop
table
t1
;
mysql-test/t/key.test
View file @
52a1639b
...
@@ -321,6 +321,17 @@ alter table t1 add key (c1,c2,c1);
...
@@ -321,6 +321,17 @@ alter table t1 add key (c1,c2,c1);
alter
table
t1
add
key
(
c1
,
c1
,
c2
);
alter
table
t1
add
key
(
c1
,
c1
,
c2
);
drop
table
t1
;
drop
table
t1
;
#
# Bug#11228: DESC shows arbitrary column as "PRI"
#
create
table
t1
(
i1
INT
NOT
NULL
,
i2
INT
NOT
NULL
,
UNIQUE
i1idx
(
i1
),
UNIQUE
i2idx
(
i2
));
desc
t1
;
drop
table
t1
;
#
#
# Bug#12565 - ERROR 1034 when running simple UPDATE or DELETE
# Bug#12565 - ERROR 1034 when running simple UPDATE or DELETE
# on large MyISAM table
# on large MyISAM table
...
...
ndb/src/mgmsrv/ConfigInfo.cpp
View file @
52a1639b
...
@@ -857,7 +857,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
...
@@ -857,7 +857,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false
,
false
,
ConfigInfo
::
CI_INT
,
ConfigInfo
::
CI_INT
,
"8"
,
"8"
,
"
1
"
,
"
3
"
,
STR_VALUE
(
MAX_INT_RNIL
)
},
STR_VALUE
(
MAX_INT_RNIL
)
},
{
{
...
...
scripts/make_binary_distribution.sh
View file @
52a1639b
...
@@ -162,11 +162,21 @@ if [ $BASE_SYSTEM = "netware" ] ; then
...
@@ -162,11 +162,21 @@ if [ $BASE_SYSTEM = "netware" ] ; then
fi
fi
copyfileto
$BASE
/lib
\
copyfileto
$BASE
/lib
\
libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so
*
\
libmysql/.libs/libmysqlclient.a
\
libmysql/libmysqlclient.
*
libmysql_r/.libs/libmysqlclient_r.a
\
libmysql/.libs/libmysqlclient.so
*
\
libmysql_r/.libs/libmysqlclient_r.so
*
libmysql_r/libmysqlclient_r.
*
\
libmysql/.libs/libmysqlclient.sl
*
\
libmysql/.libs/libmysqlclient
*
.dylib
\
libmysql/libmysqlclient.
*
\
libmysql_r/.libs/libmysqlclient_r.a
\
libmysql_r/.libs/libmysqlclient_r.so
*
\
libmysql_r/.libs/libmysqlclient_r.sl
*
\
libmysql_r/.libs/libmysqlclient_r
*
.dylib
\
libmysql_r/libmysqlclient_r.
*
\
libmysqld/.libs/libmysqld.a
\
libmysqld/.libs/libmysqld.so
*
\
libmysqld/.libs/libmysqld.sl
*
\
libmysqld/.libs/libmysqld
*
.dylib
\
mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a
\
mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a
\
libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so
*
\
libmysqld/libmysqld.a netware/libmysql.imp
\
libmysqld/libmysqld.a netware/libmysql.imp
\
zlib/.libs/libz.a
zlib/.libs/libz.a
...
...
sql-common/client.c
View file @
52a1639b
...
@@ -133,6 +133,8 @@ static void mysql_close_free(MYSQL *mysql);
...
@@ -133,6 +133,8 @@ static void mysql_close_free(MYSQL *mysql);
static
int
wait_for_data
(
my_socket
fd
,
uint
timeout
);
static
int
wait_for_data
(
my_socket
fd
,
uint
timeout
);
#endif
#endif
CHARSET_INFO
*
default_client_charset_info
=
&
my_charset_latin1
;
/****************************************************************************
/****************************************************************************
A modified version of connect(). my_connect() allows you to specify
A modified version of connect(). my_connect() allows you to specify
...
@@ -1424,7 +1426,7 @@ mysql_init(MYSQL *mysql)
...
@@ -1424,7 +1426,7 @@ mysql_init(MYSQL *mysql)
bzero
((
char
*
)
(
mysql
),
sizeof
(
*
(
mysql
)));
bzero
((
char
*
)
(
mysql
),
sizeof
(
*
(
mysql
)));
mysql
->
options
.
connect_timeout
=
CONNECT_TIMEOUT
;
mysql
->
options
.
connect_timeout
=
CONNECT_TIMEOUT
;
mysql
->
last_used_con
=
mysql
->
next_slave
=
mysql
->
master
=
mysql
;
mysql
->
last_used_con
=
mysql
->
next_slave
=
mysql
->
master
=
mysql
;
mysql
->
charset
=
default_charset_info
;
mysql
->
charset
=
default_c
lient_c
harset_info
;
strmov
(
mysql
->
net
.
sqlstate
,
not_error_sqlstate
);
strmov
(
mysql
->
net
.
sqlstate
,
not_error_sqlstate
);
/*
/*
By default, we are a replication pivot. The caller must reset it
By default, we are a replication pivot. The caller must reset it
...
@@ -1537,6 +1539,50 @@ static MYSQL_METHODS client_methods=
...
@@ -1537,6 +1539,50 @@ static MYSQL_METHODS client_methods=
#endif
#endif
};
};
C_MODE_START
int
mysql_init_character_set
(
MYSQL
*
mysql
)
{
NET
*
net
=
&
mysql
->
net
;
/* Set character set */
if
(
!
mysql
->
options
.
charset_name
&&
!
(
mysql
->
options
.
charset_name
=
my_strdup
(
MYSQL_DEFAULT_CHARSET_NAME
,
MYF
(
MY_WME
))))
return
1
;
{
const
char
*
save
=
charsets_dir
;
if
(
mysql
->
options
.
charset_dir
)
charsets_dir
=
mysql
->
options
.
charset_dir
;
mysql
->
charset
=
get_charset_by_csname
(
mysql
->
options
.
charset_name
,
MY_CS_PRIMARY
,
MYF
(
MY_WME
));
charsets_dir
=
save
;
}
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
),
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
),
mysql
->
options
.
charset_name
,
cs_dir_name
);
}
return
1
;
}
return
0
;
}
C_MODE_END
MYSQL
*
STDCALL
MYSQL
*
STDCALL
CLI_MYSQL_REAL_CONNECT
(
MYSQL
*
mysql
,
const
char
*
host
,
const
char
*
user
,
CLI_MYSQL_REAL_CONNECT
(
MYSQL
*
mysql
,
const
char
*
host
,
const
char
*
user
,
const
char
*
passwd
,
const
char
*
db
,
const
char
*
passwd
,
const
char
*
db
,
...
@@ -1875,42 +1921,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
...
@@ -1875,42 +1921,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
goto
error
;
goto
error
;
}
}
/* Set character set */
if
(
mysql_init_character_set
(
mysql
))
if
(
!
mysql
->
options
.
charset_name
&&
!
(
mysql
->
options
.
charset_name
=
my_strdup
(
MYSQL_DEFAULT_CHARSET_NAME
,
MYF
(
MY_WME
))))
goto
error
;
{
const
char
*
save
=
charsets_dir
;
if
(
mysql
->
options
.
charset_dir
)
charsets_dir
=
mysql
->
options
.
charset_dir
;
mysql
->
charset
=
get_charset_by_csname
(
mysql
->
options
.
charset_name
,
MY_CS_PRIMARY
,
MYF
(
MY_WME
));
charsets_dir
=
save
;
}
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
),
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
),
mysql
->
options
.
charset_name
,
cs_dir_name
);
}
goto
error
;
goto
error
;
}
/* Save connection information */
/* Save connection information */
if
(
!
my_multi_malloc
(
MYF
(
0
),
if
(
!
my_multi_malloc
(
MYF
(
0
),
...
...
sql/ha_ndbcluster.cc
View file @
52a1639b
...
@@ -270,6 +270,7 @@ void ha_ndbcluster::records_update()
...
@@ -270,6 +270,7 @@ void ha_ndbcluster::records_update()
{
{
Ndb
*
ndb
=
get_ndb
();
Ndb
*
ndb
=
get_ndb
();
Uint64
rows
;
Uint64
rows
;
ndb
->
setDatabaseName
(
m_dbname
);
if
(
ndb_get_table_statistics
(
ndb
,
m_tabname
,
&
rows
,
0
)
==
0
){
if
(
ndb_get_table_statistics
(
ndb
,
m_tabname
,
&
rows
,
0
)
==
0
){
info
->
records
=
rows
;
info
->
records
=
rows
;
}
}
...
@@ -2876,6 +2877,7 @@ void ha_ndbcluster::info(uint flag)
...
@@ -2876,6 +2877,7 @@ void ha_ndbcluster::info(uint flag)
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
Ndb
*
ndb
=
get_ndb
();
Ndb
*
ndb
=
get_ndb
();
Uint64
rows
=
100
;
Uint64
rows
=
100
;
ndb
->
setDatabaseName
(
m_dbname
);
if
(
current_thd
->
variables
.
ndb_use_exact_count
)
if
(
current_thd
->
variables
.
ndb_use_exact_count
)
ndb_get_table_statistics
(
ndb
,
m_tabname
,
&
rows
,
0
);
ndb_get_table_statistics
(
ndb
,
m_tabname
,
&
rows
,
0
);
records
=
rows
;
records
=
rows
;
...
@@ -5228,34 +5230,53 @@ ndb_get_table_statistics(Ndb* ndb, const char * table,
...
@@ -5228,34 +5230,53 @@ ndb_get_table_statistics(Ndb* ndb, const char * table,
{
{
DBUG_ENTER
(
"ndb_get_table_statistics"
);
DBUG_ENTER
(
"ndb_get_table_statistics"
);
DBUG_PRINT
(
"enter"
,
(
"table: %s"
,
table
));
DBUG_PRINT
(
"enter"
,
(
"table: %s"
,
table
));
NdbConnection
*
pTrans
=
ndb
->
startTransaction
();
NdbConnection
*
pTrans
;
NdbError
error
;
int
retries
=
10
;
int
retry_sleep
=
30
*
1000
;
/* 30 milliseconds */
do
do
{
{
if
(
pTrans
==
NULL
)
Uint64
rows
,
commits
;
break
;
Uint64
sum_rows
=
0
;
Uint64
sum_commits
=
0
;
NdbScanOperation
*
pOp
;
NdbResultSet
*
rs
;
int
check
;
NdbScanOperation
*
pOp
=
pTrans
->
getNdbScanOperation
(
table
);
if
((
pTrans
=
ndb
->
startTransaction
())
==
NULL
)
if
(
pOp
==
NULL
)
{
break
;
error
=
ndb
->
getNdbError
();
goto
retry
;
}
NdbResultSet
*
rs
=
pOp
->
readTuples
(
NdbOperation
::
LM_CommittedRead
);
if
((
pOp
=
pTrans
->
getNdbScanOperation
(
table
))
==
NULL
)
if
(
rs
==
0
)
{
break
;
error
=
pTrans
->
getNdbError
();
goto
retry
;
}
int
check
=
pOp
->
interpret_exit_last_row
();
if
((
rs
=
pOp
->
readTuples
(
NdbOperation
::
LM_CommittedRead
))
==
0
)
if
(
check
==
-
1
)
{
break
;
error
=
pOp
->
getNdbError
();
goto
retry
;
}
if
(
pOp
->
interpret_exit_last_row
()
==
-
1
)
{
error
=
pOp
->
getNdbError
();
goto
retry
;
}
Uint64
rows
,
commits
;
pOp
->
getValue
(
NdbDictionary
::
Column
::
ROW_COUNT
,
(
char
*
)
&
rows
);
pOp
->
getValue
(
NdbDictionary
::
Column
::
ROW_COUNT
,
(
char
*
)
&
rows
);
pOp
->
getValue
(
NdbDictionary
::
Column
::
COMMIT_COUNT
,
(
char
*
)
&
commits
);
pOp
->
getValue
(
NdbDictionary
::
Column
::
COMMIT_COUNT
,
(
char
*
)
&
commits
);
check
=
pTrans
->
execute
(
NoCommit
,
AbortOnError
,
TRUE
);
if
(
pTrans
->
execute
(
NoCommit
,
AbortOnError
,
TRUE
)
==
-
1
)
if
(
check
==
-
1
)
{
break
;
error
=
pTrans
->
getNdbError
();
goto
retry
;
}
Uint64
sum_rows
=
0
;
Uint64
sum_commits
=
0
;
while
((
check
=
rs
->
nextResult
(
TRUE
,
TRUE
))
==
0
)
while
((
check
=
rs
->
nextResult
(
TRUE
,
TRUE
))
==
0
)
{
{
sum_rows
+=
rows
;
sum_rows
+=
rows
;
...
@@ -5263,7 +5284,10 @@ ndb_get_table_statistics(Ndb* ndb, const char * table,
...
@@ -5263,7 +5284,10 @@ ndb_get_table_statistics(Ndb* ndb, const char * table,
}
}
if
(
check
==
-
1
)
if
(
check
==
-
1
)
break
;
{
error
=
pOp
->
getNdbError
();
goto
retry
;
}
rs
->
close
(
TRUE
);
rs
->
close
(
TRUE
);
...
@@ -5274,11 +5298,22 @@ ndb_get_table_statistics(Ndb* ndb, const char * table,
...
@@ -5274,11 +5298,22 @@ ndb_get_table_statistics(Ndb* ndb, const char * table,
*
commit_count
=
sum_commits
;
*
commit_count
=
sum_commits
;
DBUG_PRINT
(
"exit"
,
(
"records: %u commits: %u"
,
sum_rows
,
sum_commits
));
DBUG_PRINT
(
"exit"
,
(
"records: %u commits: %u"
,
sum_rows
,
sum_commits
));
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
while
(
0
);
retry:
if
(
pTrans
)
{
ndb
->
closeTransaction
(
pTrans
);
ndb
->
closeTransaction
(
pTrans
);
DBUG_PRINT
(
"exit"
,
(
"failed"
));
pTrans
=
NULL
;
DBUG_RETURN
(
-
1
);
}
if
(
error
.
status
==
NdbError
::
TemporaryError
&&
retries
--
)
{
my_sleep
(
retry_sleep
);
continue
;
}
break
;
}
while
(
1
);
DBUG_PRINT
(
"exit"
,
(
"failed, error %u(%s)"
,
error
.
code
,
error
.
message
));
ERR_RETURN
(
error
);
}
}
/*
/*
...
...
sql/item_geofunc.h
View file @
52a1639b
...
@@ -32,6 +32,7 @@ public:
...
@@ -32,6 +32,7 @@ public:
Item_geometry_func
(
Item
*
a
,
Item
*
b
,
Item
*
c
)
:
Item_str_func
(
a
,
b
,
c
)
{}
Item_geometry_func
(
Item
*
a
,
Item
*
b
,
Item
*
c
)
:
Item_str_func
(
a
,
b
,
c
)
{}
Item_geometry_func
(
List
<
Item
>
&
list
)
:
Item_str_func
(
list
)
{}
Item_geometry_func
(
List
<
Item
>
&
list
)
:
Item_str_func
(
list
)
{}
void
fix_length_and_dec
();
void
fix_length_and_dec
();
enum_field_types
field_type
()
const
{
return
MYSQL_TYPE_GEOMETRY
;
}
};
};
class
Item_func_geometry_from_text
:
public
Item_geometry_func
class
Item_func_geometry_from_text
:
public
Item_geometry_func
...
@@ -67,6 +68,7 @@ public:
...
@@ -67,6 +68,7 @@ public:
Item_func_as_wkb
(
Item
*
a
)
:
Item_geometry_func
(
a
)
{}
Item_func_as_wkb
(
Item
*
a
)
:
Item_geometry_func
(
a
)
{}
const
char
*
func_name
()
const
{
return
"aswkb"
;
}
const
char
*
func_name
()
const
{
return
"aswkb"
;
}
String
*
val_str
(
String
*
);
String
*
val_str
(
String
*
);
enum_field_types
field_type
()
const
{
return
MYSQL_TYPE_BLOB
;
}
};
};
class
Item_func_geometry_type
:
public
Item_str_func
class
Item_func_geometry_type
:
public
Item_str_func
...
...
sql/item_timefunc.cc
View file @
52a1639b
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
/* TODO: Move month and days to language files */
/* TODO: Move month and days to language files */
/* Day number for Dec 31st, 9999 */
#define MAX_DAY_NUMBER 3652424L
#define MAX_DAY_NUMBER 3652424L
static
const
char
*
month_names
[]
=
static
const
char
*
month_names
[]
=
...
@@ -401,7 +402,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
...
@@ -401,7 +402,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
if
(
yearday
>
0
)
if
(
yearday
>
0
)
{
{
uint
days
=
calc_daynr
(
l_time
->
year
,
1
,
1
)
+
yearday
-
1
;
uint
days
=
calc_daynr
(
l_time
->
year
,
1
,
1
)
+
yearday
-
1
;
if
(
days
<=
0
||
days
>
=
MAX_DAY_NUMBER
)
if
(
days
<=
0
||
days
>
MAX_DAY_NUMBER
)
goto
err
;
goto
err
;
get_date_from_daynr
(
days
,
&
l_time
->
year
,
&
l_time
->
month
,
&
l_time
->
day
);
get_date_from_daynr
(
days
,
&
l_time
->
year
,
&
l_time
->
month
,
&
l_time
->
day
);
}
}
...
@@ -447,7 +448,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
...
@@ -447,7 +448,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
(
weekday
-
1
);
(
weekday
-
1
);
}
}
if
(
days
<=
0
||
days
>
=
MAX_DAY_NUMBER
)
if
(
days
<=
0
||
days
>
MAX_DAY_NUMBER
)
goto
err
;
goto
err
;
get_date_from_daynr
(
days
,
&
l_time
->
year
,
&
l_time
->
month
,
&
l_time
->
day
);
get_date_from_daynr
(
days
,
&
l_time
->
year
,
&
l_time
->
month
,
&
l_time
->
day
);
}
}
...
@@ -1931,7 +1932,7 @@ bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date)
...
@@ -1931,7 +1932,7 @@ bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date)
ltime
->
hour
=
(
uint
)
(
sec
/
3600
);
ltime
->
hour
=
(
uint
)
(
sec
/
3600
);
daynr
=
calc_daynr
(
ltime
->
year
,
ltime
->
month
,
1
)
+
days
;
daynr
=
calc_daynr
(
ltime
->
year
,
ltime
->
month
,
1
)
+
days
;
/* Day number from year 0 to 9999-12-31 */
/* Day number from year 0 to 9999-12-31 */
if
((
ulonglong
)
daynr
>
=
MAX_DAY_NUMBER
)
if
((
ulonglong
)
daynr
>
MAX_DAY_NUMBER
)
goto
null_date
;
goto
null_date
;
get_date_from_daynr
((
long
)
daynr
,
&
ltime
->
year
,
&
ltime
->
month
,
get_date_from_daynr
((
long
)
daynr
,
&
ltime
->
year
,
&
ltime
->
month
,
&
ltime
->
day
);
&
ltime
->
day
);
...
@@ -1941,7 +1942,7 @@ bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date)
...
@@ -1941,7 +1942,7 @@ bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date)
period
=
(
calc_daynr
(
ltime
->
year
,
ltime
->
month
,
ltime
->
day
)
+
period
=
(
calc_daynr
(
ltime
->
year
,
ltime
->
month
,
ltime
->
day
)
+
sign
*
(
long
)
interval
.
day
);
sign
*
(
long
)
interval
.
day
);
/* Daynumber from year 0 to 9999-12-31 */
/* Daynumber from year 0 to 9999-12-31 */
if
((
ulong
)
period
>
=
MAX_DAY_NUMBER
)
if
((
ulong
)
period
>
MAX_DAY_NUMBER
)
goto
null_date
;
goto
null_date
;
get_date_from_daynr
((
long
)
period
,
&
ltime
->
year
,
&
ltime
->
month
,
&
ltime
->
day
);
get_date_from_daynr
((
long
)
period
,
&
ltime
->
year
,
&
ltime
->
month
,
&
ltime
->
day
);
break
;
break
;
...
@@ -2412,7 +2413,7 @@ String *Item_func_makedate::val_str(String *str)
...
@@ -2412,7 +2413,7 @@ String *Item_func_makedate::val_str(String *str)
days
=
calc_daynr
(
yearnr
,
1
,
1
)
+
daynr
-
1
;
days
=
calc_daynr
(
yearnr
,
1
,
1
)
+
daynr
-
1
;
/* Day number from year 0 to 9999-12-31 */
/* Day number from year 0 to 9999-12-31 */
if
(
days
>=
0
&&
days
<
MAX_DAY_NUMBER
)
if
(
days
>=
0
&&
days
<
=
MAX_DAY_NUMBER
)
{
{
null_value
=
0
;
null_value
=
0
;
get_date_from_daynr
(
days
,
&
l_time
.
year
,
&
l_time
.
month
,
&
l_time
.
day
);
get_date_from_daynr
(
days
,
&
l_time
.
year
,
&
l_time
.
month
,
&
l_time
.
day
);
...
...
sql/sql_parse.cc
View file @
52a1639b
...
@@ -667,6 +667,37 @@ static void reset_mqh(THD *thd, LEX_USER *lu, bool get_them= 0)
...
@@ -667,6 +667,37 @@ static void reset_mqh(THD *thd, LEX_USER *lu, bool get_them= 0)
#endif
/* NO_EMBEDDED_ACCESS_CHECKS */
#endif
/* NO_EMBEDDED_ACCESS_CHECKS */
}
}
void
thd_init_client_charset
(
THD
*
thd
,
uint
cs_number
)
{
/*
Use server character set and collation if
- opt_character_set_client_handshake is not set
- client has not specified a character set
- client character set is the same as the servers
- client character set doesn't exists in server
*/
if
(
!
opt_character_set_client_handshake
||
!
(
thd
->
variables
.
character_set_client
=
get_charset
(
cs_number
,
MYF
(
0
)))
||
!
my_strcasecmp
(
&
my_charset_latin1
,
global_system_variables
.
character_set_client
->
name
,
thd
->
variables
.
character_set_client
->
name
))
{
thd
->
variables
.
character_set_client
=
global_system_variables
.
character_set_client
;
thd
->
variables
.
collation_connection
=
global_system_variables
.
collation_connection
;
thd
->
variables
.
character_set_results
=
global_system_variables
.
character_set_results
;
}
else
{
thd
->
variables
.
character_set_results
=
thd
->
variables
.
collation_connection
=
thd
->
variables
.
character_set_client
;
}
}
/*
/*
Perform handshake, authorize client and update thd ACL variables.
Perform handshake, authorize client and update thd ACL variables.
SYNOPSIS
SYNOPSIS
...
@@ -809,33 +840,7 @@ static int check_connection(THD *thd)
...
@@ -809,33 +840,7 @@ static int check_connection(THD *thd)
thd
->
client_capabilities
|=
((
ulong
)
uint2korr
(
net
->
read_pos
+
2
))
<<
16
;
thd
->
client_capabilities
|=
((
ulong
)
uint2korr
(
net
->
read_pos
+
2
))
<<
16
;
thd
->
max_client_packet_length
=
uint4korr
(
net
->
read_pos
+
4
);
thd
->
max_client_packet_length
=
uint4korr
(
net
->
read_pos
+
4
);
DBUG_PRINT
(
"info"
,
(
"client_character_set: %d"
,
(
uint
)
net
->
read_pos
[
8
]));
DBUG_PRINT
(
"info"
,
(
"client_character_set: %d"
,
(
uint
)
net
->
read_pos
[
8
]));
/*
thd_init_client_charset
(
thd
,
(
uint
)
net
->
read_pos
[
8
]);
Use server character set and collation if
- opt_character_set_client_handshake is not set
- client has not specified a character set
- client character set is the same as the servers
- client character set doesn't exists in server
*/
if
(
!
opt_character_set_client_handshake
||
!
(
thd
->
variables
.
character_set_client
=
get_charset
((
uint
)
net
->
read_pos
[
8
],
MYF
(
0
)))
||
!
my_strcasecmp
(
&
my_charset_latin1
,
global_system_variables
.
character_set_client
->
name
,
thd
->
variables
.
character_set_client
->
name
))
{
thd
->
variables
.
character_set_client
=
global_system_variables
.
character_set_client
;
thd
->
variables
.
collation_connection
=
global_system_variables
.
collation_connection
;
thd
->
variables
.
character_set_results
=
global_system_variables
.
character_set_results
;
}
else
{
thd
->
variables
.
character_set_results
=
thd
->
variables
.
collation_connection
=
thd
->
variables
.
character_set_client
;
}
thd
->
update_charset
();
thd
->
update_charset
();
end
=
(
char
*
)
net
->
read_pos
+
32
;
end
=
(
char
*
)
net
->
read_pos
+
32
;
}
}
...
@@ -2673,6 +2678,12 @@ unsent_create_error:
...
@@ -2673,6 +2678,12 @@ unsent_create_error:
}
}
}
}
/* Don't yet allow changing of symlinks with ALTER TABLE */
/* Don't yet allow changing of symlinks with ALTER TABLE */
if
(
lex
->
create_info
.
data_file_name
)
push_warning
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
0
,
"DATA DIRECTORY option ignored"
);
if
(
lex
->
create_info
.
index_file_name
)
push_warning
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
0
,
"INDEX DIRECTORY option ignored"
);
lex
->
create_info
.
data_file_name
=
lex
->
create_info
.
index_file_name
=
0
;
lex
->
create_info
.
data_file_name
=
lex
->
create_info
.
index_file_name
=
0
;
/* ALTER TABLE ends previous transaction */
/* ALTER TABLE ends previous transaction */
if
(
end_active_trans
(
thd
))
if
(
end_active_trans
(
thd
))
...
...
sql/table.cc
View file @
52a1639b
...
@@ -567,27 +567,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
...
@@ -567,27 +567,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
if
(
outparam
->
key_info
[
key
].
flags
&
HA_FULLTEXT
)
if
(
outparam
->
key_info
[
key
].
flags
&
HA_FULLTEXT
)
outparam
->
key_info
[
key
].
algorithm
=
HA_KEY_ALG_FULLTEXT
;
outparam
->
key_info
[
key
].
algorithm
=
HA_KEY_ALG_FULLTEXT
;
if
(
primary_key
>=
MAX_KEY
&&
(
keyinfo
->
flags
&
HA_NOSAME
))
{
/*
If the UNIQUE key doesn't have NULL columns and is not a part key
declare this as a primary key.
*/
primary_key
=
key
;
for
(
i
=
0
;
i
<
keyinfo
->
key_parts
;
i
++
)
{
uint
fieldnr
=
key_part
[
i
].
fieldnr
;
if
(
!
fieldnr
||
outparam
->
field
[
fieldnr
-
1
]
->
null_ptr
||
outparam
->
field
[
fieldnr
-
1
]
->
key_length
()
!=
key_part
[
i
].
length
)
{
primary_key
=
MAX_KEY
;
// Can't be used
break
;
}
}
}
for
(
i
=
0
;
i
<
keyinfo
->
key_parts
;
key_part
++
,
i
++
)
for
(
i
=
0
;
i
<
keyinfo
->
key_parts
;
key_part
++
,
i
++
)
{
{
if
(
new_field_pack_flag
<=
1
)
if
(
new_field_pack_flag
<=
1
)
...
...
support-files/mysql.spec.sh
View file @
52a1639b
...
@@ -148,6 +148,7 @@ Summary: MySQL - Benchmarks and test system
...
@@ -148,6 +148,7 @@ Summary: MySQL - Benchmarks and test system
Group: Applications/Databases
Group: Applications/Databases
Provides: mysql-bench
Provides: mysql-bench
Obsoletes: mysql-bench
Obsoletes: mysql-bench
AutoReqProv: no
%description bench
%description bench
This package contains MySQL benchmark scripts and data.
This package contains MySQL benchmark scripts and data.
...
...
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