doStartTableScan() result not checked
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Drizzle |
Fix Released
|
Medium
|
Stewart Smith | |
| 7.0 |
Fix Released
|
Medium
|
Stewart Smith | |
| MariaDB |
Fix Released
|
Low
|
Michael Widenius | |
| MySQL Server |
Unknown
|
Unknown
|
Bug Description
In many places the error from doStartTableScan() is not checked. This can be spotted by adding warn_unused_result gcc attribute to it and seeing things fail.
It can also be spotted by returning an error from doStartTableScan() and instead seeing drizzled core instead of be sensible.
Related branches
- Drizzle Developers: Pending requested 2011-01-05
-
Diff: 362 lines (+83/-40)13 files modifieddrizzled/cursor.cc (+6/-3)
drizzled/cursor.h (+2/-2)
drizzled/filesort.cc (+4/-2)
drizzled/item/subselect.cc (+6/-1)
drizzled/optimizer/quick_index_merge_select.cc (+5/-1)
drizzled/records.cc (+20/-9)
drizzled/records.h (+5/-5)
drizzled/sql_delete.cc (+7/-1)
drizzled/sql_select.cc (+8/-3)
drizzled/sql_update.cc (+10/-3)
drizzled/statement/alter_table.cc (+7/-1)
plugin/haildb/haildb_engine.cc (+3/-8)
plugin/haildb/haildb_engine.h (+0/-1)
Stewart Smith (stewart) wrote : | #1 |
Changed in maria: | |
importance: | Undecided → Low |
Changed in maria: | |
assignee: | nobody → Michael Widenius (monty) |
On 06/01/2010 06:09 AM, Stewart Smith wrote:
> Public bug reported:
>
> In many places the error from doStartTableScan() is not checked. This
> can be spotted by adding warn_unused_result gcc attribute to it and
> seeing things fail.
>
> It can also be spotted by returning an error from doStartTableScan() and
> instead seeing drizzled core instead of be sensible.
We should really start adding in warn_unused_result attributes to things.
Should I perhaps make us a pandora-build test/define for it?
Changed in maria: | |
status: | New → Fix Committed |
Michael Widenius (monty) wrote : | #3 |
Fix committed to 5.2 branch
Stewart Smith (stewart) wrote : | #4 |
On Fri, 16 Jul 2010 16:25:02 -0000, Monty Taylor <email address hidden> wrote:
> We should really start adding in warn_unused_result attributes to
> things.
>
> Should I perhaps make us a pandora-build test/define for it?
yes. something that'll "just work" on non-gcc (apart from replacing them
with gcc)
--
Stewart Smith
Changed in drizzle: | |
assignee: | nobody → Stewart Smith (stewart-flamingspork) |
Changed in maria: | |
milestone: | none → 5.2 |
Changed in maria: | |
status: | Fix Committed → Fix Released |
for MySQL/MariaDB this is rnd_init and this small patch produces about 10 warnings about actual bugs in mysql 5.1.46:
--- ../mysql- 5.1.46/ sql/handler. h 2010-04-07 00:06:06.000000000 +1000 RETURN( index_end( )); unused_ result) ) ENTER(" ha_rnd_ init");
+++ sql/handler.h 2010-06-01 17:37:48.230727373 +1000
@@ -1188,7 +1188,7 @@
inited=NONE;
DBUG_
}
- int ha_rnd_init(bool scan)
+ int ha_rnd_init(bool scan) __attribute__ ((warn_
{
int result;
DBUG_