Bug #14100 | STRAIGHT_JOIN hint causes a eq_ref to become ref and fail to see 0/1 rowmatches | ||
---|---|---|---|
Submitted: | 18 Oct 2005 0:54 | Modified: | 14 Jul 2006 16:10 |
Reporter: | Tobias Asplund | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 5.0.13-rc/4.1.XX | OS: | Windows (Windows/FreeBSD) |
Assigned to: | Timour Katchaounov | CPU Architecture: | Any |
[18 Oct 2005 0:54]
Tobias Asplund
[14 Jul 2006 16:10]
Timour Katchaounov
This behavior is as expected because the column "Capital" can contain NULLs. In fact it is even defined as "DEFAULT NULL". Since it may contain NULL values, there can be more than one NULL values, thus we can't use 'eq_ref'. The documentation also says: "A UNIQUE index creates a constraint such that all values in the index must be distinct. An error occurs if you try to add a new row with a key value that matches an existing row. This constraint does not apply to NULL values except for the BDB storage engine. For other engines, a UNIQUE index allows multiple NULL values for columns that can contain NULL."