Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throwing PDOException on malformed sql syntax #4141

Closed
nokitakaze opened this issue Nov 5, 2014 · 3 comments
Closed

Throwing PDOException on malformed sql syntax #4141

nokitakaze opened this issue Nov 5, 2014 · 3 comments

Comments

@nokitakaze
Copy link

HHVM's implementation of PDO throws PDOException if malformed sql syntax provided. Standard PHP implementation does not do that.

<?php
 header('Content-type: text/plain; ');

 try{
   $pdo = new PDO(
   'mysql:host='.$this->options->database->host.';dbname='.$this->options->database->db,
   $this->options->database->login,
   $this->options->database->password);
 }catch(PDOException $e){
  echo "\nCan not connect\n";
  var_dump($e);
  return;
 }

 echo "\nbefore\n";
 try{
  $pdo->exec('se t @@time_zone="+3:00";');
 }catch(PDOException $e){
  echo "\nPDO Exec exception\n";
  var_dump($e);
  return;
 }
 echo "\nafter\n";
?>

You can see result on that pages:
http://a.ascet.g.kanaria.ru/test/pdo-exception-test.php PHP Impementation
http://h.ascet.g.kanaria.ru/test/pdo-exception-test.php HHVM Implementation

This behavior is observed in HipHop VM 3.4.0-dev~nightly.2014.11.04 (dbg) and HipHop 3.3.1.

@mgottein
Copy link
Contributor

I'll see about a fix

@mgottein
Copy link
Contributor

See 4312

@mgottein
Copy link
Contributor

This will not be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants