Bug #23327 Strange mapping of certain values for system variable
Submitted: 16 Oct 2006 9:15 Modified: 5 Oct 2007 9:51
Reporter: Heinz Schweitzer (Gold Quality Contributor) Email Updates:
Status: In progress Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1 BK, 5.0 BK, 5.1 BK OS:Microsoft Windows (XP)
Assigned to: Assigned Account CPU Architecture:Any
Tags: qc
Triage: Triaged: D4 (Minor)

[16 Oct 2006 9:15] Heinz Schweitzer
Description:
Strange mapping of certain values for system variable

MySQL Administrator 1.2.4 RC
MySQL-Server-Information
--------------------------------------------------------------------------------
Mit MySQL-Serverinstanz verbunden
  Benutzername:            root
  Hostname:                localhost
  Port:                    3306
--------------------------------------------------------------------------------
Serverinformation
  MySQL-Version:           MySQL 5.0.24a-community-nt via TCP/IP
  Netzwerkname:            localhost
  IP:                      127.0.0.1
--------------------------------------------------------------------------------
Clientinformation
  Version:                 MySQL Client Version 5.0.11
  Netzwerkname:           xxxxxxxxxxxxxx
  IP:                      xxxxxxxxxxxxxx
  Betriebssystem:          Windows XP
  Hardware:                Intel(R) Pentium(R) M processor 1600MHz, 512 MB RAM

How to repeat:
Open MySQL Administrator 1.2.4 RC 

Select 'Health'

In the right pane select the 'System Variables' tab
In there in the left pane select SQL.

In the right pane select now variable max_sort_length for edit.

Enter a negative value  --> will allways be mapped to 8388608 (screen shot v1)
Enter 0 (zero) --> will be mapped to 4

NOTE: fooled around with other values in 'General-->Performance' and got
similar results.
[16 Oct 2006 9:15] Heinz Schweitzer
v1

Attachment: shot_3.jpg (image/jpeg, text), 123.83 KiB.

[16 Oct 2006 10:50] Sveta Smirnova
Thank you for the report.

It is not MySQL Administrator bug:

$bin/mysql -uroot --socket=/tmp/mysql_ssmirnova.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.27-debug-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select @@global.max_sort_length;
+--------------------------+
| @@global.max_sort_length |
+--------------------------+
|                     1024 |
+--------------------------+
1 row in set (0.00 sec)

mysql> set @@global.max_sort_length=-4332;
Query OK, 0 rows affected (0.00 sec)

mysql> select @@global.max_sort_length;
+--------------------------+
| @@global.max_sort_length |
+--------------------------+
|                  8388608 |
+--------------------------+
1 row in set (0.00 sec)

mysql> set @@global.max_sort_length=0;
Query OK, 0 rows affected (0.00 sec)

mysql> select @@global.max_sort_length;
+--------------------------+
| @@global.max_sort_length |
+--------------------------+
|                        4 |
+--------------------------+
1 row in set (0.00 sec)

mysql> \q
Bye
[5 Sep 2007 20:16] 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/33762

ChangeSet@1.2522, 2007-09-05 16:14:40-04:00, iggy@amd64.(none) +3 -0
  Bug#23327 Strange mapping of certain values for system variable
  - Negative values assigned to system variabeles should default 
  to minimum value for that variable.