Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-2656

LP:588251 - doStartTableScan() result not checked

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      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.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            stewart Stewart Smith added a comment -

            Re: doStartTableScan() result not checked
            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
            +++ sql/handler.h 2010-06-01 17:37:48.230727373 +1000
            @@ -1188,7 +1188,7 @@
            inited=NONE;
            DBUG_RETURN(index_end());
            }

            • int ha_rnd_init(bool scan)
              + int ha_rnd_init(bool scan) _attribute_ ((warn_unused_result))
              {
              int result;
              DBUG_ENTER("ha_rnd_init");
            Show
            stewart Stewart Smith added a comment - Re: doStartTableScan() result not checked 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 +++ sql/handler.h 2010-06-01 17:37:48.230727373 +1000 @@ -1188,7 +1188,7 @@ inited=NONE; DBUG_RETURN(index_end()); } int ha_rnd_init(bool scan) + int ha_rnd_init(bool scan) _ attribute _ ((warn_unused_result)) { int result; DBUG_ENTER("ha_rnd_init");
            Hide
            ratzpo Rasmus Johansson added a comment -

            Re: [Bug 588251] [NEW] doStartTableScan() result not checked
            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?

            Show
            ratzpo Rasmus Johansson added a comment - Re: [Bug 588251] [NEW] doStartTableScan() result not checked 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?
            Hide
            monty Michael Widenius added a comment -

            Re: doStartTableScan() result not checked
            Fix committed to 5.2 branch

            Show
            monty Michael Widenius added a comment - Re: doStartTableScan() result not checked Fix committed to 5.2 branch
            Hide
            stewart Stewart Smith added a comment -

            Re: [Bug 588251] [NEW] doStartTableScan() result not checked
            On Fri, 16 Jul 2010 16:25:02 -0000, Monty Taylor <mordred@inaugust.com> 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

            Show
            stewart Stewart Smith added a comment - Re: [Bug 588251] [NEW] doStartTableScan() result not checked On Fri, 16 Jul 2010 16:25:02 -0000, Monty Taylor <mordred@inaugust.com> 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
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 588251

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 588251

              People

              • Assignee:
                monty Michael Widenius
                Reporter:
                stewart Stewart Smith
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: