php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76400 PDO cannot caught mysql error 1690:bigint unsigned value is out of range
Submitted: 2018-06-01 06:50 UTC Modified: 2018-06-01 06:56 UTC
Votes:3
Avg. Score:3.7 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:2 (66.7%)
From: kadovat at gmail dot com Assigned:
Status: Open Package: PDO MySQL
PHP Version: 5.6.36 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kadovat at gmail dot com
New email:
PHP Version: OS:

 

 [2018-06-01 06:50 UTC] kadovat at gmail dot com
Description:
------------
PDO doesn't throw an exception when occurs mysql error 1690:bigint unsigned value is out of range,just return an empty array 

Test script:
---------------
# CREATE TABLE  `test` (`id` int(10) unsigned DEFAULT NULL, `pv` int(10) unsigned DEFAULT NULL,`yesterday_pv` int(10) unsigned DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8

#insert into test set id=1,pv=1,yesterday_pv=2;
<?php
$dbh = new PDO("mysql:host=localhost;port=3306;dbname=testdb","root");
$sth = $dbh->prepare('select id,pv-yesterday_pv from test');
$sth->execute();
$result = $sth->fetchAll();
var_dump($result);

Expected result:
----------------
throw a PDOException

Actual result:
--------------
array(0) {
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-06-01 06:56 UTC] kadovat at gmail dot com
MySQL cli show error like this:

mysql> select id,pv-yesterday_pv from test;
ERROR 1690 (22003): BIGINT UNSIGNED value is out of range in '(`DB_ad_fengye`.`test`.`pv` - `DB_ad_fengye`.`test`.`yesterday_pv`)'
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Fri Oct 19 15:01:26 2018 UTC