Commit 53291548 authored by unknown's avatar unknown
Browse files

BUG#17138: Error in stored procedure

Review comments


mysql-test/t/partition.test:
  Changed procedure names ensured procedures were dropped
sql/ha_ndbcluster.h:
  Improved name of method
sql/ha_partition.h:
  Improved name of method
sql/handler.h:
  Improved name of method
  Removed deprecated constants
sql/item_sum.cc:
  Improved name of method
sql/sql_acl.cc:
  Improved name of method
sql/sql_insert.cc:
  Removed use of HA_WRITE_SKIP and introduced is_fatal_error instead
sql/sql_select.cc:
  Improved name of method
sql/sql_table.cc:
  Improved name of method
  Reintroduced dead code for future possible use
sql/sql_union.cc:
  Improved name of method
sql/sql_update.cc:
  Improved name of method
parent 9fc2ade2
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1202,6 +1202,8 @@ drop database db99;
#
#BUG 17138 Problem with stored procedure and analyze partition
#
drop procedure mysqltest_1 if exists;

create table t1 (a int)
partition by list (a)
(partition p0 values in (0));
@@ -1209,7 +1211,7 @@ partition by list (a)
insert into t1 values (0);
delimiter //;

create procedure po ()
create procedure mysqltest_1 ()
begin
  begin
    declare continue handler for sqlexception begin end;
@@ -1219,7 +1221,9 @@ begin
  execute stmt1;
end//

call po()//
call mysqltest_1()//
delimiter ;//
drop table t1;
drop procedure mysqltest_1;

--echo End of 5.1 tests
+2 −2
Original line number Diff line number Diff line
@@ -654,9 +654,9 @@ class ha_ndbcluster: public handler
  int get_default_no_partitions(ulonglong max_rows);
  bool get_no_parts(const char *name, uint *no_parts);
  void set_auto_partitions(partition_info *part_info);
  virtual bool cannot_ignore_error(int error, uint flags)
  virtual bool is_fatal_error(int error, uint flags)
  {
    if (!handler::cannot_ignore_error(error, flags))
    if (!handler::is_fatal_error(error, flags))
      return FALSE;
    if (error == HA_ERR_NO_PARTITION_FOUND)
      return FALSE;
+2 −2
Original line number Diff line number Diff line
@@ -302,9 +302,9 @@ class ha_partition :public handler
  virtual void start_bulk_insert(ha_rows rows);
  virtual int end_bulk_insert();

  virtual bool cannot_ignore_error(int error, uint flags)
  virtual bool is_fatal_error(int error, uint flags)
  {
    if (!handler::cannot_ignore_error(error, flags))
    if (!handler::is_fatal_error(error, flags))
      return FALSE;
    if (error == HA_ERR_NO_PARTITION_FOUND)
      return FALSE;
+1 −6
Original line number Diff line number Diff line
@@ -216,11 +216,6 @@
#define HA_BLOCK_LOCK		256	/* unlock when reading some records */
#define HA_OPEN_TEMPORARY	512

	/* Errors on write which is recoverable  (Key exist) */
#define HA_WRITE_SKIP 121		/* Duplicate key on write */
#define HA_READ_CHECK 123		/* Update with is recoverable */
#define HA_CANT_DO_THAT 131		/* Databasehandler can't do it */

	/* Some key definitions */
#define HA_KEY_NULL_LENGTH	1
#define HA_KEY_BLOB_LENGTH	2
@@ -984,7 +979,7 @@ class handler :public Sql_alloc
#define HA_CHECK_DUPP_KEY 1
#define HA_CHECK_DUPP_UNIQUE 2
#define HA_CHECK_DUPP (HA_CHECK_DUPP_KEY + HA_CHECK_DUPP_UNIQUE)
  virtual bool cannot_ignore_error(int error, uint flags)
  virtual bool is_fatal_error(int error, uint flags)
  {
    if (!error ||
        ((flags & HA_CHECK_DUPP_KEY) &&
+1 −1
Original line number Diff line number Diff line
@@ -2663,7 +2663,7 @@ bool Item_sum_count_distinct::add()
    return tree->unique_add(table->record[0] + table->s->null_bytes);
  }
  if ((error= table->file->ha_write_row(table->record[0])) &&
      table->file->cannot_ignore_error(error, HA_CHECK_DUPP))
      table->file->is_fatal_error(error, HA_CHECK_DUPP))
    return TRUE;
  return FALSE;
}
Loading