Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-9897

Quering with PDO returns null for all column values except the 1st one

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.6
    • None
    • odbc
    • None
    • CentOS

    • Docs Required

    Description

      Using odbc_connect returns all column values, but with PDO only the 1st one – all the rest are null.
      Reproduced on CentOS.

      1. Start a server node with Ignite CPP
      2. Run odbc-example (which will create two tables)
      3. Run a simple PHP script
      <?php
      
      try {
          echo PHP_EOL,PHP_EOL,"# Using PDO",PHP_EOL;
          $dbh = new PDO('odbc:ApacheIgnite');
          $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
      
          $sql = 'SELECT * FROM "Person".Person';
          $data = $dbh->query($sql);
      
          foreach($data as $row) {
              var_export($row);
      	}
      
          echo PHP_EOL,PHP_EOL,"# Using odbc_*( ) Functions",PHP_EOL;
      	
          $conn = odbc_connect('ApacheIgnite','','');
          $rs = odbc_exec($conn, $sql);
      	
          while($row = odbc_fetch_array($rs)) {
              var_export($row);
      	}
      		  
      } catch (PDOException $e) {
          print "Error!: " . $e->getMessage() . "\n";
          die();
      }
      
      ?>
      

       

      Attachments

        1. phpPdo.out
          2 kB
          Roman Shtykh
        2. phpPDO2.out
          2 kB
          Roman Shtykh
        3. odbc.log
          9 kB
          Igor Sapego
        4. unixOdbc.log
          20 kB
          Igor Sapego

        Issue Links

          Activity

            People

              isapego Igor Sapego
              shroman Roman Shtykh
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: