Bug #62350 mysql_stmt_result_metadata() returns invalid metadata on EXPLAIN, can crash PHP
| Submitted: | 5 Sep 2011 12:13 | Modified: | 7 Sep 2011 4:49 |
|---|---|---|---|
| Reporter: | Ulf Wendel | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: DML | Severity: | S2 (Serious) |
| Version: | 5.5/5.1 | OS: | Any |
| Assigned to: | CPU Architecture: | Any |
[5 Sep 2011 12:13]
Ulf Wendel
[6 Sep 2011 18:04]
MySQL Verification Team
Windows Vista 64-bit today source 5.1 code:
C:\DBS\5.1\bin>62350bug
Server: 5.1.60-Win X64-log
Protocol: 10
Client: 5.1.60
Executed EXPLAIN SELECT id FROM mytest_table WHERE idParent <> -1 AND idParent NOT IN ( SELECT id FROM mytest_table); returned meta...
name = id
type = 8
db_length = 0
length = 3
max_length = 21
name = select_type
type = 253
db_length = 0
length = 19
max_length = 18
name = table
type = 253
db_length = 0
length = 64
max_length = 12
name = type
type = 253
db_length = 0
length = 10
max_length = 15
name = possible_keys
type = 253
db_length = 0
length = 4096
max_length = 7
name = key
type = 253
db_length = 0
length = 64
max_length = 7
name = key_len
type = 253
db_length = 10485856
length = 4096
max_length = 1
name = ref
type = 253
db_length = 0
length = 1024
max_length = 4
name = rows
type = 8
db_length = 0
length = 10
max_length = 21
name = Extra
type = 253
db_length = 0
length = 255
max_length = 47
column = 'ALL'
length = 3
stmt->fields[3].type = 253
stmt->fields[3].max_length = 15
stmt->fields[3].length = 10
NOTE: data has been truncated!
sqlstate = '00000'
column = 'unique_subquery'
length = 15
stmt->fields[3].type = 253
stmt->fields[3].max_length = 15
stmt->fields[3].length = 10
NOTE: data has been truncated!
sqlstate = '00000'
C:\DBS\5.1\bin>
[6 Sep 2011 18:22]
Ulf Wendel
I think you verified it:
name = key_len
type = 253
db_length = 10485856
length = 4096
max_length = 1
Note the db_length.
[7 Sep 2011 4:49]
MySQL Verification Team
Windows Vista 64-bit 5.5 source tree:
C:\DBS\5.5\bin>62350bug.exe
Server: 5.5.17-log
Protocol: 10
Client: 5.5.17
Executed EXPLAIN SELECT id FROM mytest_table WHERE idParent <> -1 AND idParent NOT IN ( SELECT id FROM mytest_table); returned meta...
name = id
type = 8
db_length = 0
length = 3
max_length = 21
name = select_type
type = 253
db_length = 0
length = 19
max_length = 18
name = table
type = 253
db_length = 0
length = 64
max_length = 12
name = type
type = 253
db_length = 0
length = 10
max_length = 15
name = possible_keys
type = 253
db_length = 0
length = 4096
max_length = 7
name = key
type = 253
db_length = 0
length = 64
max_length = 7
name = key_len
type = 253
db_length = 0
length = 4096
max_length = 1
name = ref
type = 253
db_length = 0
length = 1024
max_length = 4
name = rows
type = 8
db_length = 0
length = 10
max_length = 21
name = Extra
type = 253
db_length = 0
length = 255
max_length = 47
column = 'ALL'
length = 3
stmt->fields[3].type = 253
stmt->fields[3].max_length = 15
stmt->fields[3].length = 10
NOTE: data has been truncated!
sqlstate = '00000'
column = 'unique_subquery'
length = 15
stmt->fields[3].type = 253
stmt->fields[3].max_length = 15
stmt->fields[3].length = 10
NOTE: data has been truncated!
sqlstate = '00000'
C:\DBS\5.5\bin>
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.056 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.