Giter Site home page Giter Site logo

yacassandrapdo's Introduction

Introduction

PDO driver implementation for Cassandra CQL.

This repository is a fork of: https://code.google.com/a/apache-extras.org/p/cassandra-pdo/ We cloned it on GitHub because the original project seemed to be dead.

This version is developped for the CQL3 target only. We do not provide any support for former versions of CQL.

Cassandra versions support

NEW: The driver is compatible with versions of Cassandra up to 2.0.x

The support of Cassandra 2.0 is very new. So if you experience bugs, incorrect behavior or anything suspect, don't hesitate to fill a bug report.

For newer Cassandra versions and native protocol support, check the official Datastax driver: https://github.com/datastax/php-driver

What is different from the Datastax version?

  • Added support for float numbers, decimals
  • Added support for collections (map, set, list)
  • Fixed a lot of bugs on integer convertions
  • Fixed parameters binding
  • Some other minor fixes
  • Timeout in requests support

Dependencies

  • PHP and PDO
  • Thrift
  • Boost (shared_ptr)

How to build?

First install thrift from http://thrift.apache.org/download/. Thrift should depend on boost shared_ptr so while installing thrift you are installing rest of the dependencies for pdo_cassandra (apart from PHP and PDO of course).

pdo_cassandra ./configure script takes the following options:

  • --with-pdo-cassandra[=FILE] where file is optional path to Cassandra Thrift definitions file. The file is bundled with the package so it is unlikely that alternative file is needed unless testing new versions.

  • --with-thrift-dir[=DIR] can be used to specify 'non-standard' thrift installation prefix.

  • --with-boost-dir[=DIR] can be used to specify 'non-standard' boost installation prefix.

Build steps:

$ phpize
$ ./configure
$ make
$ sudo make install 

Running tests

After a successful build tests can be executed using an instance of Cassandra. Default config for Cassandra should be fine.

Before make test:

$ cp tests/config.inc-dist tests/config.inc
$ $EDITOR tests/config.inc

This is to prevent accidentally dropping keyspaces that might in use.

Create a debian package from the sources

add "deb http://debian.datastax.com/community stable main" in your apt sources list
apt-get install libthrift0 libthrift-dev thrift-compiler

ln -s packaging/debian debian
dpkg-buildpackage -rfakeroot -us -uc

How to use this driver?

Visit our wiki page

Contributing

Pull requests containing fixes and/or additional tests are highly appreciated. Documentation is also far from being complete, feel free to report the difficulties you face.

PHP 7 support

For PHP7 support: https://github.com/bixuehujin/YACassandraPDO/tree/php7 (I haven't tested it)

Native Protocol Support

Please see the official datastax driver: https://github.com/datastax/php-driver

yacassandrapdo's People

Contributors

blat avatar ecourreges avatar lisandromc avatar mathieu-lornac avatar mlornac-orange avatar sandro-lex avatar sandrolex avatar sandvige avatar skunnyk avatar valmire avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yacassandrapdo's Issues

Rowcount error

Hi,

I am using this extension with PhalconPhp its giving rowcount error.
Notice: Undefined index: rowcount

pdo_cassandra.so: undefined symbol: php_pdo_register_driver in Unknown on line 0

Hi, I want to ask a issue when I try to installing YACassandraPDO some error show up but the installation process status is success. After that I append :

extension=pdo_cassandra.so in /etc/php5/cli/php.ini

But when I try to run php -v, an error message shows up :

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/pdo_cassandra.so' - /usr/lib/php5/20100525/pdo_cassandra.so: undefined symbol: php_pdo_register_driver in Unknown on line 0
PHP 5.4.9-4ubuntu2.3 (cli) (built: Sep 4 2013 19:32:25)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
with XCache v2.0.0, Copyright (c) 2005-2012, by mOo

uname -a shows :
Linux ubuntu 3.8.0-32-generic #47-Ubuntu SMP Tue Oct 1 22:35:23 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

killua@ubuntu:/usr/lib/php5/20100525$ ls -l , shows :
total 10272
-rw-r--r-- 1 root root 71984 Sep 4 12:51 curl.so
-rwxr-xr-x 1 root root 10172766 Oct 29 00:32 pdo_cassandra.so
-rw-r--r-- 1 root root 113008 Sep 4 12:51 pdo.so
-rw-r--r-- 1 root root 153176 Nov 14 2012 xcache.so

killua@ubuntu:/etc/php5/cli/conf.d$ ls -l
total 4
lrwxrwxrwx 1 root root 25 Oct 28 09:43 0-pdo.ini -> ../mods-available/pdo.ini
-rw-r--r-- 1 root root 66 Oct 29 00:54 10-pdo.ini.backup
lrwxrwxrwx 1 root root 26 Oct 28 09:52 20-curl.ini -> ../mods-available/curl.ini
lrwxrwxrwx 1 root root 28 Oct 28 09:53 20-xcache.ini -> ../mods-available/xcache.ini

Can someone help to solve this?
Thanks :D

servers pool

How are the servers exactly used ? Are they selected randomly or as failovers ?
I've been using this extension now with some scripts that run for over 2 min, as a doctrine driver and sometimes it work sometimes it doesnt.

My best guess is that sometimes somewhere it times out, however it doesnt throw any exceptions, which i'm sure is some sort of a bug

Can't build on OS X 10.8

Hey

I can't get it to compile this extension on Mac OS X 10.8. Here is the output.

/bin/sh /Users/Henrik/Downloads/YACassandraPDO/libtool --mode=compile g++ -Wall -Wno-write-strings -I. -I/Users/Henrik/Downloads/YACassandraPDO -DPHP_ATOM_INC -I/Users/Henrik/Downloads/YACassandraPDO/include -I/Users/Henrik/Downloads/YACassandraPDO/main -I/Users/Henrik/Downloads/YACassandraPDO -I/Users/Henrik/.phpbrew/php/php-5.4.11/include/php -I/Users/Henrik/.phpbrew/php/php-5.4.11/include/php/main -I/Users/Henrik/.phpbrew/php/php-5.4.11/include/php/TSRM -I/Users/Henrik/.phpbrew/php/php-5.4.11/include/php/Zend -I/Users/Henrik/.phpbrew/php/php-5.4.11/include/php/ext -I/Users/Henrik/.phpbrew/php/php-5.4.11/include/php/ext/date/lib -I/usr/local/Cellar/thrift/0.9.0/include/thrift -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2   -c /Users/Henrik/Downloads/YACassandraPDO/cassandra_driver.cpp -o cassandra_driver.lo
mkdir .libs
 g++ -Wall -Wno-write-strings -I. -I/Users/Henrik/Downloads/YACassandraPDO -DPHP_ATOM_INC -I/Users/Henrik/Downloads/YACassandraPDO/include -I/Users/Henrik/Downloads/YACassandraPDO/main -I/Users/Henrik/Downloads/YACassandraPDO -I/Users/Henrik/.phpbrew/php/php-5.4.11/include/php -I/Users/Henrik/.phpbrew/php/php-5.4.11/include/php/main -I/Users/Henrik/.phpbrew/php/php-5.4.11/include/php/TSRM -I/Users/Henrik/.phpbrew/php/php-5.4.11/include/php/Zend -I/Users/Henrik/.phpbrew/php/php-5.4.11/include/php/ext -I/Users/Henrik/.phpbrew/php/php-5.4.11/include/php/ext/date/lib -I/usr/local/Cellar/thrift/0.9.0/include/thrift -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /Users/Henrik/Downloads/YACassandraPDO/cassandra_driver.cpp  -fno-common -DPIC -o .libs/cassandra_driver.o
/Users/Henrik/Downloads/YACassandraPDO/cassandra_driver.cpp: In function ‘int pdo_cassandra_check_liveness(pdo_dbh_t*)’:
/Users/Henrik/Downloads/YACassandraPDO/cassandra_driver.cpp:68: error: aggregate ‘tcp_info tcpi’ has incomplete type and cannot be defined
/Users/Henrik/Downloads/YACassandraPDO/cassandra_driver.cpp:70: error: ‘SOL_TCP’ was not declared in this scope
/Users/Henrik/Downloads/YACassandraPDO/cassandra_driver.cpp:70: error: ‘TCP_INFO’ was not declared in this scope
/Users/Henrik/Downloads/YACassandraPDO/cassandra_driver.cpp:72: error: ‘TCP_ESTABLISHED’ was not declared in this scope

"Invalid next size" Core dump

Hello. I made a wrapper over the extension that I simply called "Cql", when attempting to create a connection, I get this

php > require 'cassandra/Cql.php';
php > $cql = new cassandra\Cql('ads_statistics');
*** glibc detected *** php: realloc(): invalid next size: 0x0000000001ee00a0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7eb96)[0x7fa351ae0b96]
/lib/x86_64-linux-gnu/libc.so.6(+0x81ee7)[0x7fa351ae3ee7]
/lib/x86_64-linux-gnu/libc.so.6(realloc+0xee)[0x7fa351ae56fe]
/lib/x86_64-linux-gnu/libc.so.6(+0x33264)[0x7fa351a95264]
/lib/x86_64-linux-gnu/libc.so.6(+0x3345f)[0x7fa351a9545f]
/lib/x86_64-linux-gnu/libc.so.6(+0x31518)[0x7fa351a93518]
/lib/x86_64-linux-gnu/libc.so.6(+0x30c93)[0x7fa351a92c93]
/lib/x86_64-linux-gnu/libc.so.6(__strerror_r+0x5e)[0x7fa351aeaf4e]
/usr/lib/libthrift.so.0(_ZN6apache6thrift7TOutput10strerror_sEi+0x2b)[0x7fa3507ab20b]
/usr/lib/libthrift.so.0(_ZN6apache6thrift7TOutput6perrorEPKci+0x32)[0x7fa3507ab402]
/usr/lib/libthrift.so.0(_ZN6apache6thrift9transport7TSocket14openConnectionEP8addrinfo+0x186)[0x7fa3507d6976]
/usr/lib/libthrift.so.0(_ZN6apache6thrift9transport7TSocket10local_openEv+0xb5)[0x7fa3507d7715]
/usr/lib/libthrift.so.0(_ZN6apache6thrift9transport11TSocketPool4openEv+0x15d)[0x7fa3507d980d]
/usr/lib/php5/20090626/pdo_cassandra.so(+0x5b2f5)[0x7fa350a642f5]
/usr/lib/php5/20090626/pdo.so(+0x84cc)[0x7fa341cde4cc]
php[0x70fded]
php(execute+0x1fb)[0x6c095b]
php(zend_eval_stringl+0x144)[0x68f7c4]
php[0x42c816]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7fa351a8376d]
php[0x42c9b5]
======= Memory map: ========
00400000-00b49000 r-xp 00000000 08:07 39323107                           /usr/bin/php5
00d48000-00dae000 r--p 00748000 08:07 39323107                           /usr/bin/php5
00dae000-00dba000 rw-p 007ae000 08:07 39323107                           /usr/bin/php5
00dba000-00dd6000 rw-p 00000000 00:00 0
01b5f000-01ee1000 rw-p 00000000 00:00 0                                  [heap]
7fa328000000-7fa328021000 rw-p 00000000 00:00 0
7fa328021000-7fa32c000000 ---p 00000000 00:00 0
7fa32f76f000-7fa32f779000 r-xp 00000000 08:07 68551330                   /lib/x86_64-linux-gnu/libnss_nis-2.15.so
7fa32f779000-7fa32f979000 ---p 0000a000 08:07 68551330                   /lib/x86_64-linux-gnu/libnss_nis-2.15.so
7fa32f979000-7fa32f97a000 r--p 0000a000 08:07 68551330                   /lib/x86_64-linux-gnu/libnss_nis-2.15.so
7fa32f97a000-7fa32f97b000 rw-p 0000b000 08:07 68551330                   /lib/x86_64-linux-gnu/libnss_nis-2.15.so
7fa32f97b000-7fa32f992000 r-xp 00000000 08:07 68551413                   /lib/x86_64-linux-gnu/libnsl-2.15.so
7fa32f992000-7fa32fb91000 ---p 00017000 08:07 68551413                   /lib/x86_64-linux-gnu/libnsl-2.15.so
7fa32fb91000-7fa32fb92000 r--p 00016000 08:07 68551413                   /lib/x86_64-linux-gnu/libnsl-2.15.so
7fa32fb92000-7fa32fb93000 rw-p 00017000 08:07 68551413                   /lib/x86_64-linux-gnu/libnsl-2.15.so
7fa32fb93000-7fa32fb95000 rw-p 00000000 00:00 0
7fa32fb95000-7fa32fb9d000 r-xp 00000000 08:07 68550800                   /lib/x86_64-linux-gnu/libnss_compat-2.15.so
7fa32fb9d000-7fa32fd9c000 ---p 00008000 08:07 68550800                   /lib/x86_64-linux-gnu/libnss_compat-2.15.so
7fa32fd9c000-7fa32fd9d000 r--p 00007000 08:07 68550800                   /lib/x86_64-linux-gnu/libnss_compat-2.15.so
7fa32fd9d000-7fa32fd9e000 rw-p 00008000 08:07 68550800                   /lib/x86_64-linux-gnu/libnss_compat-2.15.so
7fa32fd9e000-7fa32fd9f000 ---p 00000000 00:00 0
7fa32fd9f000-7fa33059f000 rw-p 00000000 00:00 0
7fa33059f000-7fa3305ab000 r-xp 00000000 08:07 68551104                   /lib/x86_64-linux-gnu/libnss_files-2.15.so
7fa3305ab000-7fa3307aa000 ---p 0000c000 08:07 68551104                   /lib/x86_64-linux-gnu/libnss_files-2.15.so
7fa3307aa000-7fa3307ab000 r--p 0000b000 08:07 68551104                   /lib/x86_64-linux-gnu/libnss_files-2.15.so
7fa3307ab000-7fa3307ac000 rw-p 0000c000 08:07 68551104                   /lib/x86_64-linux-gnu/libnss_files-2.15.so
7fa3307ac000-7fa3407ac000 rw-s 00000000 08:07 60426190                   /tmp/apc.rDnaqe (deleted)
7fa3407ac000-7fa3407e6000 r-xp 00000000 08:07 41288932                   /usr/lib/x86_64-linux-gnu/libxslt.so.1.1.26
7fa3407e6000-7fa3409e6000 ---p 0003a000 08:07 41288932                   /usr/lib/x86_64-linux-gnu/libxslt.so.1.1.26
7fa3409e6000-7fa3409e7000 r--p 0003a000 08:07 41288932                   /usr/lib/x86_64-linux-gnu/libxslt.so.1.1.26
7fa3409e7000-7fa3409e8000 rw-p 0003b000 08:07 41288932                   /usr/lib/x86_64-linux-gnu/libxslt.so.1.1.26
7fa3409e8000-7fa3409fc000 r-xp 00000000 08:07 41288933                   /usr/lib/x86_64-linux-gnu/libexslt.so.0.8.15
7fa3409fc000-7fa340bfb000 ---p 00014000 08:07 41288933                   /usr/lib/x86_64-linux-gnu/libexslt.so.0.8.15
7fa340bfb000-7fa340bfc000 r--p 00013000 08:07 41288933                   /usr/lib/x86_64-linux-gnu/libexslt.so.0.8.15
7fa340bfc000-7fa340bfd000 rw-p 00014000 08:07 41288933                   /usr/lib/x86_64-linux-gnu/libexslt.so.0.8.15
7fa340bfd000-7fa340c04000 r-xp 00000000 08:07 39583879                   /usr/lib/php5/20090626/xsl.so
7fa340c04000-7fa340e04000 ---p 00007000 08:07 39583879                   /usr/lib/php5/20090626/xsl.so
7fa340e04000-7fa340e05000 r--p 00007000 08:07 39583879                   /usr/lib/php5/20090626/xsl.so
7fa340e05000-7fa340e06000 rw-p 00008000 08:07 39583879                   /usr/lib/php5/20090626/xsl.so
7fa340e06000-7fa340e18000 r-xp 00000000 08:07 39583883                   /usr/lib/php5/20090626/xmlrpc.so
7fa340e18000-7fa341018000 ---p 00012000 08:07 39583883                   /usr/lib/php5/20090626/xmlrpc.so
7fa341018000-7fa341019000 r--p 00012000 08:07 39583883                   /usr/lib/php5/20090626/xmlrpc.so
7fa341019000-7fa34101a000 rw-p 00013000 08:07 39583883                   /usr/lib/php5/20090626/xmlrpc.so
7fa34101a000-7fa341025000 r-xp 00000000 08:07 39333697                   /usr/lib/libossp-uuid.so.16.0.22
7fa341025000-7fa341224000 ---p 0000b000 08:07 39333697                   /usr/lib/libossp-uuid.so.16.0.22
7fa341224000-7fa341225000 r--p 0000a000 08:07 39333697                   /usr/lib/libossp-uuid.so.16.0.22
7fa341225000-7fa341226000 rw-p 0000b000 08:07 39333697                   /usr/lib/libossp-uuid.so.16.0.22
7fa341226000-7fa341229000 r-xp 00000000 08:07 39586994                   /usr/lib/php5/20090626/uuid.so
7fa341229000-7fa341428000 ---p 00003000 08:07 39586994                   /usr/lib/php5/20090626/uuid.so
7fa341428000-7fa341429000 r--p 00002000 08:07 39586994                   /usr/lib/php5/20090626/uuid.so
7fa341429000-7fa34142a000 rw-p 00003000 08:07 39586994                   /usr/lib/php5/20090626/uuid.so
7fa34142a000-7fa341432000 r-xp 00000000 08:07 41289778                   /usr/lib/x86_64-linux-gnu/libgif.so.4.1.6
7fa341432000-7fa341631000 ---p 00008000 08:07 41289778                   /usr/lib/x86_64-linux-gnu/libgif.so.4.1.6
7fa341631000-7fa341632000 r--p 00007000 08:07 41289778                   /usr/lib/x86_64-linux-gnu/libgif.so.4.1.6
Aborted (core dumped)

Here's my version data

[carlos|server] ~ php -v
PHP 5.3.10-1ubuntu3.11 with Suhosin-Patch (cli) (built: Apr  4 2014 01:30:04)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

Any clues? 😄

Crash when fetching data on OS X

I have successfuly compiled YACassandraPDO on my Macbook (replacing pdo_cassandra_check_liveness with just return 0), but can't fetch data.

Other operations seems okay. I created keyspace, column family and inserted + updated some rows. In cqlsh I can SELECT and view these data, but not in PHP. PDOStatement::execute() returns TRUE, but whenever I call PDOStatement::fetch(), PHP script completely crashes. No Exception or runtime error is given.

In apache2 error_log, this row is inserted:
[Thu Jun 20 14:14:14 2013] [notice] child pid 43288 exit signal Abort trap (6)
httpd(43294) malloc: *** error for object 0x7fc7e29cd134: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

Have anybody run into similar problem? How can I solve it?

00000:4 Default TException

I started testing cassandra, how it will work with 100Gb+ of data (one node. binary images. I want to make image hosting with cassandra). I made a php script that makes an infinite loop and upload an ~7Mb image via curl (started it from shell). Yesterday I started it, and it worked a couple hours (until ~40Gb) then I had to go to sleep and stoped it. Today I started it again. After ~2 hours and ~70Gb, it started to throw this
Cassandra 00000:4 Default TException
In google I did not find anything. I restarted cassandra, upload worked some minutes then again that exteption. Restarted it again, and after 3 minutes it throws that exception again.
Then I left it some minutes (not restarted), then tried to run the upload script again, and it not worked (same exception). After some minutes while completing this issue with details, I restarted apache2 and run again upload script, and it works (cassandra was not restarted. So it can be from pdo driver). After ~9 minutes, same exception... (I don't know what's the problem)
So I am woried if it will work well in production use.

This is my upload server side script
This is client side
(RAM is used <2Gb, CPU stable)

My question is: Do you have any idea what the problem can be (from pdo driver, or cassanda bug)? What can I do to prevent this?
Thanx

(sorry for my english)

Boolean values are coerced into integers

And CQL 3 complains with error Invalid INTEGER constant (1) for my_boolean of type boolean when fed a bound boolean value.

From the list of value constants in CQL 3:

A boolean constant is either true or false up to case-insensitivity (i.e. True is a valid boolean constant).

The first part of the problem (unmarshalling) is here:

 evaluate_integer_type<bool>, // BOOLEAN

which should be replaced by something like evaluate_boolean_type returning a real PHP boolean.

The second part (marshalling) I couldn't find.

All tests fail

"make test" doesn't work. Regex is grepping out "extension=pdo.so" resulting in Cassandra extension failing to load due to lack of pdo extension.

Then, I run run-test.php manually, and everything fails:

=====================================================================
PHP         : /usr/bin/php
PHP_SAPI    : cli
PHP_VERSION : 5.5.7
ZEND_VERSION: 2.5.0
PHP_OS      : Linux - Linux gizmo 2.6.32-431.1.2.0.1.el6.x86_64 #1 SMP Fri Dec 13 13:06:13 UTC 2013 x86_64
INI actual  : /etc/php-cli.ini
More .INIs  : /etc/php.d/0-pdo.ini,/etc/php.d/bcmath.ini,/etc/php.d/bz2.ini,/etc/php.d/calendar.ini,/etc/php.d/ctype.ini,/etc/php.d/curl.ini,/etc/php.d/dom.ini,/etc/php.d/exif.ini,/etc/php.d/fileinfo.ini,/etc/php.d/ftp.ini,/etc/php.d/gd.ini,/etc/php.d/gettext.ini,/etc/php.d/gmp.ini,/etc/php.d/iconv.ini,/etc/php.d/json.ini,/etc/php.d/mbstring.ini,/etc/php.d/mcrypt.ini,/etc/php.d/memcache.ini,/etc/php.d/opcache.ini,/etc/php.d/pdo_cassandra.ini,/etc/php.d/pdo_pgsql.ini,/etc/php.d/pdo_sqlite.ini,/etc/php.d/pgsql.ini,/etc/php.d/phar.ini,/etc/php.d/posix.ini,/etc/php.d/shmop.ini,/etc/php.d/simplexml.ini,/etc/php.d/sockets.ini,/etc/php.d/sqlite3.ini,/etc/php.d/sysvmsg.ini,/etc/php.d/sysvsem.ini,/etc/php.d/sysvshm.ini,/etc/php.d/thrift_protocol.ini,/etc/php.d/tokenizer.ini,/etc/php.d/xdebug.ini,/etc/php.d/xml.ini,/etc/php.d/xml_wddx.ini,/etc/php.d/xmlreader.ini,/etc/php.d/xmlrpc.ini,/etc/php.d/xmlwriter.ini,/etc/php.d/xsl.ini,/etc/php.d/zip.ini
CWD         : /root/src/YACassandraPDO
Extra dirs  :
VALGRIND    : Not used
=====================================================================
TIME START 2014-01-07 17:56:47
=====================================================================
FAIL Test pdo cassandra construction [tests/001-construct.phpt]
FAIL Test prepared statement emulation [tests/002-select.phpt]
FAIL Test transaction [tests/003-transaction.phpt]
FAIL Test column metadata [tests/004-columnmeta.phpt]
FAIL Test setting/getting attributes [tests/005-attributes.phpt]
FAIL Test iterating prepared statement [tests/006-iterate.phpt]
FAIL Test fetching grouped columns [tests/007-fetchgrouped.phpt]
FAIL Test execute prepared statement multiple times [tests/008-executemultiple.phpt]
FAIL Test authentication [tests/010-auth.phpt]
FAIL Test initialization of persistent connections [tests/011-persistentconnection.phpt]
FAIL Test quoting values [tests/012-quoter.phpt]
FAIL Test different error handling modes [tests/013-errorhandling.phpt]
FAIL Test number of affected rows [tests/014-affectedrows.phpt]
FAIL Test last insert id [tests/015-lastinsertid.phpt]
FAIL Test binding params [tests/016-bindparam.phpt]
FAIL Test integers [tests/018-int.phpt]
FAIL Test UUIDs [tests/019-uuid.phpt]
FAIL Test different data types [tests/020-types.phpt]
FAIL Test integer keys [tests/021-comparators.phpt]
FAIL Test counters [tests/022-counters.phpt]
FAIL Test preserving column keys and values [tests/023-preserve.phpt]
FAIL Test multiple keyspaces [tests/024-multiplekeyspaces.phpt]
FAIL Test that active columnfamily is tracked correctly [tests/025-activecolumnfamily.phpt]
FAIL Test very large integers [tests/026-bigint.phpt]
FAIL Test startup keyspace (dbname=...) [tests/027-startupkeyspace.phpt]
FAIL Test timestamp type [tests/029-timestamp.phpt]
FAIL Test special characters in ascii strings [tests/030-ascii_string.phpt]
FAIL Test consistency level set in db handle [tests/031-consistencylevel.phpt]
FAIL Test null returns on select queries [tests/032-null_value.phpt]
FAIL FLOAT implementation test [tests/033-float.phpt]
FAIL Test collection types [tests/034-collections.phpt]
FAIL NULL return test [tests/035-null-return.phpt]
FAIL UUID tests [tests/037-uuid.phpt]
FAIL Test decimal type [tests/038-decimal.phpt]
FAIL Boolean related tests [tests/039-boolean.phpt]
FAIL UUID tests [tests/040-cass_bindings.phpt]
=====================================================================
TIME END 2014-01-07 17:56:49

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :    0
Exts tested     :   56
---------------------------------------------------------------------

Number of tests :   36                36
Tests skipped   :    0 (  0.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :   36 (100.0%) (100.0%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :    0 (  0.0%) (  0.0%)
---------------------------------------------------------------------
Time taken      :    2 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Test pdo cassandra construction [tests/001-construct.phpt]
Test prepared statement emulation [tests/002-select.phpt]
Test transaction [tests/003-transaction.phpt]
Test column metadata [tests/004-columnmeta.phpt]
Test setting/getting attributes [tests/005-attributes.phpt]
Test iterating prepared statement [tests/006-iterate.phpt]
Test fetching grouped columns [tests/007-fetchgrouped.phpt]
Test execute prepared statement multiple times [tests/008-executemultiple.phpt]
Test authentication [tests/010-auth.phpt]
Test initialization of persistent connections [tests/011-persistentconnection.phpt]
Test quoting values [tests/012-quoter.phpt]
Test different error handling modes [tests/013-errorhandling.phpt]
Test number of affected rows [tests/014-affectedrows.phpt]
Test last insert id [tests/015-lastinsertid.phpt]
Test binding params [tests/016-bindparam.phpt]
Test integers [tests/018-int.phpt]
Test UUIDs [tests/019-uuid.phpt]
Test different data types [tests/020-types.phpt]
Test integer keys [tests/021-comparators.phpt]
Test counters [tests/022-counters.phpt]
Test preserving column keys and values [tests/023-preserve.phpt]
Test multiple keyspaces [tests/024-multiplekeyspaces.phpt]
Test that active columnfamily is tracked correctly [tests/025-activecolumnfamily.phpt]
Test very large integers [tests/026-bigint.phpt]
Test startup keyspace (dbname=...) [tests/027-startupkeyspace.phpt]
Test timestamp type [tests/029-timestamp.phpt]
Test special characters in ascii strings [tests/030-ascii_string.phpt]
Test consistency level set in db handle [tests/031-consistencylevel.phpt]
Test null returns on select queries [tests/032-null_value.phpt]
FLOAT implementation test [tests/033-float.phpt]
Test collection types [tests/034-collections.phpt]
NULL return test [tests/035-null-return.phpt]
UUID tests [tests/037-uuid.phpt]
Test decimal type [tests/038-decimal.phpt]
Boolean related tests [tests/039-boolean.phpt]
UUID tests [tests/040-cass_bindings.phpt]
=====================================================================

You may have found a problem in PHP.
This report can be automatically sent to the PHP QA team at
http://qa.php.net/reports and http://news.php.net/php.qa.reports
This gives us a better understanding of PHP's behavior.
If you don't want to send the report immediately you can choose
option "s" to save it.  You can then email it to [email protected] later.
Do you want to send this report now? [Yns]: n
[root@gizmo YACassandraPDO]#

Incorrect validation for BLOB type in pdo_cassandra_handle_quote

Two issues with BLOB validation in pdo_cassandra_handle_quote:

  1. Does not allow the empty value '0x' which is legal CQL3
  2. Allows odd numbers of hex digits '0x123' which is not legal CQL3

I'm curious as to why conversion to hex digits is left up to the PHP developer, and is not handled automatically by the driver when PDO::CASSANDRA_BLOB is used. It seems inconsistent with how BLOB values from a SELECT result set are returned already decoded.

Client-to-node encryption

Client-to-node encryption is only for Java clients?

(I installed and tested today a 2 node cluster, and learned how to configure node-to-node encryption) There are keystore, keytool (java utility), I think C++ and PHP has nothing with that, and the only way to safe client-to-node connection is to set firewall on cassandra server, to allow connections only from trusted IPs.

Or it is possible somehow to make client-to-node encryption with that driver?

Install driver on kernel v3+

It is possible to compile and install this driver on linux kernel version 3+ ?

I do not install on my desktop linux that has kernel version >3.0 because I need this driver for local developing. For example now I want to try ubuntu 13.04 but I cant. I just stay on Debian 6 or Ubuntu 10.04, because it has kernel 2.x and that driver works on it.

Useful info from this issue created some time ago:

What steps will reproduce the problem?
1. Do all like in tutorial on the Project Home

What is the expected output? What do you see instead?
///

What version of the product are you using? On what operating system?
Ubuntu 12.10

Please provide any additional information below.
PHP 5.4.6-1ubuntu1 (cli) (built: Aug 22 2012 21:13:52) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

apt-get install libboost-all-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libboost-all-dev is already the newest version.

Error log

I have this issue also.. 

git clone https://code.google.com/a/apache-extras.org/p/cassandra-pdo/
cd cassandra-pdo/
phpize .
./configure --with-php-config=/usr/local/php/bin/php-config 
make

--------------------------------
Make output:

root@ntom-Inspiron-530:/home/ntom/Desktop/cassandra-pdo# make
/bin/bash /home/ntom/Desktop/cassandra-pdo/libtool --mode=compile g++ -Wall -Wno-write-strings -I. -I/home/ntom/Desktop/cassandra-pdo -DPHP_ATOM_INC -I/home/ntom/Desktop/cassandra-pdo/include -I/home/ntom/Desktop/cassandra-pdo/main -I/home/ntom/Desktop/cassandra-pdo -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/include/thrift  -DHAVE_CONFIG_H  -g -O0   -c /home/ntom/Desktop/cassandra-pdo/cassandra_statement.cpp -o cassandra_statement.lo 
libtool: compile:  g++ -Wall -Wno-write-strings -I. -I/home/ntom/Desktop/cassandra-pdo -DPHP_ATOM_INC -I/home/ntom/Desktop/cassandra-pdo/include -I/home/ntom/Desktop/cassandra-pdo/main -I/home/ntom/Desktop/cassandra-pdo -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/include/thrift -DHAVE_CONFIG_H -g -O0 -c /home/ntom/Desktop/cassandra-pdo/cassandra_statement.cpp  -fPIC -DPIC -o .libs/cassandra_statement.o
/home/ntom/Desktop/cassandra-pdo/cassandra_statement.cpp: In function 'long int pdo_cassandra_marshal_numeric(pdo_stmt_t*, const string&)':
/home/ntom/Desktop/cassandra-pdo/cassandra_statement.cpp:231:9: error: 'tsrm_ls' was not declared in this scope
/home/ntom/Desktop/cassandra-pdo/gen-cpp/Cassandra.h: In member function 'virtual int32_t org::apache::cassandra::CassandraMultiface::get_count(const string&, const org::apache::cassandra::ColumnParent&, const org::apache::cassandra::SlicePredicate&, org::apache::cassandra::ConsistencyLevel::type)':
/home/ntom/Desktop/cassandra-pdo/gen-cpp/Cassandra.h:4398:3: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [cassandra_statement.lo] Error 1

The WITH CONSISTENCY removed. How to set it now?

"The WITH CONSISTENCY clause has been removed from CQL 3 commands in the release version of CQL 3. Programmatically, set the consistency level at the driver level. For example, call execute_cql3_query with the required binary query, the compression settings, and consistency level." source

How do I set now consistency?

Integer Conversion and Tests Failing

Hi I don't know if I have something configured wrong but I am having a few issues. When I try to run tests all of them fail. I had to change

'CLASS' : 'SimpleStrategy'
to
'class' : 'SimpleStrategy'

everywhere. That made most of them pass but there are still many more that do not. Most with Fatal error: Uncaught exception 'PDOException' with message 'CQLSTATE[HY000] [2] line 1:84 mismatched input ':' expecting '=''

Also I have 19 digit integers representing extremely precise timestamps that fail to convert properly this is the major issue for me.

e.g.
1371796592548546125
to
-1695381939

I have the latest version of this repo and the latest version of cassandra running on ubuntu 12.04.

Any thoughts?

Map keys are mangled when retrieved

When SELECTing Map columns, their keys are truncated to an arbitrary number of their initial characters, with no fixed pattern that I can recognize.

<?php
$db = getConnection();
$table_name = 'map_test';
$id = 1;

echo "test create", PHP_EOL;
$res = $db->exec("CREATE TABLE $table_name (id int PRIMARY KEY, my_map map<ascii, varchar>);");
if ($res === false) {
    die(var_dump($db->errorInfo()));
}

echo "test insert", PHP_EOL;
$res = $db->exec("INSERT INTO $table_name (id, my_map) VALUES ($id, {'prt': 'a', '_ind=development': 'b', 'nac': 'AR'});");
if ($res === false) {
    die(var_dump($db->errorInfo()));
}
print_r($db->query("SELECT * FROM $table_name;")->fetchObject());       

yields

test create
test insert
stdClass Object
(
    [id] => 1
    [my_map] => Array
        (
            [_] => b
            [na] => AR
            [p] => a
        )

)

whereas CQLSH gives the expected result:

cqlsh:test> select * from map_test;

 id | my_map
----+----------------------------------------
  1 | {_ind=development: b, nac: AR, prt: a}

Retrieving with PDO::fetch instead of PDO::fetchObject shows exactly the same problem.
Using map<varchar, varchar> makes no difference either.

Selecting map columns

I use the latest master version f3e6f4e

Seems like map column type is not yet supported by this driver
It inserts well but can't select it properly

$cassandra->exec("CREATE TABLE test (id int PRIMARY KEY, map_test map<varchar, int>);");
$cassandra->exec("INSERT INTO test (id, map_test) VALUES (1, {'key1': 1, 'key2': 2, 'key3': 3});");
print_r($cassandra->query('SELECT * FROM test;')->fetchObject());
stdClass Object
(
    [id] => 1
    [map_test] => ��key1���key2���key3��
)

cqlsh output

Can you fix this please?

Problems compiling

Hello,

I have problems building the driver. I did the steps given on https://code.google.com/a/apache-extras.org/p/cassandra-pdo/ but with this source.

I've seen a similar issue that did not have any solutions. Any help would be most welcome as I have a similar problem compiling the old datastax driver as well.

kmp@kmp-mint ~/ $ uname -a
Linux kmp-mint 3.8.0-29-generic #42-Ubuntu SMP Tue Aug 13 19:40:39 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
kmp@kmp-mint ~/external/YACassandraPDO $ phpize
Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525
kmp@kmp-mint ~/external/YACassandraPDO $ ./configure > /dev/null
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
kmp@kmp-mint ~/external/YACassandraPDO $ make
/bin/bash /home/kmp/external/YACassandraPDO/libtool --mode=compile g++ -Wall -Wno-write-strings -I. -I/home/kmp/external/YACassandraPDO -DPHP_ATOM_INC -I/home/kmp/external/YACassandraPDO/include -I/home/kmp/external/YACassandraPDO/main -I/home/kmp/external/YACassandraPDO -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/include/thrift  -DHAVE_CONFIG_H  -g -O2   -c /home/kmp/external/YACassandraPDO/cassandra_driver.cpp -o cassandra_driver.lo 
libtool: compile:  g++ -Wall -Wno-write-strings -I. -I/home/kmp/external/YACassandraPDO -DPHP_ATOM_INC -I/home/kmp/external/YACassandraPDO/include -I/home/kmp/external/YACassandraPDO/main -I/home/kmp/external/YACassandraPDO -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/include/thrift -DHAVE_CONFIG_H -g -O2 -c /home/kmp/external/YACassandraPDO/cassandra_driver.cpp  -fPIC -DPIC -o .libs/cassandra_driver.o
In file included from /usr/include/php5/Zend/zend.h:271:0,
                 from /usr/include/php5/main/php.h:35,
                 from /home/kmp/external/YACassandraPDO/php_pdo_cassandra.hpp:28,
                 from /home/kmp/external/YACassandraPDO/cassandra_driver.cpp:17:
/usr/include/php5/Zend/zend_hash.h: In function 'int zend_symtable_update(HashTable*, const char*, uint, void*, uint, void**)':
/usr/include/php5/Zend/zend_hash.h:352:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/include/php5/Zend/zend_hash.h:352:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/include/php5/Zend/zend_hash.h: In function 'int zend_symtable_del(HashTable*, const char*, uint)':
/usr/include/php5/Zend/zend_hash.h:359:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/include/php5/Zend/zend_hash.h:359:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/include/php5/Zend/zend_hash.h: In function 'int zend_symtable_find(HashTable*, const char*, uint, void**)':
/usr/include/php5/Zend/zend_hash.h:366:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/include/php5/Zend/zend_hash.h:366:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/include/php5/Zend/zend_hash.h: In function 'int zend_symtable_exists(HashTable*, const char*, uint)':
/usr/include/php5/Zend/zend_hash.h:373:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/include/php5/Zend/zend_hash.h:373:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/include/php5/Zend/zend_hash.h: In function 'int zend_symtable_update_current_key_ex(HashTable*, const char*, uint, int, Bucket**)':
/usr/include/php5/Zend/zend_hash.h:379:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/include/php5/Zend/zend_hash.h:379:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
In file included from /home/kmp/external/YACassandraPDO/php_pdo_cassandra_int.hpp:49:0,
                 from /home/kmp/external/YACassandraPDO/cassandra_driver.cpp:18:
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h: At global scope:
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:68:41: error: 'TConnectionInfo' in namespace 'apache::thrift' does not name a type
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:68:76: error: ISO C++ forbids declaration of 'connInfo' with no type [-fpermissive]
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:77:41: error: 'TConnectionInfo' in namespace 'apache::thrift' does not name a type
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:77:74: error: ISO C++ forbids declaration of 'parameter' with no type [-fpermissive]
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5808:35: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5808:62: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5810:71: error: cannot declare pointer to 'void' member
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5810:145: error: template argument 2 is invalid
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5810:145: error: template argument 4 is invalid
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5811:45: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5811:72: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5812:52: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5812:79: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5813:43: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5813:70: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5814:49: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5814:76: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5815:49: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5815:76: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5816:54: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5816:81: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5817:54: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5817:81: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5818:56: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5818:83: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5819:55: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5819:82: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5820:58: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5820:85: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5821:46: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5821:73: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5822:43: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5822:70: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5823:46: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5823:73: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5824:54: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5824:81: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5825:52: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5825:79: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5826:59: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5826:86: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5827:48: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5827:75: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5828:64: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5828:91: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5829:58: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5829:85: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5830:61: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5830:88: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5831:56: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5831:83: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5832:53: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5832:80: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5833:58: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5833:85: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5834:60: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5834:87: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5835:55: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5835:82: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5836:57: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5836:84: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5837:55: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5837:82: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5838:56: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5838:83: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5839:58: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5839:85: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5840:64: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5840:91: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5841:65: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5841:92: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5842:59: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5842:86: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5843:60: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5843:87: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5844:62: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5844:89: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5845:67: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5845:94: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5846:57: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5846:84: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5847:58: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5847:85: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5848:57: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5848:84: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5849:58: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5849:85: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5850:66: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5850:93: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5851:67: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5851:94: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5852:55: error: 'org::apache::thrift' has not been declared
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5852:82: error: expected ',' or '...' before '*' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5900:42: error: 'thrift' is not a member of 'org::apache'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5900:42: note: suggested alternative:
In file included from /usr/include/thrift/transport/TTransport.h:23:0,
                 from /usr/include/thrift/protocol/TProtocol.h:23,
                 from /usr/include/thrift/TProcessor.h:24,
                 from /home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:10,
                 from /home/kmp/external/YACassandraPDO/php_pdo_cassandra_int.hpp:49,
                 from /home/kmp/external/YACassandraPDO/cassandra_driver.cpp:18:
/usr/include/thrift/Thrift.h:44:37: note:   'apache::thrift'
In file included from /home/kmp/external/YACassandraPDO/php_pdo_cassandra_int.hpp:49:0,
                 from /home/kmp/external/YACassandraPDO/cassandra_driver.cpp:18:
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5900:42: error: 'thrift' is not a member of 'org::apache'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5900:42: note: suggested alternative:
In file included from /usr/include/thrift/transport/TTransport.h:23:0,
                 from /usr/include/thrift/protocol/TProtocol.h:23,
                 from /usr/include/thrift/TProcessor.h:24,
                 from /home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:10,
                 from /home/kmp/external/YACassandraPDO/php_pdo_cassandra_int.hpp:49,
                 from /home/kmp/external/YACassandraPDO/cassandra_driver.cpp:18:
/usr/include/thrift/Thrift.h:44:37: note:   'apache::thrift'
In file included from /home/kmp/external/YACassandraPDO/php_pdo_cassandra_int.hpp:49:0,
                 from /home/kmp/external/YACassandraPDO/cassandra_driver.cpp:18:
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5900:77: error: template argument 1 is invalid
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5900:105: error: 'thrift' is not a member of 'org::apache'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5900:105: note: suggested alternative:
In file included from /usr/include/thrift/transport/TTransport.h:23:0,
                 from /usr/include/thrift/protocol/TProtocol.h:23,
                 from /usr/include/thrift/TProcessor.h:24,
                 from /home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:10,
                 from /home/kmp/external/YACassandraPDO/php_pdo_cassandra_int.hpp:49,
                 from /home/kmp/external/YACassandraPDO/cassandra_driver.cpp:18:
/usr/include/thrift/Thrift.h:44:37: note:   'apache::thrift'
In file included from /home/kmp/external/YACassandraPDO/php_pdo_cassandra_int.hpp:49:0,
                 from /home/kmp/external/YACassandraPDO/cassandra_driver.cpp:18:
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5900:105: error: 'thrift' is not a member of 'org::apache'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5900:105: note: suggested alternative:
In file included from /usr/include/thrift/transport/TTransport.h:23:0,
                 from /usr/include/thrift/protocol/TProtocol.h:23,
                 from /usr/include/thrift/TProcessor.h:24,
                 from /home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:10,
                 from /home/kmp/external/YACassandraPDO/php_pdo_cassandra_int.hpp:49,
                 from /home/kmp/external/YACassandraPDO/cassandra_driver.cpp:18:
/usr/include/thrift/Thrift.h:44:37: note:   'apache::thrift'
In file included from /home/kmp/external/YACassandraPDO/php_pdo_cassandra_int.hpp:49:0,
                 from /home/kmp/external/YACassandraPDO/cassandra_driver.cpp:18:
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5900:140: error: template argument 1 is invalid
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h: In constructor 'org::apache::cassandra::CassandraProcessor::CassandraProcessor(boost::shared_ptr<org::apache::cassandra::CassandraIf>)':
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5856:49: error: assignment of read-only location '"login"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5856:49: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5857:56: error: assignment of read-only location '"set_keyspace"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5857:56: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5858:47: error: assignment of read-only location '"get"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5858:47: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5859:53: error: assignment of read-only location '"get_slice"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5859:53: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5860:53: error: assignment of read-only location '"get_count"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5860:53: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5861:58: error: assignment of read-only location '"multiget_slice"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5861:58: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5862:58: error: assignment of read-only location '"multiget_count"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5862:58: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5863:60: error: assignment of read-only location '"get_range_slices"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5863:60: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5864:59: error: assignment of read-only location '"get_paged_slice"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5864:59: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5865:62: error: assignment of read-only location '"get_indexed_slices"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5865:62: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5866:50: error: assignment of read-only location '"insert"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5866:50: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5867:47: error: assignment of read-only location '"add"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5867:47: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5868:50: error: assignment of read-only location '"remove"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5868:50: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5869:58: error: assignment of read-only location '"remove_counter"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5869:58: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5870:56: error: assignment of read-only location '"batch_mutate"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5870:56: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5871:63: error: assignment of read-only location '"atomic_batch_mutate"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5871:63: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5872:52: error: assignment of read-only location '"truncate"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5872:52: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5873:68: error: assignment of read-only location '"describe_schema_versions"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5873:68: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5874:62: error: assignment of read-only location '"describe_keyspaces"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5874:62: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5875:65: error: assignment of read-only location '"describe_cluster_name"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5875:65: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5876:60: error: assignment of read-only location '"describe_version"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5876:60: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5877:57: error: assignment of read-only location '"describe_ring"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5877:57: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5878:62: error: assignment of read-only location '"describe_token_map"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5878:62: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5879:64: error: assignment of read-only location '"describe_partitioner"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5879:64: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5880:59: error: assignment of read-only location '"describe_snitch"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5880:59: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5881:61: error: assignment of read-only location '"describe_keyspace"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5881:61: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5882:59: error: assignment of read-only location '"describe_splits"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5882:59: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5883:60: error: assignment of read-only location '"trace_next_query"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5883:60: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5884:62: error: assignment of read-only location '"describe_splits_ex"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5884:62: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5885:68: error: assignment of read-only location '"system_add_column_family"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5885:68: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5886:69: error: assignment of read-only location '"system_drop_column_family"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5886:69: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5887:63: error: assignment of read-only location '"system_add_keyspace"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5887:63: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5888:64: error: assignment of read-only location '"system_drop_keyspace"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5888:64: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5889:66: error: assignment of read-only location '"system_update_keyspace"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5889:66: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5890:71: error: assignment of read-only location '"system_update_column_family"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5890:71: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5891:61: error: assignment of read-only location '"execute_cql_query"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5891:61: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5892:62: error: assignment of read-only location '"execute_cql3_query"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5892:62: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5893:61: error: assignment of read-only location '"prepare_cql_query"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5893:61: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5894:62: error: assignment of read-only location '"prepare_cql3_query"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5894:62: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5895:70: error: assignment of read-only location '"execute_prepared_cql_query"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5895:70: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5896:71: error: assignment of read-only location '"execute_prepared_cql3_query"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5896:71: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5897:59: error: assignment of read-only location '"set_cql_version"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]'
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5897:59: error: cannot convert 'void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apache::cassandra::CassandraProcessor::*)(int, int)}' to 'const char' in assignment
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h: At global scope:
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5904:78: error: expected class-name before '{' token
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5909:74: error: 'TConnectionInfo' in namespace 'apache::thrift' does not name a type
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5909:109: error: ISO C++ forbids declaration of 'connInfo' with no type [-fpermissive]
In file included from /usr/include/thrift/protocol/TBinaryProtocol.h:277:0,
                 from /home/kmp/external/YACassandraPDO/php_pdo_cassandra_int.hpp:50,
                 from /home/kmp/external/YACassandraPDO/cassandra_driver.cpp:18:
/usr/include/thrift/protocol/TBinaryProtocol.tcc: In instantiation of 'uint32_t apache::thrift::protocol::TBinaryProtocolT<Transport_>::readI16(int16_t&) [with Transport_ = apache::thrift::transport::TTransport; uint32_t = unsigned int; int16_t = short int]':
/usr/include/thrift/protocol/TVirtualProtocol.h:499:54:   required from 'uint32_t apache::thrift::protocol::TVirtualProtocol<Protocol_, Super_>::readI16_virt(int16_t&) [with Protocol_ = apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TTransport>; Super_ = apache::thrift::protocol::TProtocolDefaults; uint32_t = unsigned int; int16_t = short int]'
/home/kmp/external/YACassandraPDO/cassandra_driver.cpp:850:1:   required from here
/usr/include/thrift/protocol/TBinaryProtocol.tcc:359:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
/usr/include/thrift/protocol/TBinaryProtocol.tcc: In instantiation of 'uint32_t apache::thrift::protocol::TBinaryProtocolT<Transport_>::readI32(int32_t&) [with Transport_ = apache::thrift::transport::TTransport; uint32_t = unsigned int; int32_t = int]':
/usr/include/thrift/protocol/TVirtualProtocol.h:503:54:   required from 'uint32_t apache::thrift::protocol::TVirtualProtocol<Protocol_, Super_>::readI32_virt(int32_t&) [with Protocol_ = apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TTransport>; Super_ = apache::thrift::protocol::TProtocolDefaults; uint32_t = unsigned int; int32_t = int]'
/home/kmp/external/YACassandraPDO/cassandra_driver.cpp:850:1:   required from here
/usr/include/thrift/protocol/TBinaryProtocol.tcc:368:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
/usr/include/thrift/protocol/TBinaryProtocol.tcc: In instantiation of 'uint32_t apache::thrift::protocol::TBinaryProtocolT<Transport_>::readI64(int64_t&) [with Transport_ = apache::thrift::transport::TTransport; uint32_t = unsigned int; int64_t = long int]':
/usr/include/thrift/protocol/TVirtualProtocol.h:507:54:   required from 'uint32_t apache::thrift::protocol::TVirtualProtocol<Protocol_, Super_>::readI64_virt(int64_t&) [with Protocol_ = apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TTransport>; Super_ = apache::thrift::protocol::TProtocolDefaults; uint32_t = unsigned int; int64_t = long int]'
/home/kmp/external/YACassandraPDO/cassandra_driver.cpp:850:1:   required from here
/usr/include/thrift/protocol/TBinaryProtocol.tcc:377:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
/usr/include/thrift/protocol/TBinaryProtocol.tcc: In instantiation of 'uint32_t apache::thrift::protocol::TBinaryProtocolT<Transport_>::readDouble(double&) [with Transport_ = apache::thrift::transport::TTransport; uint32_t = unsigned int]':
/usr/include/thrift/protocol/TVirtualProtocol.h:511:57:   required from 'uint32_t apache::thrift::protocol::TVirtualProtocol<Protocol_, Super_>::readDouble_virt(double&) [with Protocol_ = apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TTransport>; Super_ = apache::thrift::protocol::TProtocolDefaults; uint32_t = unsigned int]'
/home/kmp/external/YACassandraPDO/cassandra_driver.cpp:850:1:   required from here
/usr/include/thrift/protocol/TBinaryProtocol.tcc:390:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
In file included from /home/kmp/external/YACassandraPDO/php_pdo_cassandra_int.hpp:49:0,
                 from /home/kmp/external/YACassandraPDO/cassandra_driver.cpp:18:
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h: In member function 'virtual int32_t org::apache::cassandra::CassandraMultiface::get_count(const string&, const org::apache::cassandra::ColumnParent&, const org::apache::cassandra::SlicePredicate&, org::apache::cassandra::ConsistencyLevel::type)':
/home/kmp/external/YACassandraPDO/gen-cpp/Cassandra.h:5974:3: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [cassandra_driver.lo] Error 1

Memory Leak

The driver seems to leak on the string types.

A ZVAL string type is instanciated, the internal char *pointer points to a freshly allocated buffer which does not seem to be freed when the zval is destroyed

Float returned by microtime is returned broken

Issue:
When I generate a float number using microtime and save it into a float cassandra field, then fetch it, the value is not the original value, returned by microtime. It does not even appear to be a float number, but rather an integer number stored in a float variable.

In the example below:
float returned by microtime:
1406709742.7362

float returned by the PDO:
1406709760

My script:
$f = microtime(true);
var_dump($f);
$stmt = $db->prepare("INSERT INTO test (id, value) VALUES (1, :f)");
$stmt->bindValue(':f', $f, \PDO::CASSANDRA_FLOAT);
$stmt->execute();

    $stmt2 = $db->prepare("SELECT * FROM test");
    $stmt2->execute();

    var_dump($stmt2->fetchAll(\PDO::FETCH_ASSOC));

Output:
float(1406709742.7362)
array(1) {
[0]=>
array(2) {
["id"]=>
int(1)
["value"]=>
float(1406709760)
}
}

Table test:
CREATE TABLE test (
id int,
value float,
PRIMARY KEY ((id))
)

CQLSTATE[HY000] [0] Invalid method name: 'execute_cql3_query'

Hi guys,

I installed apache's thrift, made sure I had php-dev and pdo installed and I'm unable to get this to work...

db = new PDO('cassandra:host=myhost;port=9160');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->exec("USE logs");
PHP Warning:  Uncaught exception 'PDOException' with message 'CQLSTATE[HY000] [0] Invalid method name: 'execute_cql3_query'' in php shell code:1
Stack trace:
#0 php shell code(1): PDO->exec('USE logs')
#1 {main}
   thrown in php shell code on line 1

Connection fail when run under apache

These following code work fine under command prompt.

$php tinna.php

but under browser fail at PDO connection with these message:

"There's an error in the query!exception 'PDOException' with message 'CQLSTATE[08006] [8] TTransportException: Transport not open' in /var/www/html/tinna.php"

Could you please help, How to fix this problem?

/************
file: tinna.php
************/

10 )); } catch (Exception $e) { die("Oh noes! There's an error!" . $e); } $db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); $db->exec("USE $keyspace"); $stmt = $db->prepare ("SELECT \* FROM users"); $stmt->execute (); $result_array = array(); while($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $result_array[] = $row; } echo json_encode($result_array);

How to insert blob?

/*CREATE TABLE images (
    id int PRIMARY KEY,
    image blob
);*/

$stmt = $db->prepare("INSERT INTO images (id, image) VALUES (?, ?);");

$stmt->bindValue(1, 5, PDO::PARAM_INT);

$f = file_get_contents('test.png'); // very small image 1x1px
$stmt->bindValue(2, $f, PDO::PARAM_LOB);

$stmt->execute();

var_dump($stmt->errorInfo());
array(3) {
  [0]=>
  string(5) "00000"
  [1]=>
  int(2)
  [2]=>
  string(16) "Input length = 1"
}

Can someone post a working example, or blob insertion is not working at the moment?

Add DESCRIBE TABLE

It's impossible to do a DESCRIBE with the driver

ps: you do a fu*king good job, this is the Only driver for php cassandra with cql

lightweight transaction and rowCount return value

The rowCount method of PDOStatement class as documented here http://us2.php.net/manual/en/pdostatement.rowcount.php should return number of rows affected by the last SQL statement. But as I tested with this driver, the value that this method return does not conform with that document.
Here an example, assume we have a table named t with two columns a and b and a is primary key and table is empty.

$stm = $pdo->prepare( "UPDATE t SET b='foo' WHERE a='bar' IF b='foobar' " );
$stm->execute();
print_r( $stm->rowCount() );

The above code always prints 1 out even it does not update any row.

error even if thrift is installed

checking for pkg-config... /usr/bin/pkg-config
checking thrift installation... configure: error: Unable to find thrift installation

what is wrong ? i tried to specify the dir too but doesnt work

Fetching timestamp is giving some special characters.

This is the test code:

$dsn = "cassandra:host=127.0.0.1;port=9160";
$keyspace = 'test';
$db = new PDO($dsn);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

$db->exec ("USE {$keyspace}");
$db->exec ("CREATE COLUMNFAMILY timestamp_test (my_key text PRIMARY KEY, my_timestamp timestamp)");

$stmt = $db->prepare ("UPDATE timestamp_test SET my_timestamp = :test WHERE my_key = :key");
$stmt->bindValue (':test', 1342453581000, PDO::PARAM_INT);
$stmt->bindValue (':key', 'aa', PDO::PARAM_STR);
$stmt->execute ();

$stmt->bindValue (':test', '2012-07-16 17:45:03+0200', PDO::PARAM_STR);
$stmt->bindValue (':key', 'bb', PDO::PARAM_STR);
$stmt->execute ();

$stmt = $db->query ("SELECT my_timestamp FROM timestamp_test WHERE my_key = 'aa'");
var_dump ($stmt->fetchAll ());

$stmt = $db->query ("SELECT my_timestamp FROM timestamp_test WHERE my_key = 'bb'");
var_dump ($stmt->fetchAll ());

Result:
array(1) {
[0]=>
array(2) {
["my_timestamp"]=>
string(8) "8�x�"
[0]=>
string(8) "8�x�"
}
}
array(1) {
[0]=>
array(2) {
["my_timestamp"]=>
string(8) "8�v�"
[0]=>
string(8) "8�v�"
}
}

Am I doing something wrong?
Please help me.

bindValue for collection columns (List, Set, Map)

Following the logic of tests in issue #1 , I tried to use bound values with SET columns, resorting to the same trick I commented about in issue #6, namely, set parameter type to PDO::PARAM_INT:

$db = getConnection();
$table_name = 'set_test';
$id = 1;

echo "test update", PHP_EOL;
$res = $db->exec("UPDATE $table_name SET set_test = { 'a' } WHERE id = $id;");
if ($res === false) {
    die(var_dump($db->errorInfo()));
}
print_r($db->query("SELECT * FROM $table_name;")->fetchObject());       

echo "test update with bound values", PHP_EOL;
//$vals = array('b');
$vals = "{ 'b' }";
$cql = "UPDATE $table_name SET set_test = ? WHERE id = ?";
$stmt = $db->prepare($cql);
$stmt->bindValue(1, $vals, PDO::PARAM_INT);
$stmt->bindValue(2, $id, PDO::PARAM_INT);
$res = $stmt->execute();
var_dump($res);
if ($res === false) {
    die(var_dump($db->errorInfo()));
}
print_r($db->query("SELECT * FROM $table_name;")->fetchObject());       

No luck this time, though. The raw CQL exec works, whereas the bound value update fails:

"line 1:35 no viable alternative at input 'b'"

There is no PDO::PARAM_* nor PDO::CASSANDRA_* that maps to the constant PDO_CASSANDRA_TYPE_SET in php_pdo_cassandra_int.hpp. Same happens with Map and List.

Worse, I can't code in C++ so I'm unable to contribute a patch for this.

Being that all collections are represented in PHP as arrays (indexed or associative), I guess the best way to implement this would be taking an array argument as the value to bind. Failing that approach, a well-formed set/list/map literal that can go unquoted would do.

Currently, arrays fail silently when fed to bindValue(), which returns true. However, when execute() is run, the array is converted to a string:

PHP Notice:  Array to string conversion in /home/lisandro/NetBeansProjects/Blink/test/cassandra_pdo_collections.php on line 37

Unable to bind collection types using bindValue

When binding a collection value, according to the documentation, it should work using a string type. But it fails with this error:

CQLSTATE[HY000] [2] Invalid STRING constant ({'key':0,'other':128.5,'w00t':128.5}) for values of type map<text, double>

Any clue? Who's responsible of throwing this error? It's seems to be related with some internal PDO checks instead of PDO_Cassandra, no?

Binary Values in Fetching Timestamps

I posted a comment on #34 but noticed it was closed. I don't see a way of reopening it. It's definitely not working for me. My Comment:

I'm also seeing this on 64 bit PHP 5.3.3:

$ uname -a
Linux localhost 2.6.32-431.5.1.el6.x86_64 #1 SMP Wed Feb 12 00:41:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ php -r 'echo PHP_INT_SIZE . "\n";'
8
$ php -v
PHP 5.3.3 (cli) (built: Dec 11 2013 03:29:57) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Xdebug v2.1.4, Copyright (c) 2002-2012, by Derick Rethans
$ php ./version.php 

VERSION: 0.5.1

$ php ./test.php
array(1) {
  [0]=>
  array(2) {
    ["my_timestamp"]=>
    string(8) "8�x�"
    [0]=>
    string(8) "8�x�"
  }
}
array(1) {
  [0]=>
  array(2) {
    ["my_timestamp"]=>
    string(8) "8�v�"
    [0]=>
    string(8) "8�v�"
  }
}

I've also been setting timestamps with 64bit ints. cqlsh shows them.

NULL values are set to 0 for int, timestamp, etc

I think that pdo should send a ZVAL_NULL when the column doesnt exists in cassandra.

cqlsh:slex5> create table test_null (id int primary key, my_int int);
cqlsh:slex5> insert into test_null(id) values(1);
cqlsh:slex5> select * from test_null;

id | my_int
----+--------
1 | null

prepare($query,$params); $stmt->execute(); var_dump($stmt->fetch(PDO::FETCH_ASSOC)); --OUTPUT-- array(1) { 'my_int' => int(0) }

Column meta data: native_type field is empty

native_type field is empty

DESCRIBE TABLE test_int;
CREATE TABLE test_int (
id int PRIMARY KEY,
my_int int
) WITH
bloom_filter_fp_chance=0.010000 AND
caching='KEYS_ONLY' AND
comment='' AND
dclocal_read_repair_chance=0.000000 AND
gc_grace_seconds=864000 AND
read_repair_chance=0.100000 AND
replicate_on_write='true' AND
compaction={'class': 'SizeTieredCompactionStrategy'} AND
compression={'sstable_compression': 'SnappyCompressor'};

prepare($query); $stmt->execute(); $row = $stmt->fetch(PDO::FETCH_ASSOC); var_dump($stmt->getColumnmeta(1)); -- OUTPUT -- array(7) { 'keyspace' => string(5) "slex5" 'columnfamily' => string(8) "test_int" 'native_type' => string(7) "unknown" 'name' => string(6) "my_int" 'len' => int(-1) 'precision' => int(0) 'pdo_type' => int(1) }

cc: error: /usr/lib/libthrift.so: No such file or directory @ ubuntu 12.04

i'm trying build ubuntu packages from current git on ubuntu 12.04 x64:
libthrift-dev and thrift-compiler i'm get from http://people.apache.org/~jfarrell/thrift/0.9.0/contrib/deb/ubuntu/12.04/

dpkg-buildpackage -rfakeroot -us -uc returned following error:

libtool: compile:  g++ -Wall -Wno-write-strings -I. -I/home/karp/php-pdo-cas/YACassandraPDO -DPHP_ATOM_INC -I/home/karp/php-pdo-cas/YACassandraPDO/include -I/home/karp/php-pdo-cas/YACassandraPDO/main -I/home/karp/php-pdo-cas/YACassandraPDO -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/include/thrift -D_FORTIFY_SOURCE=2 -DHAVE_CONFIG_H -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -c /home/karp/php-pdo-cas/YACassandraPDO/gen-cpp/cassandra_types.cpp  -fPIC -DPIC -o gen-cpp/.libs/cassandra_types.o
/bin/bash /home/karp/php-pdo-cas/YACassandraPDO/libtool --mode=link cc -DPHP_ATOM_INC -I/home/karp/php-pdo-cas/YACassandraPDO/include -I/home/karp/php-pdo-cas/YACassandraPDO/main -I/home/karp/php-pdo-cas/YACassandraPDO -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/include/thrift  -D_FORTIFY_SOURCE=2 -DHAVE_CONFIG_H  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security  -Wl,-Bsymbolic-functions -Wl,-z,relro -o pdo_cassandra.la -export-dynamic -avoid-version -prefer-pic -module -rpath /home/karp/php-pdo-cas/YACassandraPDO/modules  cassandra_driver.lo cassandra_statement.lo gen-cpp/Cassandra.lo gen-cpp/cassandra_types.lo -lthrift
libtool: link: cc -shared  -fPIC -DPIC  .libs/cassandra_driver.o .libs/cassandra_statement.o gen-cpp/.libs/Cassandra.o gen-cpp/.libs/cassandra_types.o   /usr/lib/libthrift.so  -O2 -Wl,-Bsymbolic-functions -Wl,-z -Wl,relro   -Wl,-soname -Wl,pdo_cassandra.so -o .libs/pdo_cassandra.so
cc: error: /usr/lib/libthrift.so: No such file or directory

while libthrift installed as:

-rw-r--r-- 1 root root 1858996 Oct 12  2012 /usr/lib/libthrift.a
-rw-r--r-- 1 root root     975 Oct 12  2012 /usr/lib/libthrift.la
-rw-r--r-- 1 root root  136830 Oct 12  2012 /usr/lib/libthrift_c_glib.a
-rw-r--r-- 1 root root    1005 Oct 12  2012 /usr/lib/libthrift_c_glib.la
lrwxrwxrwx 1 root root      25 Oct 12  2012 /usr/lib/libthrift_c_glib.so.0 -> libthrift_c_glib.so.0.0.0
-rw-r--r-- 1 root root   75976 Oct 12  2012 /usr/lib/libthrift_c_glib.so.0.0.0
-rw-r--r-- 1 root root  352412 Oct 12  2012 /usr/lib/libthriftnb.a
-rw-r--r-- 1 root root     989 Oct 12  2012 /usr/lib/libthriftnb.la
-rw-r--r-- 1 root root  114662 Oct 12  2012 /usr/lib/libthriftqt.a
-rw-r--r-- 1 root root    1010 Oct 12  2012 /usr/lib/libthriftqt.la
-rw-r--r-- 1 root root   65894 Oct 12  2012 /usr/lib/libthriftz.a
-rw-r--r-- 1 root root     982 Oct 12  2012 /usr/lib/libthriftz.la

but after cd /usr/lib/ && sudo ln -s libthrift_c_glib.so.0.0.0 libthrift.so
seems to be builded fine.

Inserting TimeUUIDs?

How do I insert data into TimeUUID column? I didn't find any examples of that within the unit tests.

I need to insert specific dates/times into TimeUUID columns for data migration from one DB into Cassandra.

bindValue for UUID types

A uuid cannot no longer be inserted as a string (quoted) in a request.

Cassandra 1.2.2 rejects it.
PDO does not seem to expose what is necessary to do this.

Consistency level of prepared statement applies globally

Specifying a consistency level in a prepare() call sets the consistency level globally (for the database handle), rather than only for that particular statement.

$insert_stmt = $db->prepare("INSERT ...",
    array(PDO::CASSANDRA_ATTR_CONSISTENCYLEVEL =>
        PDO::CASSANDRA_CONSISTENCYLEVEL_ALL));

$select_stmt = $db->prepare("SELECT ...",
    array(PDO::CASSANDRA_ATTR_CONSISTENCYLEVEL =>
        PDO::CASSANDRA_CONSISTENCYLEVEL_ONE));

// This will run with consistency of ONE, even though ALL was
// specified at prepare time
$insert_stmt->execute();

Select uuid type from database return raw data

So lets create some table with uuid key:

CREATE TABLE some_table (
    id uuid PRIMARY KEY,
    created_at timestamp
);

Then insert some uuid4 to it:

INSERT INTO some_table (id, created_at) VALUES (23bdc83a-a0b3-4c96-a536-b2f3a007ee1f, '2013-06-18');

Via cqlsh tool we will select from some_table and get valid uuid:

cqlsh:keyspace> SELECT * FROM some_table;

 id                                   | created_at
--------------------------------------+--------------------------
 23bdc83a-a0b3-4c96-a536-b2f3a007ee1f | 2013-06-18 00:00:00+0300

When we query via php PDO, we get binary presentation of uuid:

Array
(
    [0] => Array
        (
            [id] => #½È: ³L–¥6²ó �î�
            [created_at] => 1371502800000
        )
)

Is it bug or how to get proper uuid automacy without updating (converting) every row after query?

bindValue replaces NULL values with "NULL" strings

When running a prepared statement on VARCHAR/ASCII columns, if a null value is fed, a string "NULL" will be written instead.

SELECT * FROM users;

 id                                   | disabled | dvcid | dvctype | email        | fname   | groups | lname | pic  | plan | profile 
--------------------------------------+----------+-------+---------+--------------+---------+--------+-------+------+------+---------
 2762a626-c4ca-43e9-811e-b44d2d6c9548 |     null |  NULL |    null | [email protected] | Juanito |   null | Perez | NULL | NULL |    null 

Binding boolean with bindValue does not work

When I run:
$stmt->bindValue(':is_active', true, \PDO::PARAM_BOOL);

I get this kind of error:
Fatal error: Uncaught exception 'Exception' with message 'Execution statement failed. Error:
<pre>
array(3) {
[0]=>
string(5) "00000"
[1]=>
int(2)
[2]=>
string(58) "Invalid INTEGER constant (1) for is_active of type boolean"
}

If I run:
$stmt->bindValue(':is_active', "true", \PDO::PARAM_BOOL);

it works.

Default values for constants

Where I can find default values for all constants that are in README.md?

For example PDO::CASSANDRA_ATTR_CONN_TIMEOUT.
I am interested to know how long the client will wait for first node if it is dead, and then try to connect to second specified in dsn.

Compiling on OS X 10.9 Mavericks

[adhir@udante:~/src/YACassandraPDO] make
/bin/sh /Users/adhir/src/YACassandraPDO/libtool --mode=compile g++ -Wall -Wno-write-strings -I/usr/include/php/ext -I. -I/Users/adhir/src/YACassandraPDO -DPHP_ATOM_INC -I/Users/adhir/src/YACassandraPDO/include -I/Users/adhir/src/YACassandraPDO/main -I/Users/adhir/src/YACassandraPDO -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/local/Cellar/thrift/0.9.1/include -I/usr/local/Cellar/boost/1.55.0/include -DHAVE_CONFIG_H -g -O2 -c /Users/adhir/src/YACassandraPDO/cassandra_driver.cpp -o cassandra_driver.lo
mkdir .libs
g++ -Wall -Wno-write-strings -I/usr/include/php/ext -I. -I/Users/adhir/src/YACassandraPDO -DPHP_ATOM_INC -I/Users/adhir/src/YACassandraPDO/include -I/Users/adhir/src/YACassandraPDO/main -I/Users/adhir/src/YACassandraPDO -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/local/Cellar/thrift/0.9.1/include -I/usr/local/Cellar/boost/1.55.0/include -DHAVE_CONFIG_H -g -O2 -c /Users/adhir/src/YACassandraPDO/cassandra_driver.cpp -fno-common -DPIC -o .libs/cassandra_driver.o
In file included from /Users/adhir/src/YACassandraPDO/cassandra_driver.cpp:18:
In file included from ./php_pdo_cassandra_int.hpp:49:
In file included from ./gen-cpp/Cassandra.h:11:
In file included from ./gen-cpp/cassandra_types.h:15:
/usr/local/Cellar/thrift/0.9.1/include/thrift/cxxfunctional.h:93:18: error: no member
named 'bind' in namespace 'std'
using ::std::bind;
~~~~~~~^
In file included from /Users/adhir/src/YACassandraPDO/cassandra_driver.cpp:18:
In file included from ./php_pdo_cassandra_int.hpp:50:
/usr/local/Cellar/thrift/0.9.1/include/thrift/protocol/TBinaryProtocol.h:70:12: error: no
type named 'free' in namespace 'std'
std::free(string_buf_);
~~~~~^
In file included from /Users/adhir/src/YACassandraPDO/cassandra_driver.cpp:18:
In file included from ./php_pdo_cassandra_int.hpp:50:
In file included from /usr/local/Cellar/thrift/0.9.1/include/thrift/protocol/TBinaryProtocol.h:280:
/usr/local/Cellar/thrift/0.9.1/include/thrift/protocol/TBinaryProtocol.tcc:451:33: error:
no member named 'realloc' in namespace 'std'
void* new_string_buf = std::realloc(this->string_buf_, (uint32_t)size);
~~~~~^
/Users/adhir/src/YACassandraPDO/cassandra_driver.cpp:71:21: error: variable has incomplete
type 'struct tcp_info'
struct tcp_info tcpi;
^
/Users/adhir/src/YACassandraPDO/cassandra_driver.cpp:71:12: note: forward declaration of
'tcp_info'
struct tcp_info tcpi;
^
/Users/adhir/src/YACassandraPDO/cassandra_driver.cpp:73:30: error: use of undeclared
identifier 'SOL_TCP'
if (-1 == getsockopt(fd, SOL_TCP, TCP_INFO, &tcpi, &len))
^
/Users/adhir/src/YACassandraPDO/cassandra_driver.cpp:75:31: error: use of undeclared
identifier 'TCP_ESTABLISHED'
return tcpi.tcpi_state == TCP_ESTABLISHED ? SUCCESS : FAILURE;
^
6 errors generated.
make: *** [cassandra_driver.lo] Error 1

UUID format

UUID test fails with cassandra 1.2.2
UUID in the test is correct and TYPE 1

Connecting to a cluster with one of the nodes being down

Hi,

I have two cassandra nodes set up in a cluster:
192.168.188.31
192.168.188.32

I have set the replication factor of my test keyspace to 2:
CREATE KEYSPACE mykeyspace WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 2 };

When I stop the cassandra service on the second node (192.168.188.32) :
root@ubuntu:~# service cassandra stop

I can still connect to the first one (192.168.188.31) via cqlsh and select all the data.

However I can not connect via PHP.

My code:

Fatal error: Uncaught exception 'PDOException' with message 'CQLSTATE[08006] [8] TTransportException: Transport not open' in /path/to/file Is the PDO supposed to handle this or am I supposed to detect unavailable nodes in all datacenters and clusters I intend to connect to ?

Getting the result of a conditional DELETE or UPDATE

If I do a:

DELETE FROM table WHERE id = 'something' IF field = 'value'

in CQLSH I get the response:

 [applied]
-----------
      True

or

 [applied]
-----------
     False

Is there any way to get this result from the driver somehow making it possible to for use in my code?

PDO::ATTR_TIMEOUT should be seconds, not milliseconds

PDO documentation specifies PDO::ATTR_TIMEOUT as an integer number of seconds. The YACassandraPDO driver is treating the value as milliseconds.

Also, it seems supplying a value for PDO::CASSANDRA_ATTR_CONN_TIMEOUT in the constructor's $driver_options array has no effect.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.