Commit af3d3c42 authored by tomas@poseidon.ndb.mysql.com's avatar tomas@poseidon.ndb.mysql.com

Merge poseidon.ndb.mysql.com:/home/tomas/mysql-5.0

into poseidon.ndb.mysql.com:/home/tomas/mysql-5.0-ndb-new
parents 3d8e27ee 8073b2d5
......@@ -2572,6 +2572,15 @@ EOF
AC_CONFIG_SUBDIRS(innobase)
fi
case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc-$have_ndbcluster in
*solaris*-i?86-no-yes)
# ndb fail for whatever strange reason to link Sun Forte/x86
# unless using incremental linker
CXXFLAGS="$CXXFLAGS -xildon"
;;
*) ;;
esac
if test X"$have_ndbcluster" = Xyes
then
if test X"$mysql_cv_compress" != Xyes
......
......@@ -35,6 +35,7 @@
#define HEADER_LENGTH 32 /* Length of header in errmsg.sys */
#define DEFAULT_CHARSET_DIR "../sql/share/charsets"
#define ER_PREFIX "ER_"
#define WARN_PREFIX "WARN_"
static char *OUTFILE= (char*) "errmsg.sys";
static char *HEADERFILE= (char*) "mysqld_error.h";
static char *NAMEFILE= (char*) "mysqld_ername.h";
......@@ -453,7 +454,7 @@ static int parse_input_file(const char *file_name, struct errors **top_error,
DBUG_RETURN(0);
continue;
}
if (is_prefix(str, ER_PREFIX))
if (is_prefix(str, ER_PREFIX) || is_prefix(str, WARN_PREFIX))
{
if (!(current_error= parse_error_string(str, rcount)))
{
......
......@@ -241,6 +241,7 @@ USE_EMBEDDED_SERVER=""
RESULT_EXT=""
TEST_MODE="default"
NDB_MGM_EXTRA_OPTS=
NDB_MGMD_EXTRA_OPTS=
NDBD_EXTRA_OPTS=
......@@ -264,6 +265,8 @@ while test $# -gt 0; do
--ndb-connectstring=*)
USE_NDBCLUSTER="--ndbcluster" ;
USE_RUNNING_NDBCLUSTER=`$ECHO "$1" | $SED -e "s;--ndb-connectstring=;;"` ;;
--ndb_mgm-extra-opts=*)
NDB_MGM_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndb_mgm-extra-opts=;;"` ;;
--ndb_mgmd-extra-opts=*)
NDB_MGMD_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndb_mgmd-extra-opts=;;"` ;;
--ndbd-extra-opts=*)
......@@ -470,7 +473,7 @@ SMALL_SERVER="--key_buffer_size=1M --sort_buffer=256K --max_heap_table_size=1M"
export MASTER_MYPORT MASTER_MYPORT1 SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MASTER_MYSOCK1
NDBCLUSTER_BASE_PORT=`expr $NDBCLUSTER_PORT + 2`
NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --port-base=$NDBCLUSTER_BASE_PORT --data-dir=$MYSQL_TEST_DIR/var --ndb_mgmd-extra-opts=\"$NDB_MGMD_EXTRA_OPTS\" --ndbd-extra-opts=\"$NDBD_EXTRA_OPTS\""
NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --port-base=$NDBCLUSTER_BASE_PORT --data-dir=$MYSQL_TEST_DIR/var --ndb_mgm-extra-opts=$NDB_MGM_EXTRA_OPTS --ndb_mgmd-extra-opts=$NDB_MGMD_EXTRA_OPTS --ndbd-extra-opts=$NDBD_EXTRA_OPTS"
if [ x$SOURCE_DIST = x1 ] ; then
MY_BASEDIR=$MYSQL_TEST_DIR
......
......@@ -58,6 +58,7 @@ ndb_con_op=105000
ndb_dmem=80M
ndb_imem=24M
NDB_MGM_EXTRA_OPTS=
NDB_MGMD_EXTRA_OPTS=
NDBD_EXTRA_OPTS=
......@@ -97,6 +98,9 @@ while test $# -gt 0; do
--port-base=*)
port_base=`echo "$1" | sed -e "s;--port-base=;;"`
;;
--ndb_mgm-extra-opts=*)
NDB_MGM_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndb_mgm-extra-opts=;;"`
;;
--ndb_mgmd-extra-opts=*)
NDB_MGMD_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndb_mgmd-extra-opts=;;"`
;;
......@@ -130,7 +134,7 @@ if [ ! -x "$exec_waiter" ]; then
exit 1
fi
exec_mgmtclient="$exec_mgmtclient --no-defaults"
exec_mgmtclient="$exec_mgmtclient --no-defaults $NDB_MGM_EXTRA_OPTS"
exec_mgmtsrvr="$exec_mgmtsrvr --no-defaults $NDB_MGMD_EXTRA_OPTS"
exec_ndb="$exec_ndb --no-defaults $NDBD_EXTRA_OPTS"
exec_waiter="$exec_waiter --no-defaults"
......@@ -178,8 +182,8 @@ fi
# Edit file system path and ports in config file
if [ $initial_ndb ] ; then
rm -f $fs_ndb/ndb_*
sed \
rm -f $fs_ndb/ndb_* 2>&1 | cat > /dev/null
sed \
-e s,"CHOOSE_MaxNoOfOrderedIndexes","$ndb_no_ord",g \
-e s,"CHOOSE_MaxNoOfConcurrentOperations","$ndb_con_op",g \
-e s,"CHOOSE_DataMemory","$ndb_dmem",g \
......
......@@ -814,14 +814,14 @@ DROP TABLE t1;
CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6));
INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello ');
INSERT INTO t1 (col1) VALUES ('hellobob');
ERROR 01000: Data truncated for column 'col1' at row 1
ERROR 22001: Data too long for column 'col1' at row 1
INSERT INTO t1 (col2) VALUES ('hellobob');
ERROR 01000: Data truncated for column 'col2' at row 1
INSERT INTO t1 (col2) VALUES ('hello ');
Warnings:
Note 1265 Data truncated for column 'col2' at row 1
UPDATE t1 SET col1 ='hellobob' WHERE col1 ='he';
ERROR 01000: Data truncated for column 'col1' at row 2
ERROR 22001: Data too long for column 'col1' at row 2
UPDATE t1 SET col2 ='hellobob' WHERE col2 ='he';
ERROR 01000: Data truncated for column 'col2' at row 2
INSERT IGNORE INTO t1 VALUES ('hellobob', 'hellobob');
......
......@@ -565,12 +565,12 @@ DROP TABLE t1;
CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6));
INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello ');
--error 1265
--error 1400
INSERT INTO t1 (col1) VALUES ('hellobob');
--error 1265
INSERT INTO t1 (col2) VALUES ('hellobob');
INSERT INTO t1 (col2) VALUES ('hello ');
--error 1265
--error 1400
UPDATE t1 SET col1 ='hellobob' WHERE col1 ='he';
--error 1265
UPDATE t1 SET col2 ='hellobob' WHERE col2 ='he';
......
......@@ -2976,6 +2976,8 @@ void Dbdih::execCOPY_FRAGREF(Signal* signal)
SystemError * const sysErr = (SystemError*)&signal->theData[0];
sysErr->errorCode = SystemError::CopyFragRefError;
sysErr->errorRef = reference();
sysErr->data1 = errorCode;
sysErr->data2 = 0;
sendSignal(cntrRef, GSN_SYSTEM_ERROR, signal,
SystemError::SignalLength, JBB);
return;
......@@ -4492,6 +4494,8 @@ void Dbdih::handleTakeOverNewMaster(Signal* signal, Uint32 takeOverPtrI)
SystemError * const sysErr = (SystemError*)&signal->theData[0];
sysErr->errorCode = SystemError::CopyFragRefError;
sysErr->errorRef = reference();
sysErr->data1= 0;
sysErr->data2= __LINE__;
sendSignal(cntrRef, GSN_SYSTEM_ERROR, signal,
SystemError::SignalLength, JBB);
}
......
......@@ -117,7 +117,7 @@ bool Field::check_int(const char *str, int length, const char *int_end,
{
if (!my_isspace(cs,*str))
{
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
return 1;
}
}
......@@ -662,7 +662,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
from++;
if (from == end)
{
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
is_cuted_fields_incr=1;
}
else if (*from == '+' || *from == '-') // Found some sign ?
......@@ -738,7 +738,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
for (;from != end && my_isspace(&my_charset_bin, *from); from++) ;
if (from != end) // If still something left, warn
{
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
is_cuted_fields_incr=1;
}
}
......@@ -917,7 +917,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
{
if (!is_cuted_fields_incr)
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_TRUNCATED, 1);
WARN_DATA_TRUNCATED, 1);
return 0;
}
continue;
......@@ -939,7 +939,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
This is a note, not a warning, as we don't want to abort
when we cut decimals in strict mode
*/
set_warning(MYSQL_ERROR::WARN_LEVEL_NOTE, ER_WARN_DATA_TRUNCATED, 1);
set_warning(MYSQL_ERROR::WARN_LEVEL_NOTE, WARN_DATA_TRUNCATED, 1);
}
return 0;
}
......@@ -2367,8 +2367,7 @@ int Field_float::store(const char *from,uint len,CHARSET_INFO *cs)
table->in_use->count_cuted_fields))
{
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
(error ? ER_WARN_DATA_OUT_OF_RANGE : ER_WARN_DATA_TRUNCATED),
1);
(error ? ER_WARN_DATA_OUT_OF_RANGE : WARN_DATA_TRUNCATED), 1);
error= 1;
}
Field_float::store(nr);
......@@ -2656,8 +2655,7 @@ int Field_double::store(const char *from,uint len,CHARSET_INFO *cs)
table->in_use->count_cuted_fields))
{
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
(error ? ER_WARN_DATA_OUT_OF_RANGE : ER_WARN_DATA_TRUNCATED),
1);
(error ? ER_WARN_DATA_OUT_OF_RANGE : WARN_DATA_TRUNCATED), 1);
error= 1;
}
Field_double::store(nr);
......@@ -3024,7 +3022,7 @@ int Field_timestamp::store(const char *from,uint len,CHARSET_INFO *cs)
if (error || !have_smth_to_conv)
{
error= 1;
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED,
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED,
from, len, MYSQL_TIMESTAMP_DATETIME, 1);
}
......@@ -3104,7 +3102,7 @@ int Field_timestamp::store(longlong nr)
}
else if (error)
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_TRUNCATED,
WARN_DATA_TRUNCATED,
nr, MYSQL_TIMESTAMP_DATETIME, 1);
#ifdef WORDS_BIGENDIAN
......@@ -3337,14 +3335,14 @@ int Field_time::store(const char *from,uint len,CHARSET_INFO *cs)
{
tmp=0L;
error= 1;
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED,
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED,
from, len, MYSQL_TIMESTAMP_TIME, 1);
}
else
{
if (error)
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_TRUNCATED,
WARN_DATA_TRUNCATED,
from, len, MYSQL_TIMESTAMP_TIME, 1);
if (ltime.month)
......@@ -3700,7 +3698,7 @@ int Field_date::store(const char *from, uint len,CHARSET_INFO *cs)
tmp=(uint32) l_time.year*10000L + (uint32) (l_time.month*100+l_time.day);
if (error)
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED,
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED,
from, len, MYSQL_TIMESTAMP_DATE, 1);
#ifdef WORDS_BIGENDIAN
......@@ -3896,7 +3894,7 @@ int Field_newdate::store(const char *from,uint len,CHARSET_INFO *cs)
tmp= l_time.day + l_time.month*32 + l_time.year*16*32;
if (error)
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED,
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED,
from, len, MYSQL_TIMESTAMP_DATE, 1);
int3store(ptr,tmp);
......@@ -3909,7 +3907,7 @@ int Field_newdate::store(double nr)
{
(void) Field_newdate::store((longlong) -1);
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_TRUNCATED, nr, MYSQL_TIMESTAMP_DATE);
WARN_DATA_TRUNCATED, nr, MYSQL_TIMESTAMP_DATE);
return 1;
}
else
......@@ -3968,7 +3966,7 @@ int Field_newdate::store_time(TIME *ltime,timestamp_type type)
{
tmp=0;
error= 1;
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
}
int3store(ptr,tmp);
return error;
......@@ -4124,7 +4122,7 @@ int Field_datetime::store(longlong nr)
if (error)
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_TRUNCATED, initial_nr,
WARN_DATA_TRUNCATED, initial_nr,
MYSQL_TIMESTAMP_DATETIME, 1);
#ifdef WORDS_BIGENDIAN
......@@ -4154,7 +4152,7 @@ int Field_datetime::store_time(TIME *ltime,timestamp_type type)
{
tmp=0;
error= 1;
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
}
#ifdef WORDS_BIGENDIAN
if (table->s->db_low_byte_first)
......@@ -4370,8 +4368,12 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
error= 1;
}
if (error)
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
{
if (table->in_use->abort_on_warning)
set_warning(MYSQL_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1);
else
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
}
return error;
}
......@@ -4724,7 +4726,7 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
error= 1;
}
if (error)
set_warning(level, ER_WARN_DATA_TRUNCATED, 1);
set_warning(level, WARN_DATA_TRUNCATED, 1);
return error;
}
......@@ -5325,7 +5327,7 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
bmove(ptr+packlength,(char*) &from,sizeof(char*));
}
if (error)
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
return 0;
}
......@@ -5911,11 +5913,11 @@ int Field_enum::store(const char *from,uint length,CHARSET_INFO *cs)
if (err || end != from+length || tmp > typelib->count)
{
tmp=0;
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
}
}
else
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
}
store_type((ulonglong) tmp);
return err;
......@@ -5933,7 +5935,7 @@ int Field_enum::store(longlong nr)
int error= 0;
if ((uint) nr > typelib->count || nr == 0)
{
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
nr=0;
error=1;
}
......@@ -6092,11 +6094,11 @@ int Field_set::store(const char *from,uint length,CHARSET_INFO *cs)
tmp > (ulonglong) (((longlong) 1 << typelib->count) - (longlong) 1))
{
tmp=0;
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
}
}
else if (got_warning)
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
store_type(tmp);
return err;
}
......@@ -6109,7 +6111,7 @@ int Field_set::store(longlong nr)
(longlong) 1))
{
nr&= (longlong) (((longlong) 1 << typelib->count) - (longlong) 1);
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
error=1;
}
store_type((ulonglong) nr);
......
......@@ -121,8 +121,7 @@ set_field_to_null(Field *field)
field->reset();
if (current_thd->count_cuted_fields == CHECK_FIELD_WARN)
{
field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_TRUNCATED, 1);
field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
return 0;
}
if (!current_thd->no_errors)
......@@ -230,7 +229,7 @@ static void do_copy_not_null(Copy_field *copy)
if (*copy->from_null_ptr & copy->from_bit)
{
copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_TRUNCATED, 1);
WARN_DATA_TRUNCATED, 1);
copy->to_field->reset();
}
else
......@@ -336,7 +335,7 @@ static void do_cut_string(Copy_field *copy)
if (!my_isspace(system_charset_info, *ptr)) // QQ: ucs incompatible
{
copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_TRUNCATED, 1);
WARN_DATA_TRUNCATED, 1);
break;
}
}
......@@ -360,7 +359,7 @@ static void do_varstring1(Copy_field *copy)
length=copy->to_length - 1;
if (current_thd->count_cuted_fields)
copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_TRUNCATED, 1);
WARN_DATA_TRUNCATED, 1);
}
*(uchar*) copy->to_ptr= (uchar) length;
memcpy(copy->to_ptr+1, copy->from_ptr + 1, length);
......@@ -375,7 +374,7 @@ static void do_varstring2(Copy_field *copy)
length=copy->to_length-HA_KEY_BLOB_LENGTH;
if (current_thd->count_cuted_fields)
copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_TRUNCATED, 1);
WARN_DATA_TRUNCATED, 1);
}
int2store(copy->to_ptr,length);
memcpy(copy->to_ptr+HA_KEY_BLOB_LENGTH, copy->from_ptr + HA_KEY_BLOB_LENGTH,
......
......@@ -4900,7 +4900,7 @@ ER_WARN_DATA_OUT_OF_RANGE 22003
ger "Daten abgeschnitten, auerhalb des Wertebereichs fr Spalte '%s' in Zeile %ld"
por "Dado truncado, fora de alcance para coluna '%s' na linha %ld"
spa "Datos truncados, fuera de gama para columna '%s' en la lnea %ld"
ER_WARN_DATA_TRUNCATED 01000
WARN_DATA_TRUNCATED 01000
eng "Data truncated for column '%s' at row %ld"
ger "Daten abgeschnitten fr Spalte '%s' in Zeile %ld"
por "Dado truncado para coluna '%s' na linha %ld"
......@@ -5312,3 +5312,5 @@ ER_PROC_AUTO_GRANT_FAIL
eng "Failed to grant EXECUTE and ALTER ROUTINE privileges"
ER_PROC_AUTO_REVOKE_FAIL
eng "Failed to revoke all privileges to dropped routine"
ER_DATA_TOO_LONG 22001
eng "Data too long for column '%s' at row %ld"
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