Bug #9899 | EXPLAIN SELECT 1; shows NOT_NULL_FLAG flag - but a NULL result | ||
---|---|---|---|
Submitted: | 14 Apr 2005 11:49 | Modified: | 20 Jun 2005 22:13 |
Reporter: | MySQL-Front Team | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 4.1.13 | OS: | Windows (Windows XP) |
Assigned to: | Igor Babaev | CPU Architecture: | Any |
[14 Apr 2005 11:49]
MySQL-Front Team
[14 Apr 2005 13:58]
Jorge del Conde
Thanks for your bug report. Verified w/5.0.4
[27 May 2005 10:48]
Sergei Golubchik
4.1 is affected too
[7 Jun 2005 12:04]
Igor Babaev
The attribute of nullability was not set correctly for some columns of the EXPLAIN table. This can be seen from the following example run from mysql that was launched with the 'T' option: mysql> explain select 1; Catalog: 'def' Database: '' Table: '' Name: 'id' Type: 8 Length: 3 Max length: 1 Is_null: 0 Flags: 32929 Decimals: 0 Catalog: 'def' Database: '' Table: '' Name: 'select_type' Type: 253 Length: 19 Max length: 6 Is_null: 0 Flags: 1 Decimals: 31 Catalog: 'def' Database: '' Table: '' Name: 'table' Type: 253 Length: 64 Max length: 0 Is_null: 0 Flags: 1 Decimals: 31 Catalog: 'def' Database: '' Table: '' Name: 'type' Type: 253 Length: 10 Max length: 0 Is_null: 0 Flags: 1 Decimals: 31 Catalog: 'def' Database: '' Table: '' Name: 'possible_keys' Type: 253 Length: 4096 Max length: 0 Is_null: 1 Flags: 0 Decimals: 31 Catalog: 'def' Database: '' Table: '' Name: 'key' Type: 253 Length: 64 Max length: 0 Is_null: 1 Flags: 0 Decimals: 31 Catalog: 'def' Database: '' Table: '' Name: 'key_len' Type: 253 Length: 4096 Max length: 0 Is_null: 1 Flags: 128 Decimals: 31 Catalog: 'def' Database: '' Table: '' Name: 'ref' Type: 253 Length: 1024 Max length: 0 Is_null: 1 Flags: 0 Decimals: 31 Catalog: 'def' Database: '' Table: '' Name: 'rows' Type: 8 Length: 10 Max length: 0 Is_null: 0 Flags: 32929 Decimals: 0 Catalog: 'def' Database: '' Table: '' Name: 'Extra' Type: 253 Length: 255 Max length: 14 Is_null: 0 Flags: 1 Decimals: 31 +----+-------------+-------+------+---------------+------+---------+------+------+----------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+------+---------------+------+---------+------+------+----------------+ | 1 | SIMPLE | NULL | NULL | NULL | NULL | NULL | NULL | NULL | No tables used | +----+-------------+-------+------+---------------+------+---------+------+------+----------------+ 1 row in set (16.35 sec) THe nullability attribute has to be set to 1 for the columns 'table', 'type' and 'rows'. (This report and corresponding patch was prepared by Alexander Ivanov).
[7 Jun 2005 13:34]
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/internals/25706
[7 Jun 2005 16:41]
Igor Babaev
ChangeSet 1.2321 05/06/07 06:34:13 igor@rurik.mysql.com +6 -0 Many files: Fixed bug #9899: erronious NOT_NULL flag for some attributes in the EXPLAIN table. The fix will appear in 4.1.13 and 5.0.7.
[8 Jun 2005 7:02]
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/internals/25742
[20 Jun 2005 22:13]
Mike Hillyer
Documented in the 4.1.13 and 5.0.7 changelogs: <listitem><para> The <literal>table</literal>, <literal>type</literal>, and <literal>rows</literal> columns of <literal>EXPLAIN</literal> output can now be <literal>NULL</literal>. This is required for using <literal>EXPLAIN</literal> on <literal>SELECT</literal> queries that use no tables (i.e. <literal>EXPLAIN SELECT 1</literal>). (Bug # 9899) </para></listitem>