he4rt / scylladb-php-driver

PHP Driver for ScyllaDB/Apache Cassandra
Other
103 stars 25 forks source link

Fix missing symbols from math.cpp #97

Closed ecsv closed 5 months ago

ecsv commented 5 months ago

If someone would use string for the Bigint constructer then glibc would fail to find _Z23php_driver_parse_bigintPciPl (php_driver_parse_bigint(char*, int, long*)) because math.cpp was never compiled and linked to the shared object.

That also included other users of:

for example:


Reproducer:

cat > test.php << "EOF"
<?php

$foo = new \Cassandra\Bigint('0');
EOF
php test.php

Error output:

php: symbol lookup error: /usr/lib/php/20220829/cassandra.so: undefined symbol: _Z23php_driver_parse_bigintPciPl
DanielHe4rt commented 5 months ago

Hey @ecsv, thanks for the contribution! Probably @CodeLieutenant will be validating the changes soon.

You're using this driver with Cassandra or ScyllaDB? Just curious about the use-case as well for choosing PHP for it.

ecsv commented 5 months ago

You're using this driver with Cassandra or ScyllaDB?

I am using ScyllaDB. But I've also used it at some point against Datastax Astra with cql-proxy. Unfortunately(?) we had so many problems with their infrastructure that it was better for us to completely switch to ScyllaDB.

Just curious about the use-case as well for choosing PHP for it.

It is just for an older software stack which was initially written in PHP.

So thanks for still maintaining a php-driver :)

CodeLieutenant commented 5 months ago

Thanks for the pull request, nice catch.

I've reverted the things you deleted from math.h and math.cpp as I'll be adding support for double not just float to the Float class