Commit 48bc6ab2 authored by unknown's avatar unknown

Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0

into mysql.com:/usr/local/home/marty/MySQL/mysql-5.0-ndb


mysql-test/mysql-test-run.pl:
  Auto merged
parents 114487dd cc2843e2
......@@ -41,7 +41,7 @@ charset-collation code for them. */
ulint data_mysql_default_charset_coll = 99999999;
ulint data_mysql_latin1_swedish_charset_coll = 99999999;
dtype_t dtype_binary_val = {DATA_BINARY, 0, 0, 0};
dtype_t dtype_binary_val = {DATA_BINARY, 0, 0, 0, 0, 0};
dtype_t* dtype_binary = &dtype_binary_val;
/*************************************************************************
......@@ -216,6 +216,8 @@ dtype_validate(
ut_a((type->prtype & DATA_MYSQL_TYPE_MASK) < DATA_N_SYS_COLS);
}
ut_a(type->mbminlen <= type->mbmaxlen);
return(TRUE);
}
......
......@@ -271,6 +271,24 @@ dtype_get_prec(
/*===========*/
dtype_t* type);
/*************************************************************************
Gets the minimum length of a character, in bytes. */
UNIV_INLINE
ulint
dtype_get_mbminlen(
/*===============*/
/* out: minimum length of a char, in bytes,
or 0 if this is not a character type */
const dtype_t* type); /* in: type */
/*************************************************************************
Gets the maximum length of a character, in bytes. */
UNIV_INLINE
ulint
dtype_get_mbmaxlen(
/*===============*/
/* out: maximum length of a char, in bytes,
or 0 if this is not a character type */
const dtype_t* type); /* in: type */
/*************************************************************************
Gets the padding character code for the type. */
UNIV_INLINE
ulint
......@@ -352,16 +370,25 @@ dtype_print(
/*========*/
dtype_t* type); /* in: type */
/* Structure for an SQL data type */
/* Structure for an SQL data type.
If you add fields to this structure, be sure to initialize them everywhere.
This structure is initialized in the following functions:
dtype_set()
dtype_read_for_order_and_null_size()
dtype_new_read_for_order_and_null_size()
sym_tab_add_null_lit() */
struct dtype_struct{
ulint mtype; /* main data type */
ulint prtype; /* precise type; MySQL data type */
/* the remaining two fields do not affect alphabetical ordering: */
/* the remaining fields do not affect alphabetical ordering: */
ulint len; /* length */
ulint prec; /* precision */
ulint mbminlen; /* minimum length of a character, in bytes */
ulint mbmaxlen; /* maximum length of a character, in bytes */
};
#ifndef UNIV_NONINL
......
......@@ -9,15 +9,46 @@ Created 1/16/1996 Heikki Tuuri
#include "mach0data.h"
/**********************************************************************
Determines whether the given character set is of variable length.
Get the variable length bounds of the given character set.
NOTE: the prototype of this function is copied from ha_innodb.cc! If you change
this function, you MUST change also the prototype here! */
extern
ibool
innobase_is_mb_cset(
/*================*/
ulint cset); /* in: MySQL charset-collation code */
void
innobase_get_cset_width(
/*====================*/
ulint cset, /* in: MySQL charset-collation code */
ulint* mbminlen, /* out: minimum length of a char (in bytes) */
ulint* mbmaxlen); /* out: maximum length of a char (in bytes) */
/*************************************************************************
Gets the MySQL charset-collation code for MySQL string types. */
UNIV_INLINE
ulint
dtype_get_charset_coll(
/*===================*/
ulint prtype) /* in: precise data type */
{
return((prtype >> 16) & 0xFFUL);
}
/*************************************************************************
Sets the mbminlen and mbmaxlen members of a data type structure. */
UNIV_INLINE
void
dtype_set_mblen(
/*============*/
dtype_t* type) /* in/out: type struct */
{
ut_ad(type);
if (dtype_is_string_type(type->mtype)) {
innobase_get_cset_width(dtype_get_charset_coll(type->prtype),
&type->mbminlen, &type->mbmaxlen);
ut_ad(type->mbminlen <= type->mbmaxlen);
} else {
type->mbminlen = type->mbmaxlen = 0;
}
}
/*************************************************************************
Sets a data type structure. */
......@@ -39,6 +70,7 @@ dtype_set(
type->len = len;
type->prec = prec;
dtype_set_mblen(type);
ut_ad(dtype_validate(type));
}
......@@ -82,17 +114,6 @@ dtype_get_prtype(
return(type->prtype);
}
/*************************************************************************
Gets the MySQL charset-collation code for MySQL string types. */
UNIV_INLINE
ulint
dtype_get_charset_coll(
/*===================*/
ulint prtype) /* in: precise data type */
{
return((prtype >> 16) & 0xFFUL);
}
/*************************************************************************
Gets the type length. */
UNIV_INLINE
......@@ -119,6 +140,33 @@ dtype_get_prec(
return(type->prec);
}
/*************************************************************************
Gets the minimum length of a character, in bytes. */
UNIV_INLINE
ulint
dtype_get_mbminlen(
/*===============*/
/* out: minimum length of a char, in bytes,
or 0 if this is not a character type */
const dtype_t* type) /* in: type */
{
ut_ad(type);
return(type->mbminlen);
}
/*************************************************************************
Gets the maximum length of a character, in bytes. */
UNIV_INLINE
ulint
dtype_get_mbmaxlen(
/*===============*/
/* out: maximum length of a char, in bytes,
or 0 if this is not a character type */
const dtype_t* type) /* in: type */
{
ut_ad(type);
return(type->mbmaxlen);
}
/*************************************************************************
Gets the padding character code for the type. */
UNIV_INLINE
......@@ -211,6 +259,7 @@ dtype_read_for_order_and_null_size(
type->prtype = dtype_form_prtype(type->prtype,
data_mysql_default_charset_coll);
dtype_set_mblen(type);
}
/**************************************************************************
......@@ -262,6 +311,7 @@ dtype_new_read_for_order_and_null_size(
type->prtype = dtype_form_prtype(type->prtype, charset_coll);
}
dtype_set_mblen(type);
}
/***************************************************************************
......@@ -305,11 +355,40 @@ dtype_get_fixed_size(
case DATA_FLOAT:
case DATA_DOUBLE:
case DATA_MYSQL:
if ((type->prtype & DATA_BINARY_TYPE)
|| !innobase_is_mb_cset(
dtype_get_charset_coll(
type->prtype))) {
if (type->prtype & DATA_BINARY_TYPE) {
return(dtype_get_len(type));
} else {
/* We play it safe here and ask MySQL for
mbminlen and mbmaxlen. Although
type->mbminlen and type->mbmaxlen are
initialized if and only if type->prtype
is (in one of the 3 functions in this file),
it could be that none of these functions
has been called. */
ulint mbminlen, mbmaxlen;
innobase_get_cset_width(
dtype_get_charset_coll(type->prtype),
&mbminlen, &mbmaxlen);
if (type->mbminlen != mbminlen
|| type->mbmaxlen != mbmaxlen) {
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: "
"mbminlen=%lu, "
"mbmaxlen=%lu, "
"type->mbminlen=%lu, "
"type->mbmaxlen=%lu\n",
(ulong) mbminlen,
(ulong) mbmaxlen,
(ulong) type->mbminlen,
(ulong) type->mbmaxlen);
}
if (mbminlen == mbmaxlen) {
return(dtype_get_len(type));
}
}
/* fall through for variable-length charsets */
case DATA_VARCHAR:
......
......@@ -458,6 +458,10 @@ struct mysql_row_templ_struct {
numbers DATA_CHAR... */
ulint charset; /* MySQL charset-collation code
of the column, or zero */
ulint mbminlen; /* minimum length of a char, in bytes,
or zero if not a char type */
ulint mbmaxlen; /* maximum length of a char, in bytes,
or zero if not a char type */
ulint is_unsigned; /* if a column type is an integer
type and this field is != 0, then
it is an unsigned integer type */
......
......@@ -93,17 +93,11 @@ row_mysql_store_col_in_innobase_format(
|| type == DATA_BINARY) {
/* Remove trailing spaces. */
/* Handle UCS2 strings differently. As no new
collations will be introduced in 4.1, we hardcode the
charset-collation codes here. In 5.0, the logic will
be based on mbminlen. */
ulint cset = dtype_get_charset_coll(
dtype_get_prtype(dfield_get_type(dfield)));
/* Handle UCS2 strings differently. */
ulint mbminlen = dtype_get_mbminlen(
dfield_get_type(dfield));
ptr = row_mysql_read_var_ref(&col_len, mysql_data);
if (cset == 35/*ucs2_general_ci*/
|| cset == 90/*ucs2_bin*/
|| (cset >= 128/*ucs2_unicode_ci*/
&& cset <= 144/*ucs2_persian_ci*/)) {
if (mbminlen == 2) {
/* space=0x0020 */
/* Trim "half-chars", just in case. */
col_len &= ~1;
......@@ -113,6 +107,7 @@ row_mysql_store_col_in_innobase_format(
col_len -= 2;
}
} else {
ut_a(mbminlen == 1);
/* space=0x20 */
while (col_len > 0 && ptr[col_len - 1] == 0x20) {
col_len--;
......
......@@ -424,10 +424,13 @@ row_create_prebuilt(
prebuilt->sel_graph = NULL;
prebuilt->search_tuple = dtuple_create(heap,
dict_table_get_n_cols(table));
2 * dict_table_get_n_cols(table));
clust_index = dict_table_get_first_index(table);
/* Make sure that search_tuple is long enough for clustered index */
ut_a(2 * dict_table_get_n_cols(table) >= clust_index->n_fields);
ref_len = dict_index_get_n_unique(clust_index);
ref = dtuple_create(heap, ref_len);
......
......@@ -2410,14 +2410,9 @@ row_sel_store_mysql_rec(
/* Pad with trailing spaces */
data = mysql_rec + templ->mysql_col_offset;
/* Handle UCS2 strings differently. As no new
collations will be introduced in 4.1, we
hardcode the charset-collation codes here.
5.0 will use a different approach. */
if (templ->charset == 35
|| templ->charset == 90
|| (templ->charset >= 128
&& templ->charset <= 144)) {
ut_ad(templ->mbminlen <= templ->mbmaxlen);
/* Handle UCS2 strings differently. */
if (templ->mbminlen == 2) {
/* space=0x0020 */
ulint col_len = templ->mysql_col_len;
......@@ -2436,6 +2431,7 @@ row_sel_store_mysql_rec(
data[len++] = 0x20;
}
} else {
ut_ad(templ->mbminlen == 1);
/* space=0x20 */
memset(data + len, 0x20,
templ->mysql_col_len - len);
......@@ -2477,14 +2473,8 @@ row_sel_store_mysql_rec(
pad_char = '\0';
}
/* Handle UCS2 strings differently. As no new
collations will be introduced in 4.1,
we hardcode the charset-collation codes here.
5.0 will use a different approach. */
if (templ->charset == 35
|| templ->charset == 90
|| (templ->charset >= 128
&& templ->charset <= 144)) {
/* Handle UCS2 strings differently. */
if (templ->mbminlen == 2) {
/* There are two bytes per char, so the length
has to be an even number. */
ut_a(!(templ->mysql_col_len & 1));
......@@ -2497,6 +2487,7 @@ row_sel_store_mysql_rec(
len -= 2;
}
} else {
ut_ad(templ->mbminlen == 1);
memset(mysql_rec + templ->mysql_col_offset,
pad_char, templ->mysql_col_len);
}
......
This diff is collapsed.
......@@ -50,12 +50,14 @@ sub mtr_show_failed_diff ($) {
$result_file= "$result_file$::opt_result_ext";
}
my $diffopts= $::opt_udiff ? "-u" : "-c";
if ( -f $reject_file )
{
print "Below are the diffs between actual and expected results:\n";
print "-------------------------------------------------------\n";
# FIXME check result code?!
mtr_run("diff",["-c",$result_file,$reject_file], "", "", "", "");
mtr_run("diff",[$diffopts,$result_file,$reject_file], "", "", "", "");
print "-------------------------------------------------------\n";
print "Please follow the instructions outlined at\n";
print "http://www.mysql.com/doc/en/Reporting_mysqltest_bugs.html\n";
......
......@@ -156,13 +156,13 @@ our @mysqld_src_dirs=
our $glob_win32= 0; # OS and native Win32 executables
our $glob_win32_perl= 0; # ActiveState Win32 Perl
our $glob_cygwin_perl= 0; # Cygwin Perl
our $glob_cygwin_shell= undef;
our $glob_mysql_test_dir= undef;
our $glob_mysql_bench_dir= undef;
our $glob_hostname= undef;
our $glob_scriptname= undef;
our $glob_use_running_server= 0;
our $glob_use_running_ndbcluster= 0;
our $glob_user= 'test';
our $glob_use_embedded_server= 0;
our $glob_basedir;
......@@ -281,6 +281,8 @@ our $opt_wait_timeout= 10;
our $opt_warnings;
our $opt_udiff;
our $opt_with_ndbcluster;
our $opt_with_openssl;
......@@ -422,7 +424,9 @@ sub initial_setup () {
{
# Windows programs like 'mysqld' needs Windows paths
$glob_mysql_test_dir= `cygpath -m $glob_mysql_test_dir`;
$glob_cygwin_shell= `cygpath -w $ENV{'SHELL'}`; # The Windows path c:\...
chomp($glob_mysql_test_dir);
chomp($glob_cygwin_shell);
}
$glob_basedir= dirname($glob_mysql_test_dir);
$glob_mysql_bench_dir= "$glob_basedir/mysql-bench"; # FIXME make configurable
......@@ -524,6 +528,7 @@ sub command_line_setup () {
'start-from=s' => \$opt_start_from,
'timer' => \$opt_timer,
'tmpdir=s' => \$opt_tmpdir,
'unified-diff|udiff' => \$opt_udiff,
'user-test=s' => \$opt_user_test,
'user=s' => \$opt_user,
'verbose' => \$opt_verbose,
......@@ -712,17 +717,16 @@ sub command_line_setup () {
# }
#}
if ( $opt_user )
if ( ! $opt_user )
{
$glob_user= $opt_user;
}
elsif ( $glob_use_running_server )
if ( $glob_use_running_server )
{
$glob_user= "test";
$opt_user= "test";
}
else
{
$glob_user= "root"; # We want to do FLUSH xxx commands
$opt_user= "root"; # We want to do FLUSH xxx commands
}
}
}
......@@ -837,7 +841,7 @@ sub executable_setup () {
}
else
{
error("Cannot find embedded server 'mysqltest_embedded'");
mtr_error("Cannot find embedded server 'mysqltest_embedded'");
}
if ( -d "$path_tests_bindir/mysql_client_test_embedded" )
{
......@@ -860,9 +864,6 @@ sub executable_setup () {
$exe_ndb_mgm= "$glob_basedir/bin/ndb_mgm";
}
# FIXME special $exe_master_mysqld and $exe_slave_mysqld
# are not used that much....
if ( ! $exe_master_mysqld )
{
$exe_master_mysqld= $exe_mysqld;
......@@ -1099,7 +1100,7 @@ sub run_benchmarks ($) {
mtr_init_args(\$args);
mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_mysock'});
mtr_add_arg($args, "--user=root");
mtr_add_arg($args, "--user=%s", $opt_user);
if ( $opt_small_bench )
{
......@@ -1223,11 +1224,36 @@ sub install_db ($$) {
my $type= shift;
my $data_dir= shift;
my $init_db_sql= "lib/init_db.sql"; # FIXME this is too simple maybe
my $init_db_sql= "lib/init_db.sql";
my $init_db_sql_tmp= "/tmp/init_db.sql$$";
my $args;
mtr_report("Installing \u$type Databases");
open(IN, $init_db_sql)
or error("Can't open $init_db_sql: $!");
open(OUT, ">", $init_db_sql_tmp)
or error("Can't write to $init_db_sql_tmp: $!");
while (<IN>)
{
chomp;
s/\@HOSTNAME\@/$glob_hostname/;
if ( /^\s*$/ )
{
print OUT "\n";
}
elsif (/;$/)
{
print OUT "$_\n";
}
else
{
print OUT $_;
}
}
close OUT;
close IN;
mtr_init_args(\$args);
mtr_add_arg($args, "--no-defaults");
......@@ -1245,12 +1271,14 @@ sub install_db ($$) {
mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
}
if ( mtr_run($exe_mysqld, $args, $init_db_sql,
if ( mtr_run($exe_mysqld, $args, $init_db_sql_tmp,
$path_manager_log, $path_manager_log, "") != 0 )
{
unlink($init_db_sql_tmp);
mtr_error("Error executing mysqld --bootstrap\n" .
"Could not install $type test DBs");
}
unlink($init_db_sql_tmp);
}
......@@ -1499,8 +1527,8 @@ sub do_before_start_master ($$) {
$tname ne "rpl_crash_binlog_ib_3b")
{
# FIXME we really want separate dir for binlogs
`rm -fr $glob_mysql_test_dir/var/log/master-bin.*`;
# unlink("$glob_mysql_test_dir/var/log/master-bin.*");
`rm -f $glob_mysql_test_dir/var/log/master-bin*`;
# unlink("$glob_mysql_test_dir/var/log/master-bin*");
}
# Remove old master.info and relay-log.info files
......@@ -1509,8 +1537,7 @@ sub do_before_start_master ($$) {
unlink("$glob_mysql_test_dir/var/master1-data/master.info");
unlink("$glob_mysql_test_dir/var/master1-data/relay-log.info");
#run master initialization shell script if one exists
# Run master initialization shell script if one exists
if ( $master_init_script and
mtr_run($master_init_script, [], "", "", "", "") != 0 )
{
......@@ -1524,9 +1551,6 @@ sub do_before_start_slave ($$) {
my $tname= shift;
my $slave_init_script= shift;
# When testing fail-safe replication, we will have more than one slave
# in this case, we start secondary slaves with an argument
# Remove stale binary logs and old master.info files
# except for too tests which need them
if ( $tname ne "rpl_crash_binlog_ib_1b" and
......@@ -1541,14 +1565,15 @@ sub do_before_start_slave ($$) {
unlink("$glob_mysql_test_dir/var/slave-data/relay-log.info");
}
#run slave initialization shell script if one exists
# Run slave initialization shell script if one exists
if ( $slave_init_script and
mtr_run($slave_init_script, [], "", "", "", "") != 0 )
{
mtr_error("Can't run $slave_init_script");
}
unlink("$glob_mysql_test_dir/var/slave-data/log.*");
`rm -f $glob_mysql_test_dir/var/slave-data/log.*`;
# unlink("$glob_mysql_test_dir/var/slave-data/log.*");
}
sub mysqld_arguments ($$$$$) {
......@@ -1666,12 +1691,12 @@ sub mysqld_arguments ($$$$$) {
{
if ( $type eq 'master' )
{
mtr_add_arg($args, "--debug=d:t:i:A,%s/var/log/master%s.trace",
mtr_add_arg($args, "%s--debug=d:t:i:A,%s/var/log/master%s.trace",
$prefix, $glob_mysql_test_dir, $sidx);
}
if ( $type eq 'slave' )
{
mtr_add_arg($args, "--debug=d:t:i:A,%s/var/log/slave%s.trace",
mtr_add_arg($args, "%s--debug=d:t:i:A,%s/var/log/slave%s.trace",
$prefix, $glob_mysql_test_dir, $sidx);
}
}
......@@ -1786,18 +1811,17 @@ sub mysqld_start ($$$$) {
my $exe;
my $pid;
# FIXME code duplication, make up your mind....
if ( $opt_source_dist )
if ( $type eq 'master' )
{
$exe= "$glob_basedir/sql/mysqld";
$exe= $exe_master_mysqld;
}
else
{
$exe ="$glob_basedir/libexec/mysqld";
if ( ! -x $exe )
elsif ( $type eq 'slave' )
{
$exe ="$glob_basedir/bin/mysqld";
$exe= $exe_slave_mysqld;
}
else
{
$exe= $exe_mysqld;
}
mtr_init_args(\$args);
......@@ -1980,7 +2004,7 @@ sub run_mysqltest ($$) {
mtr_add_arg($args, "--no-defaults");
mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_mysock'});
mtr_add_arg($args, "--database=test");
mtr_add_arg($args, "--user=%s", $glob_user);
mtr_add_arg($args, "--user=%s", $opt_user);
mtr_add_arg($args, "--password=");
mtr_add_arg($args, "--silent");
mtr_add_arg($args, "-v");
......@@ -2051,7 +2075,7 @@ sub run_mysqltest ($$) {
mysqld_arguments($args,'master',0,$tinfo->{'master_opt'},[]);
}
return mtr_run($exe_mysqltest,$args,$tinfo->{'path'},"",$path_timefile,"");
return mtr_run_test($exe_mysqltest,$args,$tinfo->{'path'},"",$path_timefile,"");
}
##############################################################################
......@@ -2133,6 +2157,7 @@ Misc options
start-and-exit Only initiate and start the "mysqld" servers
fast Don't try to cleanup from earlier runs
help Get this help text
unified-diff | udiff When presenting differences, use unified diff
Options not yet described, or that I want to look into more
......
......@@ -6,5 +6,5 @@ drop table t1;
flush tables;
CREATE TABLE t1 (a int) ENGINE=INNODB;
SELECT * from T1;
ERROR HY000: Can't open file: 'T1.ibd' (errno: 1)
ERROR 42S02: Table 'test.T1' doesn't exist
drop table t1;
......@@ -32,6 +32,6 @@ flush tables;
#
CREATE TABLE t1 (a int) ENGINE=INNODB;
--error 1016
--error 1146
SELECT * from T1;
drop table t1;
......@@ -535,22 +535,31 @@ innobase_mysql_print_thd(
}
/**********************************************************************
Determines whether the given character set is of variable length.
Get the variable length bounds of the given character set.
NOTE that the exact prototype of this function has to be in
/innobase/data/data0type.ic! */
extern "C"
ibool
innobase_is_mb_cset(
/*================*/
ulint cset) /* in: MySQL charset-collation code */
void
innobase_get_cset_width(
/*====================*/
ulint cset, /* in: MySQL charset-collation code */
ulint* mbminlen, /* out: minimum length of a char (in bytes) */
ulint* mbmaxlen) /* out: maximum length of a char (in bytes) */
{
CHARSET_INFO* cs;
ut_ad(cset < 256);
ut_ad(mbminlen);
ut_ad(mbmaxlen);
cs = all_charsets[cset];
return(cs && cs->mbminlen != cs->mbmaxlen);
if (cs) {
*mbminlen = cs->mbminlen;
*mbmaxlen = cs->mbmaxlen;
} else {
ut_a(cset == 0);
*mbminlen = *mbmaxlen = 0;
}
}
/**********************************************************************
......@@ -1079,6 +1088,8 @@ innobase_init(void)
if (ret == FALSE) {
sql_print_error(
"InnoDB: syntax error in innodb_data_file_path");
my_free(internal_innobase_data_file_path,
MYF(MY_ALLOW_ZERO_PTR));
DBUG_RETURN(TRUE);
}
......@@ -1109,6 +1120,8 @@ innobase_init(void)
"InnoDB: syntax error in innodb_log_group_home_dir\n"
"InnoDB: or a wrong number of mirrored log groups\n");
my_free(internal_innobase_data_file_path,
MYF(MY_ALLOW_ZERO_PTR));
DBUG_RETURN(TRUE);
}
......@@ -1197,7 +1210,8 @@ innobase_init(void)
err = innobase_start_or_create_for_mysql();
if (err != DB_SUCCESS) {
my_free(internal_innobase_data_file_path,
MYF(MY_ALLOW_ZERO_PTR));
DBUG_RETURN(1);
}
......@@ -1241,22 +1255,22 @@ innobase_end(void)
set_panic_flag_for_netware();
}
#endif
if (innodb_inited)
{
if (innodb_inited) {
if (innobase_very_fast_shutdown) {
srv_very_fast_shutdown = TRUE;
fprintf(stderr,
"InnoDB: MySQL has requested a very fast shutdown without flushing\n"
"InnoDB: the InnoDB buffer pool to data files. At the next mysqld startup\n"
"InnoDB: InnoDB will do a crash recovery!\n");
}
innodb_inited= 0;
if (innobase_shutdown_for_mysql() != DB_SUCCESS)
err= 1;
innodb_inited = 0;
if (innobase_shutdown_for_mysql() != DB_SUCCESS) {
err = 1;
}
hash_free(&innobase_open_tables);
my_free(internal_innobase_data_file_path,MYF(MY_ALLOW_ZERO_PTR));
my_free(internal_innobase_data_file_path,
MYF(MY_ALLOW_ZERO_PTR));
pthread_mutex_destroy(&innobase_mutex);
}
......@@ -1861,7 +1875,7 @@ ha_innobase::open(
my_free((char*) upd_buff, MYF(0));
my_errno = ENOENT;
DBUG_RETURN(1);
DBUG_RETURN(HA_ERR_NO_SUCH_TABLE);
}
if (ib_table->ibd_file_missing && !thd->tablespace_op) {
......@@ -1878,7 +1892,7 @@ ha_innobase::open(
my_free((char*) upd_buff, MYF(0));
my_errno = ENOENT;
DBUG_RETURN(1);
DBUG_RETURN(HA_ERR_NO_SUCH_TABLE);
}
innobase_prebuilt = row_create_prebuilt(ib_table);
......@@ -2475,6 +2489,8 @@ build_template(
templ->type = get_innobase_type_from_mysql_type(field);
templ->charset = dtype_get_charset_coll_noninline(
index->table->cols[i].type.prtype);
templ->mbminlen = index->table->cols[i].type.mbminlen;
templ->mbmaxlen = index->table->cols[i].type.mbmaxlen;
templ->is_unsigned = (ulint) (field->flags & UNSIGNED_FLAG);
if (templ->type == DATA_BLOB) {
......
......@@ -1189,7 +1189,7 @@ int bin2decimal(char *from, decimal *to, int precision, int scale)
intg0=intg/DIG_PER_DEC1, frac0=scale/DIG_PER_DEC1,
intg0x=intg-intg0*DIG_PER_DEC1, frac0x=scale-frac0*DIG_PER_DEC1,
intg1=intg0+(intg0x>0), frac1=frac0+(frac0x>0);
dec1 *buf=to->buf, mask=(*from <0) ? 0 : -1;
dec1 *buf=to->buf, mask=(*from & 0x80) ? 0 : -1;
char *stop;
char *d_copy;
int bin_size= decimal_bin_size(precision, scale);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment