Zeta Components
  1. Zeta Components
  2. ZETACOMP-104

Database component for sqlabstraction which is query.php has a serious bug

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Component/s: Database
    • Labels:
    • Environment:
      Ubuntu Natty - AMD Athlon X2

      Description

      Database component which is on sqlabstraction folder ( query.php ) has a serious bug. Private properties of boundValues and boundParameters give an irk problem. they persisted ! somehow, reset method on inherited class cannot fully reset this variables.

      My quick fix is, just set those properties to protected attribute, and case closed

      ADDED:

      I attached my failed test if those properties still in private attribute. ( I am using Simpletest on this case ). My test failed on QuerySelectImpl on testingBindInteger section with some value on previous test - testingBindString - carried with, even if I'd already reset it.

      this is the simpletest code:

      {{{
      ...
      function testingBindString()

      { $expected = 2; $section = 'Norway'; $this->q->select( 'COUNT(*)' ) ->from( 'query_test' ) ->where( $this->e->eq( 'section', $this->q->bindParam( $section ) ) ); $statement = $this->q->prepare(); $statement->execute(); $this->assertEqual( $expected, (int) $statement->fetchColumn(0) ); $expected = 1; $section = 'Ukraine'; $statement = $this->q->prepare(); $statement->execute(); $this->assertEqual( $expected, (int) $statement->fetchColumn(0) ); /* $this->dump( $q->getQuery() ); */ /* $this->dump($this->e); */ }

      function testingBindInteger()

      { $expected = 7; $num = 0; $q = $this->q; $e = $this->e; $q->select( 'COUNT(*)' ) ->from( 'query_test' ) ->where( $e->gt( 'employees', $q->bindParam( $num ) ) ); $statement = $q->prepare(); $statement->execute(); $this->assertEqual( $expected, (int) $statement->fetchColumn(0) ); $expected = 3; $num = 100; $statement = $q->prepare(); $statement->execute(); $this->assertEqual( $expected, (int) $statement->fetchColumn(0) ); }

      ...
      }}}

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Suwandi Tanuwijaya
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Time Tracking

              Estimated:
              Original Estimate - 1m
              1m
              Remaining:
              Remaining Estimate - 1m
              1m
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development