Commit 561c21c3 authored by unknown's avatar unknown
Browse files

Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.1-new

into mysql.com:/home/psergey/mysql-5.1-bug18025-r2


sql/sql_partition.cc:
  Auto merged
parents dc05f195 c1a3261e
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -546,6 +546,10 @@ sub command_line_setup () {
  # 5.1 test run, even if different MTR_BUILD_THREAD is used. This means
  # all port numbers might not be used in this version of the script.
  #
  # Also note the limiteation of ports we are allowed to hand out. This
  # differs between operating systems and configuration, see
  # http://www.ncftp.com/ncftpd/doc/misc/ephemeral_ports.html
  # But a fairly safe range seems to be 5001 - 32767
  if ( $ENV{'MTR_BUILD_THREAD'} )
  {
    # Up to two masters, up to three slaves
@@ -558,6 +562,13 @@ sub command_line_setup () {
    $im_mysqld2_port=           $opt_master_myport + 9;
  }

  if ( $opt_master_myport < 5001 or $opt_master_myport + 10 >= 32767 )
  {
    mtr_error("MTR_BUILD_THREAD number results in a port",
              "outside 5001 - 32767",
              "($opt_master_myport - $opt_master_myport + 10)");
  }

  # Read the command line
  # Note: Keep list, and the order, in sync with usage at end of this file

+3 −0
Original line number Diff line number Diff line
@@ -344,6 +344,9 @@ SELECT f1 AS double_val, CAST(f1 AS SIGNED INT) AS cast_val FROM t1;
double_val	cast_val
-1e+30	-9223372036854775808
1e+30	9223372036854775807
Warnings:
Warning	1292	Truncated incorrect INTEGER value: '-1e+30'
Warning	1292	Truncated incorrect INTEGER value: '1e+30'
DROP TABLE t1;
select cast('1.2' as decimal(3,2));
cast('1.2' as decimal(3,2))
+11 −1
Original line number Diff line number Diff line
@@ -642,7 +642,7 @@ drop table t1;
create table t1 (a int) engine=innodb partition by hash(a) ;
show table status like 't1';
Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
t1	PARTITION	10	Compact	2	8192	16384	0	0	0	NULL	NULL	NULL	NULL	latin1_swedish_ci	NULL		
t1	InnoDB	10	Compact	2	8192	16384	0	0	0	NULL	NULL	NULL	NULL	latin1_swedish_ci	NULL	partitioned	
drop table t1;
create table t2 (s1 int not null auto_increment, primary key (s1)) partition by list (s1) (partition p1 values in (1),partition p2 values in (2),partition p3 values in (3),partition p4 values in (4));
insert into t2 values (null),(null),(null);
@@ -819,4 +819,14 @@ explain partitions select * from t1 where a is null or a < 0 or a > 1;
id	select_type	table	partitions	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	pn,p2	ALL	NULL	NULL	NULL	NULL	2	Using where
drop table t1;
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, name VARCHAR(20)) 
ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY RANGE(id)
(PARTITION p0  VALUES LESS THAN (10) ENGINE = MyISAM,
PARTITION p1 VALUES LESS THAN (20) ENGINE = MyISAM,
PARTITION p2 VALUES LESS THAN (30) ENGINE = MyISAM);
SHOW TABLE STATUS;
Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
t1	MyISAM	10	Dynamic	0	0	0	0	0	0	NULL	NULL	NULL	NULL	latin1_swedish_ci	NULL	partitioned	
DROP TABLE t1;
End of 5.1 tests
+13 −0
Original line number Diff line number Diff line
@@ -924,4 +924,17 @@ select * from t1 where a is null or a < 0 or a > 1;
explain partitions select * from t1 where a is null or a < 0 or a > 1;
drop table t1;

#
#Bug# 17631 SHOW TABLE STATUS reports wrong engine
#
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, name VARCHAR(20)) 
ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY RANGE(id)
(PARTITION p0  VALUES LESS THAN (10) ENGINE = MyISAM,
PARTITION p1 VALUES LESS THAN (20) ENGINE = MyISAM,
PARTITION p2 VALUES LESS THAN (30) ENGINE = MyISAM);
--replace_column 6 0 7 0 8 0 9 0 12 NULL 13 NULL 14 NULL
SHOW TABLE STATUS;
DROP TABLE t1;

--echo End of 5.1 tests
+21 −2
Original line number Diff line number Diff line
@@ -4237,6 +4237,7 @@ double Field_double::val_real(void)
longlong Field_double::val_int(void)
{
  double j;
  longlong res;
#ifdef WORDS_BIGENDIAN
  if (table->s->db_low_byte_first)
  {
@@ -4247,10 +4248,28 @@ longlong Field_double::val_int(void)
    doubleget(j,ptr);
  /* Check whether we fit into longlong range */
  if (j <= (double) LONGLONG_MIN)
    return (longlong) LONGLONG_MIN;
  {
    res= (longlong) LONGLONG_MIN;
    goto warn;
  }
  if (j >= (double) (ulonglong) LONGLONG_MAX)
    return (longlong) LONGLONG_MAX;
  {
    res= (longlong) LONGLONG_MAX;
    goto warn;
  }
  return (longlong) rint(j);

warn:
  {
    char buf[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE];
    String tmp(buf, sizeof(buf), &my_charset_latin1), *str;
    str= val_str(&tmp, 0);
    push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
                        ER_TRUNCATED_WRONG_VALUE,
                        ER(ER_TRUNCATED_WRONG_VALUE), "INTEGER",
                        str->c_ptr());
  }
  return res;
}


Loading