Bug #15910 Wrong value in error message
Submitted: 21 Dec 2005 16:56 Modified: 26 Jan 2006 3:14
Reporter: Joerg Bruehe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1.4 OS:Unix, big-endian, 32 bit
Assigned to: Alexey Botchkov CPU Architecture:Any

[21 Dec 2005 16:56] Joerg Bruehe
Description:
Build of 5.1.4, based on 
ChangeSet@1.1971, 2005-12-21 02:28:56+01:00, kent@mysql.com
  mysql-test-run.pl:
    Don't run "mysqlslap" on Windows
  mysqlslap.test:
    We don't run "mysqlslap" on Windows
  mysql.sln:
    Removed build of "client/mysqlslap.c" on Windows

(but occurred in earlier builds already).

This seems to be the most significant symptom:
-------------------------------------------------------
*** r/partition_error.result
--- r/partition_error.reject
***************
*** 547,551
  CREATE TABLE t1(a int)
  PARTITION BY RANGE (a) (PARTITION p1 VALUES LESS THAN(5));
  insert into t1 values (10);
! ERROR HY000: Table has no partition for value 10
  drop table t1;
--- 547,551
  CREATE TABLE t1(a int)
  PARTITION BY RANGE (a) (PARTITION p1 VALUES LESS THAN(5));
  insert into t1 values (10);
! ERROR HY000: Table has no partition for value 0
  drop table t1;
-------------------------------------------------------

Occurs in both "normal" and "ps-protol" tests ("max" was the only product built) on
pegasos3-glibc23-5.1-max.log
sol10-sparc-a-5.1-max.log
sunfire100b-5.1-max.log
sunfire100c-5.1-max.log
powermacg5-5.1-max.log
xserve-5.1-max.log

Similar error in tests "partition_list" and "partition_range".

How to repeat:
Run the test suite.
[9 Jan 2006 23:35] Kristian Nielsen
This looks simple.

The error message is formatted with %ld:

ER_NO_PARTITION_FOR_GIVEN_VALUE
	eng "Table has no partition for value %ld"

However, the argument for the format is m_part_info->part_expr->val_int(), which is longlong.

On most 32bit platforms, %ld is 32 bit and will show only the lower 32 bit of the 64-bit longlong partition number (on little endian) and unly the upper 32 bit on big endian.

Should be easy to fix by using the appropriate format for longlong (not sure what that is?), or by casting the argument to long (less elegant).
[13 Jan 2006 8:12] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/1024
[13 Jan 2006 12:53] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/1032
[18 Jan 2006 14:41] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/1268
[26 Jan 2006 3:14] Mike Hillyer
Documented in 5.1.6 changelog:

    <listitem>
        <para>
          Error message for specifying value for which no partition
          exists returned wrong values on certain platforms. (Bug #15910)
        </para>
      </listitem>