Orange-OpenSource / YACassandraPDO

Cassandra PDO Driver fork
Apache License 2.0
85 stars 32 forks source link

Binding BIGINT does not work #67

Open pjc23 opened 9 years ago

pjc23 commented 9 years ago
$pdo = new PDO("cassandra:host=$host;port=$port", $username, $password) ;

// col is any data type (let's assume string)
// id is bigint
$cql = "UPDATE myks.mycf SET col = :col WHERE id = :id";

$stmt = $pdo->prepare($cql);
$stmt->bindValue(':col', 'a string value', PDO:CASSANDRA_STR);
$stmt->bindValue(':id', 14117356960895, PDO::CASSANDRA_INT); // the wiki says this should be the bind type for BIGINT
$stmt->execute(); // returns FALSE
$errorInfo = $stmt->errorInfo();
echo $errorInfo[2]; // prints "unable to make int from '14117356960895'"

I'm running PHP in 64-bit CentOS 6.

echo PHP_INT_MAX; // prints 9223372036854775807