【问题标题】:mysql, BIGINT value is out of rangemysql,BIGINT 值超出范围
【发布时间】:2020-01-28 23:55:06
【问题描述】:

我查看了一些其他类似问题的答案,但似乎没有一个对我有帮助。

  [2020-01-28 23:26:29] CDbCommand failed to execute the SQL statement: SQLSTATE[22003]: Numeric value out of range: 1690 BIGINT value is out of range in 'count(`Um3mpV1OJwy6m`.`jobsubmits`.`id`) * 500000 * 4398046511104'
[2020-01-29 00:26:47] CronjobController::actionRun 0
[2020-01-29 00:27:07] CDbException#1
(
    [errorInfo] => array
    (
        0 => '22003'
        1 => 1690
        2 => 'BIGINT value is out of range in \'count(`Um3mpV1OJwy6m`.`jobsubmits`.`id`) * 500000 * 4398046511104\''
    )
    [*:message] => 'CDbCommand failed to execute the SQL statement: SQLSTATE[22003]: Numeric value out of range: 1690 BIGINT value is out of range in \'count(`Um3mpV1OJwy6m`.`jobsubmits`.`id`) * 500000 * 4398046511104\''
    [Exception:string] => ''
    [*:code] => 22003
    [*:file] => '/home/crypto-data/yiimp/site/web/framework/db/CDbCommand.php'
    [*:line] => 543
    [Exception:trace] => array

【问题讨论】:

标签: mysql integer-overflow


【解决方案1】:

您的值是 COUNT() 乘以:

500000 * 4398046511104 = 2199023255552000000

有符号 BIGINT 的最大值为 263-1 = 9223372036854775807

9223372036854775807 / 2199023255552000000 = 4.1943

因此,如果您的 COUNT() 大于 4,那么它将超过可以在有符号 BIGINT 中表示的最大值。

【讨论】:

    猜你喜欢
    • 2012-07-26
    • 1970-01-01
    • 2014-11-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-30
    相关资源
    最近更新 更多