Ticket #1211 (closed Bug: wontfix)
MySQL: catching storage engine errors
| Reported by: | vipsoft | Owned by: | vipsoft |
|---|---|---|---|
| Priority: | low | Milestone: | Features requests - after Piwik 1.0 |
| Component: | Core | Keywords: | outofscope |
| Cc: | Sensitive: | no |
Description (last modified by vipsoft) (diff)
When an SQL query fails due to a storage engine error, it doesn't return an (expected) SQLSTATE error, e.g., 42S01. Instead, we get an internal errno, e.g.,
Mysqli statement execute error : Got error 28 from storage engine
where 28 is often defined in errno.h as ENOSPC, i.e., no disk space left on volume.
Can we catch errors like this and provide a more user-friendly error message to users (via php's posix_strerror() function, if available)?
Note: in the case of ENOSPC, this wouldn't necessarily be limited to INSERTs. SELECTs (e.g., JOINs) and disk-based temporary tables could also be the trigger.
Note: it looks like -1 (though not a defined errno) is also a possible "errno" that could be returned.
