Merge bk-internal.mysql.com:/data0/bk/mysql-4.1
into bk-internal.mysql.com:/data0/bk/mysql-4.1-opt
This commit is contained in:
commit
af1f49b77e
@ -1817,6 +1817,14 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [
|
|||||||
ndbcluster_system_libs=""
|
ndbcluster_system_libs=""
|
||||||
ndb_mgmclient_libs="\$(top_builddir)/ndb/src/mgmclient/libndbmgmclient.la"
|
ndb_mgmclient_libs="\$(top_builddir)/ndb/src/mgmclient/libndbmgmclient.la"
|
||||||
MYSQL_CHECK_NDB_OPTIONS
|
MYSQL_CHECK_NDB_OPTIONS
|
||||||
|
|
||||||
|
# libndbclient versioning when linked with GNU ld.
|
||||||
|
if $LD --version 2>/dev/null|grep -q GNU; then
|
||||||
|
NDB_LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/ndb/src/libndb.ver"
|
||||||
|
AC_CONFIG_FILES(ndb/src/libndb.ver)
|
||||||
|
fi
|
||||||
|
AC_SUBST(NDB_LD_VERSION_SCRIPT)
|
||||||
|
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
AC_MSG_RESULT([Not using NDB Cluster])
|
AC_MSG_RESULT([Not using NDB Cluster])
|
||||||
|
@ -14,6 +14,10 @@ DOT_FRM_VERSION=6
|
|||||||
SHARED_LIB_MAJOR_VERSION=14
|
SHARED_LIB_MAJOR_VERSION=14
|
||||||
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
|
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
|
||||||
|
|
||||||
|
NDB_SHARED_LIB_MAJOR_VERSION=1
|
||||||
|
NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0
|
||||||
|
|
||||||
|
|
||||||
# ndb version
|
# ndb version
|
||||||
NDB_VERSION_MAJOR=4
|
NDB_VERSION_MAJOR=4
|
||||||
NDB_VERSION_MINOR=1
|
NDB_VERSION_MINOR=1
|
||||||
@ -73,6 +77,9 @@ AC_DEFINE_UNQUOTED([DOT_FRM_VERSION], [$DOT_FRM_VERSION],
|
|||||||
[Version of .frm files])
|
[Version of .frm files])
|
||||||
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
|
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
|
||||||
AC_SUBST(SHARED_LIB_VERSION)
|
AC_SUBST(SHARED_LIB_VERSION)
|
||||||
|
AC_SUBST(NDB_SHARED_LIB_MAJOR_VERSION)
|
||||||
|
AC_SUBST(NDB_SHARED_LIB_VERSION)
|
||||||
|
|
||||||
AC_SUBST(AVAILABLE_LANGUAGES)
|
AC_SUBST(AVAILABLE_LANGUAGES)
|
||||||
AC_SUBST(AVAILABLE_LANGUAGES_ERRORS)
|
AC_SUBST(AVAILABLE_LANGUAGES_ERRORS)
|
||||||
AC_SUBST_FILE(AVAILABLE_LANGUAGES_ERRORS_RULES)
|
AC_SUBST_FILE(AVAILABLE_LANGUAGES_ERRORS_RULES)
|
||||||
@ -442,6 +449,8 @@ if $LD --version 2>/dev/null|grep -q GNU; then
|
|||||||
fi
|
fi
|
||||||
AC_SUBST(LD_VERSION_SCRIPT)
|
AC_SUBST(LD_VERSION_SCRIPT)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Avoid bug in fcntl on some versions of linux
|
# Avoid bug in fcntl on some versions of linux
|
||||||
AC_MSG_CHECKING([if we should use 'skip-external-locking' as default for $target_os])
|
AC_MSG_CHECKING([if we should use 'skip-external-locking' as default for $target_os])
|
||||||
# Any wariation of Linux
|
# Any wariation of Linux
|
||||||
|
@ -217,8 +217,11 @@ int main(int argc,char *argv[])
|
|||||||
On some system, like NETWARE, strerror(unknown_error) returns a
|
On some system, like NETWARE, strerror(unknown_error) returns a
|
||||||
string 'Unknown Error'. To avoid printing it we try to find the
|
string 'Unknown Error'. To avoid printing it we try to find the
|
||||||
error string by asking for an impossible big error message.
|
error string by asking for an impossible big error message.
|
||||||
|
|
||||||
|
On Solaris 2.8 it might return NULL
|
||||||
*/
|
*/
|
||||||
msg= strerror(10000);
|
if ((msg= strerror(10000)) == NULL)
|
||||||
|
msg= "Unknown Error";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Allocate a buffer for unknown_error since strerror always returns
|
Allocate a buffer for unknown_error since strerror always returns
|
||||||
|
@ -27,6 +27,9 @@ Created 1/8/1996 Heikki Tuuri
|
|||||||
#include "que0que.h"
|
#include "que0que.h"
|
||||||
#include "rem0cmp.h"
|
#include "rem0cmp.h"
|
||||||
|
|
||||||
|
/* Implement isspace() in a locale-independent way. (Bug #24299) */
|
||||||
|
#define ib_isspace(c) ((char) (c) && strchr(" \v\f\t\r\n", c))
|
||||||
|
|
||||||
dict_sys_t* dict_sys = NULL; /* the dictionary system */
|
dict_sys_t* dict_sys = NULL; /* the dictionary system */
|
||||||
|
|
||||||
rw_lock_t dict_operation_lock; /* table create, drop, etc. reserve
|
rw_lock_t dict_operation_lock; /* table create, drop, etc. reserve
|
||||||
@ -2374,7 +2377,7 @@ dict_accept(
|
|||||||
|
|
||||||
*success = FALSE;
|
*success = FALSE;
|
||||||
|
|
||||||
while (isspace(*ptr)) {
|
while (ib_isspace(*ptr)) {
|
||||||
ptr++;
|
ptr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2419,7 +2422,7 @@ dict_scan_id(
|
|||||||
|
|
||||||
*id = NULL;
|
*id = NULL;
|
||||||
|
|
||||||
while (isspace(*ptr)) {
|
while (ib_isspace(*ptr)) {
|
||||||
ptr++;
|
ptr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2450,7 +2453,7 @@ dict_scan_id(
|
|||||||
len++;
|
len++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while (!isspace(*ptr) && *ptr != '(' && *ptr != ')'
|
while (!ib_isspace(*ptr) && *ptr != '(' && *ptr != ')'
|
||||||
&& (accept_also_dot || *ptr != '.')
|
&& (accept_also_dot || *ptr != '.')
|
||||||
&& *ptr != ',' && *ptr != '\0') {
|
&& *ptr != ',' && *ptr != '\0') {
|
||||||
|
|
||||||
@ -2480,12 +2483,12 @@ dict_scan_id(
|
|||||||
if (heap && !quote) {
|
if (heap && !quote) {
|
||||||
/* EMS MySQL Manager sometimes adds characters 0xA0 (in
|
/* EMS MySQL Manager sometimes adds characters 0xA0 (in
|
||||||
latin1, a 'non-breakable space') to the end of a table name.
|
latin1, a 'non-breakable space') to the end of a table name.
|
||||||
But isspace(0xA0) is not true, which confuses our foreign key
|
After the UTF-8 conversion in ha_innodb.cc, bytes 0xC2
|
||||||
parser. After the UTF-8 conversion in ha_innodb.cc, bytes 0xC2
|
and 0xA0 are at the end of the string, and ib_isspace()
|
||||||
and 0xA0 are at the end of the string.
|
does not work for multi-byte UTF-8 characters.
|
||||||
|
|
||||||
TODO: we should lex the string using thd->charset_info, and
|
In MySQL 5.1 we lex the string using thd->charset_info, and
|
||||||
my_isspace(). Only after that, convert id names to UTF-8. */
|
my_isspace(). This workaround is not needed there. */
|
||||||
|
|
||||||
b = (byte*)(*id);
|
b = (byte*)(*id);
|
||||||
id_len = strlen(b);
|
id_len = strlen(b);
|
||||||
@ -2956,11 +2959,11 @@ loop:
|
|||||||
|
|
||||||
ut_a(success);
|
ut_a(success);
|
||||||
|
|
||||||
if (!isspace(*ptr) && *ptr != '"' && *ptr != '`') {
|
if (!ib_isspace(*ptr) && *ptr != '"' && *ptr != '`') {
|
||||||
goto loop;
|
goto loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (isspace(*ptr)) {
|
while (ib_isspace(*ptr)) {
|
||||||
ptr++;
|
ptr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2990,7 +2993,7 @@ loop:
|
|||||||
goto loop;
|
goto loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isspace(*ptr)) {
|
if (!ib_isspace(*ptr)) {
|
||||||
goto loop;
|
goto loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3078,7 +3081,7 @@ col_loop1:
|
|||||||
}
|
}
|
||||||
ptr = dict_accept(ptr, "REFERENCES", &success);
|
ptr = dict_accept(ptr, "REFERENCES", &success);
|
||||||
|
|
||||||
if (!success || !isspace(*ptr)) {
|
if (!success || !ib_isspace(*ptr)) {
|
||||||
dict_foreign_report_syntax_err(name, start_of_latest_foreign,
|
dict_foreign_report_syntax_err(name, start_of_latest_foreign,
|
||||||
ptr);
|
ptr);
|
||||||
return(DB_CANNOT_ADD_CONSTRAINT);
|
return(DB_CANNOT_ADD_CONSTRAINT);
|
||||||
@ -3461,7 +3464,7 @@ loop:
|
|||||||
|
|
||||||
ptr = dict_accept(ptr, "DROP", &success);
|
ptr = dict_accept(ptr, "DROP", &success);
|
||||||
|
|
||||||
if (!isspace(*ptr)) {
|
if (!ib_isspace(*ptr)) {
|
||||||
|
|
||||||
goto loop;
|
goto loop;
|
||||||
}
|
}
|
||||||
|
@ -537,6 +537,8 @@ sub collect_one_test_case($$$$$$$) {
|
|||||||
$tinfo->{'comment'}= "No ndbcluster tests(--skip-ndbcluster)";
|
$tinfo->{'comment'}= "No ndbcluster tests(--skip-ndbcluster)";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
# Ndb tests run with two mysqld masters
|
||||||
|
$tinfo->{'master_num'}= 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -552,7 +554,7 @@ sub collect_one_test_case($$$$$$$) {
|
|||||||
|
|
||||||
if ( $tinfo->{'innodb_test'} )
|
if ( $tinfo->{'innodb_test'} )
|
||||||
{
|
{
|
||||||
# This is a test that need inndob
|
# This is a test that need innodb
|
||||||
if ( $::mysqld_variables{'innodb'} eq "FALSE" )
|
if ( $::mysqld_variables{'innodb'} eq "FALSE" )
|
||||||
{
|
{
|
||||||
# innodb is not supported, skip it
|
# innodb is not supported, skip it
|
||||||
@ -578,7 +580,6 @@ our @tags=
|
|||||||
["include/have_debug.inc", "need_debug", 1],
|
["include/have_debug.inc", "need_debug", 1],
|
||||||
["include/have_ndb.inc", "ndb_test", 1],
|
["include/have_ndb.inc", "ndb_test", 1],
|
||||||
["include/have_ndb_extra.inc", "ndb_extra", 1],
|
["include/have_ndb_extra.inc", "ndb_extra", 1],
|
||||||
["include/have_multi_ndb.inc", "master_num", 2],
|
|
||||||
["require_manager", "require_manager", 1],
|
["require_manager", "require_manager", 1],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -301,6 +301,8 @@ our %mysqld_variables;
|
|||||||
|
|
||||||
my $source_dist= 0;
|
my $source_dist= 0;
|
||||||
|
|
||||||
|
our $opt_max_save_core= 5;
|
||||||
|
my $num_saved_cores= 0; # Number of core files saved in vardir/log/ so far.
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
#
|
#
|
||||||
@ -589,6 +591,7 @@ sub command_line_setup () {
|
|||||||
'strace-client' => \$opt_strace_client,
|
'strace-client' => \$opt_strace_client,
|
||||||
'master-binary=s' => \$exe_master_mysqld,
|
'master-binary=s' => \$exe_master_mysqld,
|
||||||
'slave-binary=s' => \$exe_slave_mysqld,
|
'slave-binary=s' => \$exe_slave_mysqld,
|
||||||
|
'max-save-core=i' => \$opt_max_save_core,
|
||||||
|
|
||||||
# Coverage, profiling etc
|
# Coverage, profiling etc
|
||||||
'gcov' => \$opt_gcov,
|
'gcov' => \$opt_gcov,
|
||||||
@ -3301,10 +3304,12 @@ sub save_files_before_restore($$) {
|
|||||||
# Look for core files
|
# Look for core files
|
||||||
foreach my $core_file ( glob("$data_dir/core*") )
|
foreach my $core_file ( glob("$data_dir/core*") )
|
||||||
{
|
{
|
||||||
|
last if $opt_max_save_core > 0 && $num_saved_cores >= $opt_max_save_core;
|
||||||
my $core_name= basename($core_file);
|
my $core_name= basename($core_file);
|
||||||
mtr_report("Saving $core_name");
|
mtr_report("Saving $core_name");
|
||||||
mkdir($save_name) if ! -d $save_name;
|
mkdir($save_name) if ! -d $save_name;
|
||||||
rename("$core_file", "$save_name/$core_name");
|
rename("$core_file", "$save_name/$core_name");
|
||||||
|
++$num_saved_cores;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4897,6 +4902,9 @@ Options for debugging the product
|
|||||||
master-binary=PATH Specify the master "mysqld" to use
|
master-binary=PATH Specify the master "mysqld" to use
|
||||||
slave-binary=PATH Specify the slave "mysqld" to use
|
slave-binary=PATH Specify the slave "mysqld" to use
|
||||||
strace-client Create strace output for mysqltest client
|
strace-client Create strace output for mysqltest client
|
||||||
|
max-save-core Limit the number of core files saved (to avoid filling
|
||||||
|
up disks for heavily crashing server). Defaults to
|
||||||
|
$opt_max_save_core, set to 0 for no limit.
|
||||||
|
|
||||||
Options for coverage, profiling etc
|
Options for coverage, profiling etc
|
||||||
|
|
||||||
|
@ -278,3 +278,7 @@ double_val cast_val
|
|||||||
-1e+30 -9223372036854775808
|
-1e+30 -9223372036854775808
|
||||||
1e+30 9223372036854775807
|
1e+30 9223372036854775807
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
select isnull(date(NULL)), isnull(cast(NULL as DATE));
|
||||||
|
isnull(date(NULL)) isnull(cast(NULL as DATE))
|
||||||
|
1 1
|
||||||
|
End of 4.1 tests
|
||||||
|
@ -504,8 +504,8 @@ select count(*) from t1 where x = 18446744073709551601;
|
|||||||
count(*)
|
count(*)
|
||||||
1
|
1
|
||||||
create table t2 (x bigint not null);
|
create table t2 (x bigint not null);
|
||||||
insert into t2(x) values (0xfffffffffffffff0);
|
insert into t2(x) values (-16);
|
||||||
insert into t2(x) values (0xfffffffffffffff1);
|
insert into t2(x) values (-15);
|
||||||
select * from t2;
|
select * from t2;
|
||||||
x
|
x
|
||||||
-16
|
-16
|
||||||
|
@ -2819,3 +2819,20 @@ select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
|
|||||||
min(key1)
|
min(key1)
|
||||||
0.37619999051094
|
0.37619999051094
|
||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
|
create table t1(a bigint unsigned, b bigint);
|
||||||
|
insert into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff),
|
||||||
|
(0x10000000000000000, 0x10000000000000000),
|
||||||
|
(0x8fffffffffffffff, 0x8fffffffffffffff);
|
||||||
|
Warnings:
|
||||||
|
Warning 1264 Data truncated; out of range for column 'a' at row 1
|
||||||
|
Warning 1264 Data truncated; out of range for column 'b' at row 1
|
||||||
|
Warning 1264 Data truncated; out of range for column 'a' at row 2
|
||||||
|
Warning 1264 Data truncated; out of range for column 'b' at row 2
|
||||||
|
Warning 1264 Data truncated; out of range for column 'b' at row 3
|
||||||
|
select hex(a), hex(b) from t1;
|
||||||
|
hex(a) hex(b)
|
||||||
|
FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
|
||||||
|
FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
|
||||||
|
8FFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
|
||||||
|
drop table t1;
|
||||||
|
End of 4.1 tests
|
||||||
|
@ -1754,3 +1754,28 @@ t1 CREATE TABLE `t1` (
|
|||||||
`f2` enum('ÿÿ') default NULL
|
`f2` enum('ÿÿ') default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1(russian enum('E','F','EÿF','FÿE') NOT NULL DEFAULT'E');
|
||||||
|
show create table t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`russian` enum('E','F','EÿF','FÿE') NOT NULL default 'E'
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
drop table t1;
|
||||||
|
create table t1(denormal enum('E','F','E,F','F,E') NOT NULL DEFAULT'E');
|
||||||
|
show create table t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`denormal` enum('E','F','E,F','F,E') NOT NULL default 'E'
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
drop table t1;
|
||||||
|
create table t1(russian_deviant enum('E','F','EÿF','F,E') NOT NULL DEFAULT'E');
|
||||||
|
show create table t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`russian_deviant` enum('E','F','EÿF','F,E') NOT NULL default 'E'
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
drop table t1;
|
||||||
|
create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
|
||||||
|
!"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\€','zz<7A>‚ƒ„…†‡ˆ‰Š‹Œ<E280B9>Ž<EFBFBD><C5BD>‘’“”•–—˜™š›œ<E280BA>žŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'));
|
||||||
|
ERROR 42000: Field separator argument is not what is expected; check the manual
|
||||||
|
End of 4.1 tests
|
||||||
|
@ -278,4 +278,75 @@ select 1e-308, 1.00000001e-300, 100000000e-300;
|
|||||||
select 10e307;
|
select 10e307;
|
||||||
10e307
|
10e307
|
||||||
1e+308
|
1e+308
|
||||||
|
create table t1(a int, b double(8, 2));
|
||||||
|
insert into t1 values
|
||||||
|
(1, 28.50), (1, 121.85), (1, 157.23), (1, 1351.00), (1, -1965.35), (1, 81.75),
|
||||||
|
(1, 217.08), (1, 7.94), (4, 96.07), (4, 6404.65), (4, -6500.72), (2, 100.00),
|
||||||
|
(5, 5.00), (5, -2104.80), (5, 2033.80), (5, 0.07), (5, 65.93),
|
||||||
|
(3, -4986.24), (3, 5.00), (3, 4857.34), (3, 123.74), (3, 0.16),
|
||||||
|
(6, -1695.31), (6, 1003.77), (6, 499.72), (6, 191.82);
|
||||||
|
explain select sum(b) s from t1 group by a;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using temporary; Using filesort
|
||||||
|
select sum(b) s from t1 group by a;
|
||||||
|
s
|
||||||
|
0.00
|
||||||
|
100.00
|
||||||
|
0.00
|
||||||
|
-0.00
|
||||||
|
-0.00
|
||||||
|
0.00
|
||||||
|
select sum(b) s from t1 group by a having s <> 0;
|
||||||
|
s
|
||||||
|
100.00
|
||||||
|
select sum(b) s from t1 group by a having s <> 0 order by s;
|
||||||
|
s
|
||||||
|
100.00
|
||||||
|
select sum(b) s from t1 group by a having s <=> 0;
|
||||||
|
s
|
||||||
|
0.00
|
||||||
|
0.00
|
||||||
|
-0.00
|
||||||
|
-0.00
|
||||||
|
0.00
|
||||||
|
select sum(b) s from t1 group by a having s <=> 0 order by s;
|
||||||
|
s
|
||||||
|
-0.00
|
||||||
|
-0.00
|
||||||
|
0.00
|
||||||
|
0.00
|
||||||
|
0.00
|
||||||
|
alter table t1 add key (a, b);
|
||||||
|
explain select sum(b) s from t1 group by a;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t1 index NULL a 14 NULL 26 Using index
|
||||||
|
select sum(b) s from t1 group by a;
|
||||||
|
s
|
||||||
|
0.00
|
||||||
|
100.00
|
||||||
|
0.00
|
||||||
|
-0.00
|
||||||
|
0.00
|
||||||
|
0.00
|
||||||
|
select sum(b) s from t1 group by a having s <> 0;
|
||||||
|
s
|
||||||
|
100.00
|
||||||
|
select sum(b) s from t1 group by a having s <> 0 order by s;
|
||||||
|
s
|
||||||
|
100.00
|
||||||
|
select sum(b) s from t1 group by a having s <=> 0;
|
||||||
|
s
|
||||||
|
0.00
|
||||||
|
0.00
|
||||||
|
-0.00
|
||||||
|
0.00
|
||||||
|
0.00
|
||||||
|
select sum(b) s from t1 group by a having s <=> 0 order by s;
|
||||||
|
s
|
||||||
|
-0.00
|
||||||
|
0.00
|
||||||
|
0.00
|
||||||
|
0.00
|
||||||
|
0.00
|
||||||
|
drop table t1;
|
||||||
End of 4.1 tests
|
End of 4.1 tests
|
||||||
|
@ -167,4 +167,10 @@ INSERT INTO t1 SET f1 = +1.0e+30 ;
|
|||||||
SELECT f1 AS double_val, CAST(f1 AS SIGNED INT) AS cast_val FROM t1;
|
SELECT f1 AS double_val, CAST(f1 AS SIGNED INT) AS cast_val FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
# End of 4.1 tests
|
#
|
||||||
|
# Bug #23938: cast(NULL as DATE)
|
||||||
|
#
|
||||||
|
|
||||||
|
select isnull(date(NULL)), isnull(cast(NULL as DATE));
|
||||||
|
|
||||||
|
--echo End of 4.1 tests
|
||||||
|
@ -400,8 +400,8 @@ select count(*) from t1 where x = 18446744073709551601;
|
|||||||
|
|
||||||
|
|
||||||
create table t2 (x bigint not null);
|
create table t2 (x bigint not null);
|
||||||
insert into t2(x) values (0xfffffffffffffff0);
|
insert into t2(x) values (-16);
|
||||||
insert into t2(x) values (0xfffffffffffffff1);
|
insert into t2(x) values (-15);
|
||||||
select * from t2;
|
select * from t2;
|
||||||
select count(*) from t2 where x>0;
|
select count(*) from t2 where x>0;
|
||||||
select count(*) from t2 where x=0;
|
select count(*) from t2 where x=0;
|
||||||
|
@ -2342,4 +2342,15 @@ select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
|
|||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
--enable_ps_protocol
|
--enable_ps_protocol
|
||||||
|
|
||||||
# End of 4.1 tests
|
#
|
||||||
|
# Bug #22533: storing large hex strings
|
||||||
|
#
|
||||||
|
|
||||||
|
create table t1(a bigint unsigned, b bigint);
|
||||||
|
insert into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff),
|
||||||
|
(0x10000000000000000, 0x10000000000000000),
|
||||||
|
(0x8fffffffffffffff, 0x8fffffffffffffff);
|
||||||
|
select hex(a), hex(b) from t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
--echo End of 4.1 tests
|
||||||
|
@ -136,4 +136,24 @@ alter table t1 add f2 enum(0xFFFF);
|
|||||||
show create table t1;
|
show create table t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
# End of 4.1 tests
|
#
|
||||||
|
# Bug#24660 "enum" field type definition problem
|
||||||
|
#
|
||||||
|
create table t1(russian enum('E','F','E<>F','F<>E') NOT NULL DEFAULT'E');
|
||||||
|
show create table t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
create table t1(denormal enum('E','F','E,F','F,E') NOT NULL DEFAULT'E');
|
||||||
|
show create table t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
create table t1(russian_deviant enum('E','F','E<>F','F,E') NOT NULL DEFAULT'E');
|
||||||
|
show create table t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
# ER_WRONG_FIELD_TERMINATORS
|
||||||
|
--error 1083
|
||||||
|
create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
|
||||||
|
!"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\€','zz亗儎厗噲墛媽崕彁憭摂晼棙櫄洔潪煚、¥ウЖ┆<D096><E29486><EFBFBD>辈炒刀犯购患骄坷谅媚牌侨墒颂臀闲岩釉罩棕仝圮蒉哙徕沅彐玷殛腱眍镳耱篝貊鼬<E8B28A><E9BCAC><EFBFBD><EFBFBD>'));
|
||||||
|
|
||||||
|
--echo End of 4.1 tests
|
||||||
|
@ -188,4 +188,29 @@ select 1e-308, 1.00000001e-300, 100000000e-300;
|
|||||||
# check if overflows are detected correctly
|
# check if overflows are detected correctly
|
||||||
select 10e307;
|
select 10e307;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #19690: ORDER BY eliminates rows from the result
|
||||||
|
#
|
||||||
|
create table t1(a int, b double(8, 2));
|
||||||
|
insert into t1 values
|
||||||
|
(1, 28.50), (1, 121.85), (1, 157.23), (1, 1351.00), (1, -1965.35), (1, 81.75),
|
||||||
|
(1, 217.08), (1, 7.94), (4, 96.07), (4, 6404.65), (4, -6500.72), (2, 100.00),
|
||||||
|
(5, 5.00), (5, -2104.80), (5, 2033.80), (5, 0.07), (5, 65.93),
|
||||||
|
(3, -4986.24), (3, 5.00), (3, 4857.34), (3, 123.74), (3, 0.16),
|
||||||
|
(6, -1695.31), (6, 1003.77), (6, 499.72), (6, 191.82);
|
||||||
|
explain select sum(b) s from t1 group by a;
|
||||||
|
select sum(b) s from t1 group by a;
|
||||||
|
select sum(b) s from t1 group by a having s <> 0;
|
||||||
|
select sum(b) s from t1 group by a having s <> 0 order by s;
|
||||||
|
select sum(b) s from t1 group by a having s <=> 0;
|
||||||
|
select sum(b) s from t1 group by a having s <=> 0 order by s;
|
||||||
|
alter table t1 add key (a, b);
|
||||||
|
explain select sum(b) s from t1 group by a;
|
||||||
|
select sum(b) s from t1 group by a;
|
||||||
|
select sum(b) s from t1 group by a having s <> 0;
|
||||||
|
select sum(b) s from t1 group by a having s <> 0 order by s;
|
||||||
|
select sum(b) s from t1 group by a having s <=> 0;
|
||||||
|
select sum(b) s from t1 group by a having s <=> 0 order by s;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
--echo End of 4.1 tests
|
--echo End of 4.1 tests
|
||||||
|
@ -49,7 +49,6 @@ const char *default_directories[]= {
|
|||||||
"sys:/etc/",
|
"sys:/etc/",
|
||||||
#else
|
#else
|
||||||
"/etc/",
|
"/etc/",
|
||||||
"/etc/mysql/",
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef DATADIR
|
#ifdef DATADIR
|
||||||
DATADIR,
|
DATADIR,
|
||||||
|
@ -6,6 +6,8 @@ ndblib_LTLIBRARIES = libndbclient.la
|
|||||||
|
|
||||||
libndbclient_la_SOURCES =
|
libndbclient_la_SOURCES =
|
||||||
|
|
||||||
|
libndbclient_la_LDFLAGS = -version-info @NDB_SHARED_LIB_VERSION@ @NDB_LD_VERSION_SCRIPT@
|
||||||
|
|
||||||
libndbclient_la_LIBADD = \
|
libndbclient_la_LIBADD = \
|
||||||
ndbapi/libndbapi.la \
|
ndbapi/libndbapi.la \
|
||||||
common/transporter/libtransporter.la \
|
common/transporter/libtransporter.la \
|
||||||
|
2
ndb/src/libndb.ver.in
Normal file
2
ndb/src/libndb.ver.in
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
libndbclient_@NDB_SHARED_LIB_MAJOR_VERSION@ { global: *; };
|
||||||
|
|
@ -440,14 +440,6 @@ sub find_groups
|
|||||||
{
|
{
|
||||||
$data[$i] = $line;
|
$data[$i] = $line;
|
||||||
}
|
}
|
||||||
if (-f "/etc/mysql/my.cnf" && -r "/etc/mysql/my.cnf")
|
|
||||||
{
|
|
||||||
open(MY_CNF, "</etc/mysql/my.cnf") && (@tmp=<MY_CNF>) && close(MY_CNF);
|
|
||||||
}
|
|
||||||
for (; ($line = shift @tmp); $i++)
|
|
||||||
{
|
|
||||||
$data[$i] = $line;
|
|
||||||
}
|
|
||||||
if (-f "$homedir/.my.cnf" && -r "$homedir/.my.cnf")
|
if (-f "$homedir/.my.cnf" && -r "$homedir/.my.cnf")
|
||||||
{
|
{
|
||||||
open(MY_CNF, "<$homedir/.my.cnf") && (@tmp=<MY_CNF>) && close(MY_CNF);
|
open(MY_CNF, "<$homedir/.my.cnf") && (@tmp=<MY_CNF>) && close(MY_CNF);
|
||||||
|
@ -1881,11 +1881,17 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
vio_keepalive(net->vio,TRUE);
|
vio_keepalive(net->vio,TRUE);
|
||||||
/* Override local client variables */
|
|
||||||
|
/* If user set read_timeout, let it override the default */
|
||||||
if (mysql->options.read_timeout)
|
if (mysql->options.read_timeout)
|
||||||
net->read_timeout= mysql->options.read_timeout;
|
net->read_timeout= mysql->options.read_timeout;
|
||||||
|
vio_timeout(net->vio, 0, net->read_timeout);
|
||||||
|
|
||||||
|
/* If user set write_timeout, let it override the default */
|
||||||
if (mysql->options.write_timeout)
|
if (mysql->options.write_timeout)
|
||||||
net->write_timeout= mysql->options.write_timeout;
|
net->write_timeout= mysql->options.write_timeout;
|
||||||
|
vio_timeout(net->vio, 1, net->write_timeout);
|
||||||
|
|
||||||
if (mysql->options.max_allowed_packet)
|
if (mysql->options.max_allowed_packet)
|
||||||
net->max_packet_size= mysql->options.max_allowed_packet;
|
net->max_packet_size= mysql->options.max_allowed_packet;
|
||||||
|
|
||||||
|
@ -3318,7 +3318,7 @@ int Field_double::store(double nr)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
double max_value;
|
double max_value;
|
||||||
if (dec >= NOT_FIXED_DEC)
|
if (not_fixed)
|
||||||
{
|
{
|
||||||
max_value= DBL_MAX;
|
max_value= DBL_MAX;
|
||||||
}
|
}
|
||||||
|
16
sql/field.h
16
sql/field.h
@ -616,6 +616,7 @@ public:
|
|||||||
|
|
||||||
class Field_double :public Field_num {
|
class Field_double :public Field_num {
|
||||||
public:
|
public:
|
||||||
|
my_bool not_fixed;
|
||||||
Field_double(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
|
Field_double(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
|
||||||
uchar null_bit_arg,
|
uchar null_bit_arg,
|
||||||
enum utype unireg_check_arg, const char *field_name_arg,
|
enum utype unireg_check_arg, const char *field_name_arg,
|
||||||
@ -623,12 +624,20 @@ public:
|
|||||||
uint8 dec_arg,bool zero_arg,bool unsigned_arg)
|
uint8 dec_arg,bool zero_arg,bool unsigned_arg)
|
||||||
:Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
|
:Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
|
||||||
unireg_check_arg, field_name_arg, table_arg,
|
unireg_check_arg, field_name_arg, table_arg,
|
||||||
dec_arg, zero_arg,unsigned_arg)
|
dec_arg, zero_arg, unsigned_arg),
|
||||||
|
not_fixed(dec_arg >= NOT_FIXED_DEC)
|
||||||
{}
|
{}
|
||||||
Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
|
Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
|
||||||
struct st_table *table_arg, uint8 dec_arg)
|
struct st_table *table_arg, uint8 dec_arg)
|
||||||
:Field_num((char*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, (uint) 0,
|
:Field_num((char *) 0, len_arg, maybe_null_arg ? (uchar *) "" : 0, (uint) 0,
|
||||||
NONE, field_name_arg, table_arg,dec_arg,0,0)
|
NONE, field_name_arg, table_arg,dec_arg, 0, 0),
|
||||||
|
not_fixed(dec_arg >= NOT_FIXED_DEC)
|
||||||
|
{}
|
||||||
|
Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
|
||||||
|
struct st_table *table_arg, uint8 dec_arg, my_bool not_fixed_srg)
|
||||||
|
:Field_num((char *) 0, len_arg, maybe_null_arg ? (uchar *) "" : 0, (uint) 0,
|
||||||
|
NONE, field_name_arg, table_arg, dec_arg, 0, 0),
|
||||||
|
not_fixed(not_fixed_srg)
|
||||||
{}
|
{}
|
||||||
enum_field_types type() const { return FIELD_TYPE_DOUBLE;}
|
enum_field_types type() const { return FIELD_TYPE_DOUBLE;}
|
||||||
enum ha_base_keytype key_type() const { return HA_KEYTYPE_DOUBLE; }
|
enum ha_base_keytype key_type() const { return HA_KEYTYPE_DOUBLE; }
|
||||||
@ -645,6 +654,7 @@ public:
|
|||||||
uint32 pack_length() const { return sizeof(double); }
|
uint32 pack_length() const { return sizeof(double); }
|
||||||
void sql_type(String &str) const;
|
void sql_type(String &str) const;
|
||||||
uint32 max_length() { return 53; }
|
uint32 max_length() { return 53; }
|
||||||
|
uint size_of() const { return sizeof(*this); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,6 +45,12 @@ void unireg_init(ulong options)
|
|||||||
{ /* It's used by filesort... */
|
{ /* It's used by filesort... */
|
||||||
log_10[i]= nr ; nr*= 10.0;
|
log_10[i]= nr ; nr*= 10.0;
|
||||||
}
|
}
|
||||||
|
/* Make a tab of powers of 0.1 */
|
||||||
|
for (i= 0, nr= 0.1; i < array_elements(log_01); i++)
|
||||||
|
{
|
||||||
|
log_01[i]= nr;
|
||||||
|
nr*= 0.1;
|
||||||
|
}
|
||||||
specialflag|=options; /* Set options from argv */
|
specialflag|=options; /* Set options from argv */
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
25
sql/item.cc
25
sql/item.cc
@ -2370,18 +2370,31 @@ longlong Item_varbinary::val_int()
|
|||||||
|
|
||||||
int Item_varbinary::save_in_field(Field *field, bool no_conversions)
|
int Item_varbinary::save_in_field(Field *field, bool no_conversions)
|
||||||
{
|
{
|
||||||
int error;
|
|
||||||
field->set_notnull();
|
field->set_notnull();
|
||||||
if (field->result_type() == STRING_RESULT)
|
if (field->result_type() == STRING_RESULT)
|
||||||
|
return field->store(str_value.ptr(), str_value.length(),
|
||||||
|
collation.collation);
|
||||||
|
|
||||||
|
ulonglong nr;
|
||||||
|
uint32 length= str_value.length();
|
||||||
|
if (length > 8)
|
||||||
{
|
{
|
||||||
error=field->store(str_value.ptr(),str_value.length(),collation.collation);
|
nr= field->flags & UNSIGNED_FLAG ? ULONGLONG_MAX : LONGLONG_MAX;
|
||||||
|
goto warn;
|
||||||
}
|
}
|
||||||
else
|
nr= (ulonglong) val_int();
|
||||||
|
if ((length == 8) && !(field->flags & UNSIGNED_FLAG) && (nr > LONGLONG_MAX))
|
||||||
{
|
{
|
||||||
longlong nr=val_int();
|
nr= LONGLONG_MAX;
|
||||||
error=field->store(nr);
|
goto warn;
|
||||||
}
|
}
|
||||||
return error;
|
return field->store((longlong) nr);
|
||||||
|
|
||||||
|
warn:
|
||||||
|
if (!field->store((longlong) nr))
|
||||||
|
field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE,
|
||||||
|
1);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -352,6 +352,17 @@ int Arg_comparator::set_compare_func(Item_bool_func2 *item, Item_result type)
|
|||||||
func= &Arg_comparator::compare_e_int_diff_signedness;
|
func= &Arg_comparator::compare_e_int_diff_signedness;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (type == REAL_RESULT)
|
||||||
|
{
|
||||||
|
if ((*a)->decimals < NOT_FIXED_DEC && (*b)->decimals < NOT_FIXED_DEC)
|
||||||
|
{
|
||||||
|
precision= 5 * log_01[max((*a)->decimals, (*b)->decimals)];
|
||||||
|
if (func == &Arg_comparator::compare_real)
|
||||||
|
func= &Arg_comparator::compare_real_fixed;
|
||||||
|
else if (func == &Arg_comparator::compare_e_real)
|
||||||
|
func= &Arg_comparator::compare_e_real_fixed;
|
||||||
|
}
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -459,6 +470,44 @@ int Arg_comparator::compare_e_real()
|
|||||||
return test(val1 == val2);
|
return test(val1 == val2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int Arg_comparator::compare_real_fixed()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
Fix yet another manifestation of Bug#2338. 'Volatile' will instruct
|
||||||
|
gcc to flush double values out of 80-bit Intel FPU registers before
|
||||||
|
performing the comparison.
|
||||||
|
*/
|
||||||
|
volatile double val1, val2;
|
||||||
|
val1= (*a)->val();
|
||||||
|
if (!(*a)->null_value)
|
||||||
|
{
|
||||||
|
val2= (*b)->val();
|
||||||
|
if (!(*b)->null_value)
|
||||||
|
{
|
||||||
|
owner->null_value= 0;
|
||||||
|
if (val1 == val2 || fabs(val1 - val2) < precision)
|
||||||
|
return 0;
|
||||||
|
if (val1 < val2)
|
||||||
|
return -1;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
owner->null_value= 1;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int Arg_comparator::compare_e_real_fixed()
|
||||||
|
{
|
||||||
|
double val1= (*a)->val();
|
||||||
|
double val2= (*b)->val();
|
||||||
|
if ((*a)->null_value || (*b)->null_value)
|
||||||
|
return test((*a)->null_value && (*b)->null_value);
|
||||||
|
return test(val1 == val2 || fabs(val1 - val2) < precision);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int Arg_comparator::compare_int_signed()
|
int Arg_comparator::compare_int_signed()
|
||||||
{
|
{
|
||||||
longlong val1= (*a)->val_int();
|
longlong val1= (*a)->val_int();
|
||||||
|
@ -33,6 +33,7 @@ class Arg_comparator: public Sql_alloc
|
|||||||
arg_cmp_func func;
|
arg_cmp_func func;
|
||||||
Item_bool_func2 *owner;
|
Item_bool_func2 *owner;
|
||||||
Arg_comparator *comparators; // used only for compare_row()
|
Arg_comparator *comparators; // used only for compare_row()
|
||||||
|
double precision;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DTCollation cmp_collation;
|
DTCollation cmp_collation;
|
||||||
@ -77,6 +78,8 @@ public:
|
|||||||
int compare_e_int(); // compare args[0] & args[1]
|
int compare_e_int(); // compare args[0] & args[1]
|
||||||
int compare_e_int_diff_signedness();
|
int compare_e_int_diff_signedness();
|
||||||
int compare_e_row(); // compare args[0] & args[1]
|
int compare_e_row(); // compare args[0] & args[1]
|
||||||
|
int compare_real_fixed();
|
||||||
|
int compare_e_real_fixed();
|
||||||
|
|
||||||
static arg_cmp_func comparator_matrix [4][2];
|
static arg_cmp_func comparator_matrix [4][2];
|
||||||
|
|
||||||
|
@ -2491,7 +2491,10 @@ longlong Item_date_typecast::val_int()
|
|||||||
DBUG_ASSERT(fixed == 1);
|
DBUG_ASSERT(fixed == 1);
|
||||||
TIME ltime;
|
TIME ltime;
|
||||||
if (args[0]->get_date(<ime, TIME_FUZZY_DATE))
|
if (args[0]->get_date(<ime, TIME_FUZZY_DATE))
|
||||||
|
{
|
||||||
|
null_value= 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
return (longlong) (ltime.year * 10000L + ltime.month * 100 + ltime.day);
|
return (longlong) (ltime.year * 10000L + ltime.month * 100 + ltime.day);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,6 +59,8 @@ void kill_one_thread(THD *thd, ulong id);
|
|||||||
bool net_request_file(NET* net, const char* fname);
|
bool net_request_file(NET* net, const char* fname);
|
||||||
char* query_table_status(THD *thd,const char *db,const char *table_name);
|
char* query_table_status(THD *thd,const char *db,const char *table_name);
|
||||||
|
|
||||||
|
void net_set_write_timeout(NET *net, uint timeout);
|
||||||
|
void net_set_read_timeout(NET *net, uint timeout);
|
||||||
|
|
||||||
#define x_free(A) { my_free((gptr) (A),MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR)); }
|
#define x_free(A) { my_free((gptr) (A),MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR)); }
|
||||||
#define safeFree(x) { if(x) { my_free((gptr) x,MYF(0)); x = NULL; } }
|
#define safeFree(x) { if(x) { my_free((gptr) x,MYF(0)); x = NULL; } }
|
||||||
@ -907,6 +909,7 @@ extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN];
|
|||||||
extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file;
|
extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file;
|
||||||
extern char log_error_file[FN_REFLEN];
|
extern char log_error_file[FN_REFLEN];
|
||||||
extern double log_10[32];
|
extern double log_10[32];
|
||||||
|
extern double log_01[32];
|
||||||
extern ulonglong log_10_int[20];
|
extern ulonglong log_10_int[20];
|
||||||
extern ulonglong keybuff_size;
|
extern ulonglong keybuff_size;
|
||||||
extern ulong refresh_version,flush_version, thread_id,query_id,opened_tables;
|
extern ulong refresh_version,flush_version, thread_id,query_id,opened_tables;
|
||||||
|
@ -355,6 +355,7 @@ ulong my_bind_addr; /* the address we bind to */
|
|||||||
volatile ulong cached_thread_count= 0;
|
volatile ulong cached_thread_count= 0;
|
||||||
|
|
||||||
double log_10[32]; /* 10 potences */
|
double log_10[32]; /* 10 potences */
|
||||||
|
double log_01[32];
|
||||||
time_t start_time;
|
time_t start_time;
|
||||||
|
|
||||||
char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30];
|
char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30];
|
||||||
@ -3608,10 +3609,9 @@ static bool read_init_file(char *file_name)
|
|||||||
#ifndef EMBEDDED_LIBRARY
|
#ifndef EMBEDDED_LIBRARY
|
||||||
static void create_new_thread(THD *thd)
|
static void create_new_thread(THD *thd)
|
||||||
{
|
{
|
||||||
|
NET *net=&thd->net;
|
||||||
DBUG_ENTER("create_new_thread");
|
DBUG_ENTER("create_new_thread");
|
||||||
|
|
||||||
NET *net=&thd->net; // For easy ref
|
|
||||||
net->read_timeout = (uint) connect_timeout;
|
|
||||||
if (protocol_version > 9)
|
if (protocol_version > 9)
|
||||||
net->return_errno=1;
|
net->return_errno=1;
|
||||||
|
|
||||||
@ -3906,12 +3906,7 @@ extern "C" pthread_handler_decl(handle_connections_sockets,
|
|||||||
}
|
}
|
||||||
if (sock == unix_sock)
|
if (sock == unix_sock)
|
||||||
thd->host=(char*) my_localhost;
|
thd->host=(char*) my_localhost;
|
||||||
#ifdef __WIN__
|
|
||||||
/* Set default wait_timeout */
|
|
||||||
ulong wait_timeout= global_system_variables.net_wait_timeout * 1000;
|
|
||||||
(void) setsockopt(new_sock, SOL_SOCKET, SO_RCVTIMEO, (char*)&wait_timeout,
|
|
||||||
sizeof(wait_timeout));
|
|
||||||
#endif
|
|
||||||
create_new_thread(thd);
|
create_new_thread(thd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -491,7 +491,7 @@ net_real_write(NET *net,const char *packet,ulong len)
|
|||||||
thr_alarm(&alarmed,(uint) net->write_timeout,&alarm_buff);
|
thr_alarm(&alarmed,(uint) net->write_timeout,&alarm_buff);
|
||||||
#else
|
#else
|
||||||
alarmed=0;
|
alarmed=0;
|
||||||
vio_timeout(net->vio, 1, net->write_timeout);
|
/* Write timeout is set in net_set_write_timeout */
|
||||||
#endif /* NO_ALARM */
|
#endif /* NO_ALARM */
|
||||||
|
|
||||||
pos=(char*) packet; end=pos+len;
|
pos=(char*) packet; end=pos+len;
|
||||||
@ -684,7 +684,7 @@ my_real_read(NET *net, ulong *complen)
|
|||||||
if (net_blocking)
|
if (net_blocking)
|
||||||
thr_alarm(&alarmed,net->read_timeout,&alarm_buff);
|
thr_alarm(&alarmed,net->read_timeout,&alarm_buff);
|
||||||
#else
|
#else
|
||||||
vio_timeout(net->vio, 0, net->read_timeout);
|
/* Read timeout is set in net_set_read_timeout */
|
||||||
#endif /* NO_ALARM */
|
#endif /* NO_ALARM */
|
||||||
|
|
||||||
pos = net->buff + net->where_b; /* net->packet -4 */
|
pos = net->buff + net->where_b; /* net->packet -4 */
|
||||||
@ -995,3 +995,26 @@ my_net_read(NET *net)
|
|||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void net_set_read_timeout(NET *net, uint timeout)
|
||||||
|
{
|
||||||
|
DBUG_ENTER("net_set_read_timeout");
|
||||||
|
DBUG_PRINT("enter", ("timeout: %d", timeout));
|
||||||
|
net->read_timeout= timeout;
|
||||||
|
#ifdef NO_ALARM
|
||||||
|
vio_timeout(net->vio, 0, timeout);
|
||||||
|
#endif
|
||||||
|
DBUG_VOID_RETURN;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void net_set_write_timeout(NET *net, uint timeout)
|
||||||
|
{
|
||||||
|
DBUG_ENTER("net_set_write_timeout");
|
||||||
|
DBUG_PRINT("enter", ("timeout: %d", timeout));
|
||||||
|
net->write_timeout= timeout;
|
||||||
|
#ifdef NO_ALARM
|
||||||
|
vio_timeout(net->vio, 1, timeout);
|
||||||
|
#endif
|
||||||
|
DBUG_VOID_RETURN;
|
||||||
|
}
|
||||||
|
@ -57,6 +57,7 @@ static Slave_log_event* find_slave_event(IO_CACHE* log,
|
|||||||
functions like register_slave()) are working.
|
functions like register_slave()) are working.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if NOT_USED
|
||||||
static int init_failsafe_rpl_thread(THD* thd)
|
static int init_failsafe_rpl_thread(THD* thd)
|
||||||
{
|
{
|
||||||
DBUG_ENTER("init_failsafe_rpl_thread");
|
DBUG_ENTER("init_failsafe_rpl_thread");
|
||||||
@ -99,7 +100,7 @@ static int init_failsafe_rpl_thread(THD* thd)
|
|||||||
thd->set_time();
|
thd->set_time();
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status)
|
void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status)
|
||||||
{
|
{
|
||||||
@ -573,12 +574,14 @@ err:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if NOT_USED
|
||||||
int find_recovery_captain(THD* thd, MYSQL* mysql)
|
int find_recovery_captain(THD* thd, MYSQL* mysql)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if NOT_USED
|
||||||
pthread_handler_decl(handle_failsafe_rpl,arg)
|
pthread_handler_decl(handle_failsafe_rpl,arg)
|
||||||
{
|
{
|
||||||
DBUG_ENTER("handle_failsafe_rpl");
|
DBUG_ENTER("handle_failsafe_rpl");
|
||||||
@ -626,7 +629,7 @@ err:
|
|||||||
pthread_exit(0);
|
pthread_exit(0);
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int show_slave_hosts(THD* thd)
|
int show_slave_hosts(THD* thd)
|
||||||
{
|
{
|
||||||
|
@ -1128,14 +1128,14 @@ static void fix_tx_isolation(THD *thd, enum_var_type type)
|
|||||||
static void fix_net_read_timeout(THD *thd, enum_var_type type)
|
static void fix_net_read_timeout(THD *thd, enum_var_type type)
|
||||||
{
|
{
|
||||||
if (type != OPT_GLOBAL)
|
if (type != OPT_GLOBAL)
|
||||||
thd->net.read_timeout=thd->variables.net_read_timeout;
|
net_set_read_timeout(&thd->net, thd->variables.net_read_timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void fix_net_write_timeout(THD *thd, enum_var_type type)
|
static void fix_net_write_timeout(THD *thd, enum_var_type type)
|
||||||
{
|
{
|
||||||
if (type != OPT_GLOBAL)
|
if (type != OPT_GLOBAL)
|
||||||
thd->net.write_timeout=thd->variables.net_write_timeout;
|
net_set_write_timeout(&thd->net, thd->variables.net_write_timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fix_net_retry_count(THD *thd, enum_var_type type)
|
static void fix_net_retry_count(THD *thd, enum_var_type type)
|
||||||
|
@ -2625,7 +2625,6 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
|
|||||||
*/
|
*/
|
||||||
thd->variables.max_allowed_packet= global_system_variables.max_allowed_packet
|
thd->variables.max_allowed_packet= global_system_variables.max_allowed_packet
|
||||||
+ MAX_LOG_EVENT_HEADER; /* note, incr over the global not session var */
|
+ MAX_LOG_EVENT_HEADER; /* note, incr over the global not session var */
|
||||||
thd->net.read_timeout = slave_net_timeout;
|
|
||||||
thd->master_access= ~(ulong)0;
|
thd->master_access= ~(ulong)0;
|
||||||
thd->priv_user = 0;
|
thd->priv_user = 0;
|
||||||
thd->slave_thread = 1;
|
thd->slave_thread = 1;
|
||||||
@ -4284,6 +4283,13 @@ Log_event* next_event(RELAY_LOG_INFO* rli)
|
|||||||
hot_log=0; // Using old binary log
|
hot_log=0; // Using old binary log
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
As there is no guarantee that the relay is open (for example, an I/O
|
||||||
|
error during a write by the slave I/O thread may have closed it), we
|
||||||
|
have to test it.
|
||||||
|
*/
|
||||||
|
if (!my_b_inited(cur_log))
|
||||||
|
goto err;
|
||||||
#ifndef DBUG_OFF
|
#ifndef DBUG_OFF
|
||||||
{
|
{
|
||||||
char llbuf1[22], llbuf2[22];
|
char llbuf1[22], llbuf2[22];
|
||||||
|
@ -867,7 +867,7 @@ static int check_connection(THD *thd)
|
|||||||
return(ER_HANDSHAKE_ERROR);
|
return(ER_HANDSHAKE_ERROR);
|
||||||
}
|
}
|
||||||
DBUG_PRINT("info", ("IO layer change in progress..."));
|
DBUG_PRINT("info", ("IO layer change in progress..."));
|
||||||
if (sslaccept(ssl_acceptor_fd, net->vio, thd->variables.net_wait_timeout))
|
if (sslaccept(ssl_acceptor_fd, net->vio, net->read_timeout))
|
||||||
{
|
{
|
||||||
DBUG_PRINT("error", ("Failed to read user information (pkt_len= %lu)",
|
DBUG_PRINT("error", ("Failed to read user information (pkt_len= %lu)",
|
||||||
pkt_len));
|
pkt_len));
|
||||||
@ -897,7 +897,6 @@ static int check_connection(THD *thd)
|
|||||||
if ((thd->client_capabilities & CLIENT_TRANSACTIONS) &&
|
if ((thd->client_capabilities & CLIENT_TRANSACTIONS) &&
|
||||||
opt_using_transactions)
|
opt_using_transactions)
|
||||||
net->return_status= &thd->server_status;
|
net->return_status= &thd->server_status;
|
||||||
net->read_timeout=(uint) thd->variables.net_read_timeout;
|
|
||||||
|
|
||||||
char *user= end;
|
char *user= end;
|
||||||
char *passwd= strend(user)+1;
|
char *passwd= strend(user)+1;
|
||||||
@ -1029,6 +1028,10 @@ pthread_handler_decl(handle_one_connection,arg)
|
|||||||
NET *net= &thd->net;
|
NET *net= &thd->net;
|
||||||
thd->thread_stack= (char*) &thd;
|
thd->thread_stack= (char*) &thd;
|
||||||
|
|
||||||
|
/* Use "connect_timeout" value during connection phase */
|
||||||
|
net_set_read_timeout(net, connect_timeout);
|
||||||
|
net_set_write_timeout(net, connect_timeout);
|
||||||
|
|
||||||
if ((error=check_connection(thd)))
|
if ((error=check_connection(thd)))
|
||||||
{ // Wrong permissions
|
{ // Wrong permissions
|
||||||
if (error > 0)
|
if (error > 0)
|
||||||
@ -1058,6 +1061,11 @@ pthread_handler_decl(handle_one_connection,arg)
|
|||||||
if (thd->query_error)
|
if (thd->query_error)
|
||||||
thd->killed= 1;
|
thd->killed= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Connect completed, set read/write timeouts back to tdefault */
|
||||||
|
net_set_read_timeout(net, thd->variables.net_read_timeout);
|
||||||
|
net_set_write_timeout(net, thd->variables.net_write_timeout);
|
||||||
|
|
||||||
while (!net->error && net->vio != 0 && !thd->killed)
|
while (!net->error && net->vio != 0 && !thd->killed)
|
||||||
{
|
{
|
||||||
if (do_command(thd))
|
if (do_command(thd))
|
||||||
@ -1261,7 +1269,7 @@ err:
|
|||||||
#ifndef EMBEDDED_LIBRARY
|
#ifndef EMBEDDED_LIBRARY
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Read one command from socket and execute it (query or simple command).
|
Read one command from connection and execute it (query or simple command).
|
||||||
This function is called in loop from thread function.
|
This function is called in loop from thread function.
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
do_command()
|
do_command()
|
||||||
@ -1272,24 +1280,26 @@ err:
|
|||||||
|
|
||||||
bool do_command(THD *thd)
|
bool do_command(THD *thd)
|
||||||
{
|
{
|
||||||
char *packet;
|
char *packet= 0;
|
||||||
uint old_timeout;
|
|
||||||
ulong packet_length;
|
ulong packet_length;
|
||||||
NET *net;
|
NET *net= &thd->net;
|
||||||
enum enum_server_command command;
|
enum enum_server_command command;
|
||||||
DBUG_ENTER("do_command");
|
DBUG_ENTER("do_command");
|
||||||
|
|
||||||
net= &thd->net;
|
|
||||||
/*
|
/*
|
||||||
indicator of uninitialized lex => normal flow of errors handling
|
indicator of uninitialized lex => normal flow of errors handling
|
||||||
(see my_message_sql)
|
(see my_message_sql)
|
||||||
*/
|
*/
|
||||||
thd->lex->current_select= 0;
|
thd->lex->current_select= 0;
|
||||||
|
|
||||||
packet=0;
|
/*
|
||||||
old_timeout=net->read_timeout;
|
This thread will do a blocking read from the client which
|
||||||
// Wait max for 8 hours
|
will be interrupted when the next command is received from
|
||||||
net->read_timeout=(uint) thd->variables.net_wait_timeout;
|
the client, the connection is closed or "net_wait_timeout"
|
||||||
|
number of seconds has passed
|
||||||
|
*/
|
||||||
|
net_set_read_timeout(net, thd->variables.net_wait_timeout);
|
||||||
|
|
||||||
thd->clear_error(); // Clear error message
|
thd->clear_error(); // Clear error message
|
||||||
|
|
||||||
net_new_transaction(net);
|
net_new_transaction(net);
|
||||||
@ -1318,7 +1328,10 @@ bool do_command(THD *thd)
|
|||||||
vio_description(net->vio), command,
|
vio_description(net->vio), command,
|
||||||
command_name[command]));
|
command_name[command]));
|
||||||
}
|
}
|
||||||
net->read_timeout=old_timeout; // restore it
|
|
||||||
|
/* Restore read timeout value */
|
||||||
|
net_set_read_timeout(net, thd->variables.net_read_timeout);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
packet_length contains length of data, as it was stored in packet
|
packet_length contains length of data, as it was stored in packet
|
||||||
header. In case of malformed header, packet_length can be zero.
|
header. In case of malformed header, packet_length can be zero.
|
||||||
|
@ -1791,7 +1791,7 @@ void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
|
|||||||
*/
|
*/
|
||||||
String expanded_query;
|
String expanded_query;
|
||||||
#ifndef EMBEDDED_LIBRARY
|
#ifndef EMBEDDED_LIBRARY
|
||||||
uchar *packet_end= (uchar *) packet + packet_length - 1;
|
uchar *packet_end= packet + packet_length - 1;
|
||||||
#endif
|
#endif
|
||||||
Prepared_statement *stmt;
|
Prepared_statement *stmt;
|
||||||
DBUG_ENTER("mysql_stmt_execute");
|
DBUG_ENTER("mysql_stmt_execute");
|
||||||
@ -1817,9 +1817,9 @@ void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
|
|||||||
#ifndef EMBEDDED_LIBRARY
|
#ifndef EMBEDDED_LIBRARY
|
||||||
if (stmt->param_count)
|
if (stmt->param_count)
|
||||||
{
|
{
|
||||||
uchar *null_array= (uchar *) packet;
|
uchar *null_array= packet;
|
||||||
if (setup_conversion_functions(stmt, (uchar **) &packet, packet_end) ||
|
if (setup_conversion_functions(stmt, &packet, packet_end) ||
|
||||||
stmt->set_params(stmt, null_array, (uchar *) packet, packet_end,
|
stmt->set_params(stmt, null_array, packet, packet_end,
|
||||||
&expanded_query))
|
&expanded_query))
|
||||||
goto set_params_data_err;
|
goto set_params_data_err;
|
||||||
}
|
}
|
||||||
|
@ -89,8 +89,8 @@ static int send_file(THD *thd)
|
|||||||
The client might be slow loading the data, give him wait_timeout to do
|
The client might be slow loading the data, give him wait_timeout to do
|
||||||
the job
|
the job
|
||||||
*/
|
*/
|
||||||
old_timeout = thd->net.read_timeout;
|
old_timeout= net->read_timeout;
|
||||||
thd->net.read_timeout = thd->variables.net_wait_timeout;
|
net_set_read_timeout(net, thd->variables.net_wait_timeout);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
We need net_flush here because the client will not know it needs to send
|
We need net_flush here because the client will not know it needs to send
|
||||||
@ -134,7 +134,7 @@ static int send_file(THD *thd)
|
|||||||
error = 0;
|
error = 0;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
thd->net.read_timeout = old_timeout;
|
net_set_read_timeout(net, old_timeout);
|
||||||
if (fd >= 0)
|
if (fd >= 0)
|
||||||
(void) my_close(fd, MYF(0));
|
(void) my_close(fd, MYF(0));
|
||||||
if (errmsg)
|
if (errmsg)
|
||||||
|
@ -5029,6 +5029,8 @@ static Field* create_tmp_field_from_field(THD *thd, Field* org_field,
|
|||||||
new_field->flags&= ~NOT_NULL_FLAG; // Because of outer join
|
new_field->flags&= ~NOT_NULL_FLAG; // Because of outer join
|
||||||
if (org_field->type() == FIELD_TYPE_VAR_STRING)
|
if (org_field->type() == FIELD_TYPE_VAR_STRING)
|
||||||
table->db_create_options|= HA_OPTION_PACK_RECORD;
|
table->db_create_options|= HA_OPTION_PACK_RECORD;
|
||||||
|
else if (org_field->type() == FIELD_TYPE_DOUBLE)
|
||||||
|
((Field_double *) new_field)->not_fixed= TRUE;
|
||||||
}
|
}
|
||||||
return new_field;
|
return new_field;
|
||||||
}
|
}
|
||||||
@ -5068,7 +5070,7 @@ static Field* create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
|
|||||||
switch (item->result_type()) {
|
switch (item->result_type()) {
|
||||||
case REAL_RESULT:
|
case REAL_RESULT:
|
||||||
new_field=new Field_double(item->max_length, maybe_null,
|
new_field=new Field_double(item->max_length, maybe_null,
|
||||||
item->name, table, item->decimals);
|
item->name, table, item->decimals, TRUE);
|
||||||
break;
|
break;
|
||||||
case INT_RESULT:
|
case INT_RESULT:
|
||||||
new_field=new Field_longlong(item->max_length, maybe_null,
|
new_field=new Field_longlong(item->max_length, maybe_null,
|
||||||
@ -5159,8 +5161,8 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
|
|||||||
return new Field_string(sizeof(double)+sizeof(longlong),
|
return new Field_string(sizeof(double)+sizeof(longlong),
|
||||||
0, item->name,table,&my_charset_bin);
|
0, item->name,table,&my_charset_bin);
|
||||||
else
|
else
|
||||||
return new Field_double(item_sum->max_length,maybe_null,
|
return new Field_double(item_sum->max_length, maybe_null,
|
||||||
item->name, table, item_sum->decimals);
|
item->name, table, item_sum->decimals, TRUE);
|
||||||
case Item_sum::VARIANCE_FUNC: /* Place for sum & count */
|
case Item_sum::VARIANCE_FUNC: /* Place for sum & count */
|
||||||
case Item_sum::STD_FUNC:
|
case Item_sum::STD_FUNC:
|
||||||
if (group)
|
if (group)
|
||||||
@ -5168,7 +5170,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
|
|||||||
0, item->name,table,&my_charset_bin);
|
0, item->name,table,&my_charset_bin);
|
||||||
else
|
else
|
||||||
return new Field_double(item_sum->max_length, maybe_null,
|
return new Field_double(item_sum->max_length, maybe_null,
|
||||||
item->name,table,item_sum->decimals);
|
item->name, table, item_sum->decimals, TRUE);
|
||||||
case Item_sum::UNIQUE_USERS_FUNC:
|
case Item_sum::UNIQUE_USERS_FUNC:
|
||||||
return new Field_long(9,maybe_null,item->name,table,1);
|
return new Field_long(9,maybe_null,item->name,table,1);
|
||||||
case Item_sum::MIN_FUNC:
|
case Item_sum::MIN_FUNC:
|
||||||
@ -5183,8 +5185,8 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
|
|||||||
default:
|
default:
|
||||||
switch (item_sum->result_type()) {
|
switch (item_sum->result_type()) {
|
||||||
case REAL_RESULT:
|
case REAL_RESULT:
|
||||||
return new Field_double(item_sum->max_length,maybe_null,
|
return new Field_double(item_sum->max_length, maybe_null,
|
||||||
item->name,table,item_sum->decimals);
|
item->name, table, item_sum->decimals, TRUE);
|
||||||
case INT_RESULT:
|
case INT_RESULT:
|
||||||
return new Field_longlong(item_sum->max_length,maybe_null,
|
return new Field_longlong(item_sum->max_length,maybe_null,
|
||||||
item->name,table,item->unsigned_flag);
|
item->name,table,item->unsigned_flag);
|
||||||
|
11
sql/table.cc
11
sql/table.cc
@ -393,17 +393,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
|
|||||||
{
|
{
|
||||||
char *val= (char*) interval->type_names[count];
|
char *val= (char*) interval->type_names[count];
|
||||||
interval->type_lengths[count]= strlen(val);
|
interval->type_lengths[count]= strlen(val);
|
||||||
/*
|
|
||||||
Replace all ',' symbols with NAMES_SEP_CHAR.
|
|
||||||
See the comment in unireg.cc, pack_fields() function
|
|
||||||
for details.
|
|
||||||
*/
|
|
||||||
for (uint cnt= 0 ; cnt < interval->type_lengths[count] ; cnt++)
|
|
||||||
{
|
|
||||||
char c= val[cnt];
|
|
||||||
if (c == ',')
|
|
||||||
val[cnt]= NAMES_SEP_CHAR;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
interval->type_lengths[count]= 0;
|
interval->type_lengths[count]= 0;
|
||||||
}
|
}
|
||||||
|
@ -657,29 +657,48 @@ static bool pack_fields(File file, List<create_field> &create_fields,
|
|||||||
{
|
{
|
||||||
if (field->interval_id > int_count)
|
if (field->interval_id > int_count)
|
||||||
{
|
{
|
||||||
int_count=field->interval_id;
|
unsigned char sep= 0;
|
||||||
tmp.append(NAMES_SEP_CHAR);
|
unsigned char occ[256];
|
||||||
for (const char **pos=field->interval->type_names ; *pos ; pos++)
|
uint i;
|
||||||
{
|
unsigned char *val= NULL;
|
||||||
char *val= (char*) *pos;
|
|
||||||
uint str_len= strlen(val);
|
bzero(occ, sizeof(occ));
|
||||||
/*
|
|
||||||
Note, hack: in old frm NAMES_SEP_CHAR is used to separate
|
for (i=0; (val= (unsigned char*) field->interval->type_names[i]); i++)
|
||||||
names in the interval (ENUM/SET). To allow names to contain
|
for (uint j = 0; j < field->interval->type_lengths[i]; j++)
|
||||||
NAMES_SEP_CHAR, we replace it with a comma before writing frm.
|
occ[(unsigned int) (val[j])]= 1;
|
||||||
Backward conversion is done during frm file opening,
|
|
||||||
See table.cc, openfrm() function
|
if (!occ[(unsigned char)NAMES_SEP_CHAR])
|
||||||
*/
|
sep= (unsigned char) NAMES_SEP_CHAR;
|
||||||
for (uint cnt= 0 ; cnt < str_len ; cnt++)
|
else if (!occ[(unsigned int)','])
|
||||||
|
sep= ',';
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (uint i=1; i<256; i++)
|
||||||
{
|
{
|
||||||
char c= val[cnt];
|
if(!occ[i])
|
||||||
if (c == NAMES_SEP_CHAR)
|
{
|
||||||
val[cnt]= ',';
|
sep= i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
tmp.append(*pos);
|
|
||||||
tmp.append(NAMES_SEP_CHAR);
|
if(!sep) /* disaster, enum uses all characters, none left as separator */
|
||||||
}
|
{
|
||||||
tmp.append('\0'); // End of intervall
|
my_message(ER_WRONG_FIELD_TERMINATORS,ER(ER_WRONG_FIELD_TERMINATORS),
|
||||||
|
MYF(0));
|
||||||
|
DBUG_RETURN(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int_count= field->interval_id;
|
||||||
|
tmp.append(sep);
|
||||||
|
for (const char **pos=field->interval->type_names ; *pos ; pos++)
|
||||||
|
{
|
||||||
|
tmp.append(*pos);
|
||||||
|
tmp.append(sep);
|
||||||
|
}
|
||||||
|
tmp.append('\0'); // End of intervall
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (my_write(file,(byte*) tmp.ptr(),tmp.length(),MYF_RW))
|
if (my_write(file,(byte*) tmp.ptr(),tmp.length(),MYF_RW))
|
||||||
|
@ -96,7 +96,7 @@ void vio_reset(Vio* vio, enum enum_vio_type type,
|
|||||||
vio->in_addr =vio_ssl_in_addr;
|
vio->in_addr =vio_ssl_in_addr;
|
||||||
vio->vioblocking =vio_ssl_blocking;
|
vio->vioblocking =vio_ssl_blocking;
|
||||||
vio->is_blocking =vio_is_blocking;
|
vio->is_blocking =vio_is_blocking;
|
||||||
vio->timeout =vio_ssl_timeout;
|
vio->timeout =vio_timeout;
|
||||||
}
|
}
|
||||||
else /* default is VIO_TYPE_TCPIP */
|
else /* default is VIO_TYPE_TCPIP */
|
||||||
#endif /* HAVE_OPENSSL */
|
#endif /* HAVE_OPENSSL */
|
||||||
|
11
vio/viossl.c
11
vio/viossl.c
@ -416,15 +416,4 @@ int vio_ssl_blocking(Vio * vio __attribute__((unused)),
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void vio_ssl_timeout(Vio *vio __attribute__((unused)),
|
|
||||||
uint which __attribute__((unused)),
|
|
||||||
uint timeout __attribute__((unused)))
|
|
||||||
{
|
|
||||||
#ifdef __WIN__
|
|
||||||
ulong wait_timeout= (ulong) timeout * 1000;
|
|
||||||
(void) setsockopt(vio->sd, SOL_SOCKET,
|
|
||||||
which ? SO_SNDTIMEO : SO_RCVTIMEO, (char*) &wait_timeout,
|
|
||||||
sizeof(wait_timeout));
|
|
||||||
#endif /* __WIN__ */
|
|
||||||
}
|
|
||||||
#endif /* HAVE_OPENSSL */
|
#endif /* HAVE_OPENSSL */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user