PDO & size_t

From: Date: Mon, 26 Jan 2015 00:43:26 +0000
Subject: PDO & size_t
Groups: php.internals 
Request: Send a blank email to internals+get-81149@lists.php.net to get a copy of this message
Hi! With recent moving of string lengths to size_t, it looks like PDO APIs weren't updated. I.e.: typedef int (*pdo_stmt_get_col_data_func)(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees); This looks like len should be size_t, and in fact fetch_value() in pdo_stmt.c sends size_t parameter there, but since I'm not very familiar with PDO internals, I'd like to double check - is it an omission and will anything break if I change it to size_t? There are also other things, like: const char *driver_name; zend_ulong driver_name_len; typedef int (*pdo_dbh_prepare_func)(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options); typedef zend_long (*pdo_dbh_do_func)(pdo_dbh_t *dbh, const char *sql, zend_long sql_len); typedef int (*pdo_dbh_quote_func)(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype); As you can see, sometimes length is an int, sometimes zend_long, sometimes zend_ulong. This looks like it needs some cleanup. -- Stas Malyshev smalyshev@gmail.com

« previous php.internals (#81149) next »