Diff for /embedaddon/php/ext/sqlite3/sqlite3.c between versions 1.1.1.2 and 1.1.1.4

version 1.1.1.2, 2012/05/29 12:34:43 version 1.1.1.4, 2014/06/15 20:03:56
Line 2 Line 2
    +----------------------------------------------------------------------+     +----------------------------------------------------------------------+
    | PHP Version 5                                                        |     | PHP Version 5                                                        |
    +----------------------------------------------------------------------+     +----------------------------------------------------------------------+
   | Copyright (c) 1997-2012 The PHP Group                                |   | Copyright (c) 1997-2014 The PHP Group                                |
    +----------------------------------------------------------------------+     +----------------------------------------------------------------------+
    | This source file is subject to version 3.01 of the PHP license,      |     | This source file is subject to version 3.01 of the PHP license,      |
    | that is bundled with this package in the file LICENSE, and is        |     | that is bundled with this package in the file LICENSE, and is        |
Line 114  PHP_METHOD(sqlite3, open) Line 114  PHP_METHOD(sqlite3, open)
                 zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Already initialised DB Object", 0 TSRMLS_CC);                  zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Already initialised DB Object", 0 TSRMLS_CC);
         }          }
   
        if (strncmp(filename, ":memory:", 8) != 0) {        if (strlen(filename) != filename_len) {
                 return;
         }
         if (memcmp(filename, ":memory:", sizeof(":memory:")) != 0) {
                 if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) {                  if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) {
                         zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Unable to expand filepath", 0 TSRMLS_CC);                          zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Unable to expand filepath", 0 TSRMLS_CC);
                         return;                          return;
Line 727  static int sqlite3_do_callback(struct php_sqlite3_fci  Line 730  static int sqlite3_do_callback(struct php_sqlite3_fci 
   
                 switch (sqlite3_value_type(argv[i])) {                  switch (sqlite3_value_type(argv[i])) {
                         case SQLITE_INTEGER:                          case SQLITE_INTEGER:
   #if LONG_MAX > 2147483647
                                   ZVAL_LONG(*zargs[i + is_agg], sqlite3_value_int64(argv[i]));
   #else
                                 ZVAL_LONG(*zargs[i + is_agg], sqlite3_value_int(argv[i]));                                  ZVAL_LONG(*zargs[i + is_agg], sqlite3_value_int(argv[i]));
   #endif
                                 break;                                  break;
   
                         case SQLITE_FLOAT:                          case SQLITE_FLOAT:
Line 771  static int sqlite3_do_callback(struct php_sqlite3_fci  Line 778  static int sqlite3_do_callback(struct php_sqlite3_fci 
                 if (retval) {                  if (retval) {
                         switch (Z_TYPE_P(retval)) {                          switch (Z_TYPE_P(retval)) {
                                 case IS_LONG:                                  case IS_LONG:
   #if LONG_MAX > 2147483647
                                           sqlite3_result_int64(context, Z_LVAL_P(retval));
   #else
                                         sqlite3_result_int(context, Z_LVAL_P(retval));                                          sqlite3_result_int(context, Z_LVAL_P(retval));
   #endif
                                         break;                                          break;
   
                                 case IS_NULL:                                  case IS_NULL:
Line 1094  static int php_sqlite3_stream_close(php_stream *stream Line 1105  static int php_sqlite3_stream_close(php_stream *stream
         php_stream_sqlite3_data *sqlite3_stream = (php_stream_sqlite3_data *) stream->abstract;          php_stream_sqlite3_data *sqlite3_stream = (php_stream_sqlite3_data *) stream->abstract;
                   
         if (sqlite3_blob_close(sqlite3_stream->blob) != SQLITE_OK) {          if (sqlite3_blob_close(sqlite3_stream->blob) != SQLITE_OK) {
                /* Error occured, but it still closed */                /* Error occurred, but it still closed */
         }          }
   
         efree(sqlite3_stream);          efree(sqlite3_stream);
Line 1398  static int register_bound_parameter_to_sqlite(struct p Line 1409  static int register_bound_parameter_to_sqlite(struct p
 /* }}} */  /* }}} */
   
 /* {{{ proto bool SQLite3Stmt::bindParam(int parameter_number, mixed parameter [, int type])  /* {{{ proto bool SQLite3Stmt::bindParam(int parameter_number, mixed parameter [, int type])
   Bind Paramater to a stmt variable. */   Bind Parameter to a stmt variable. */
 PHP_METHOD(sqlite3stmt, bindParam)  PHP_METHOD(sqlite3stmt, bindParam)
 {  {
         php_sqlite3_stmt *stmt_obj;          php_sqlite3_stmt *stmt_obj;
Line 1490  PHP_METHOD(sqlite3stmt, execute) Line 1501  PHP_METHOD(sqlite3stmt, execute)
                         switch (param->type) {                          switch (param->type) {
                                 case SQLITE_INTEGER:                                  case SQLITE_INTEGER:
                                         convert_to_long(param->parameter);                                          convert_to_long(param->parameter);
   #if LONG_MAX > 2147483647
                                           sqlite3_bind_int64(stmt_obj->stmt, param->param_number, Z_LVAL_P(param->parameter));
   #else
                                         sqlite3_bind_int(stmt_obj->stmt, param->param_number, Z_LVAL_P(param->parameter));                                          sqlite3_bind_int(stmt_obj->stmt, param->param_number, Z_LVAL_P(param->parameter));
   #endif
                                         break;                                          break;
   
                                 case SQLITE_FLOAT:                                  case SQLITE_FLOAT:
Line 1959  static int php_sqlite3_authorizer(void *autharg, int a Line 1974  static int php_sqlite3_authorizer(void *autharg, int a
         switch (access_type) {          switch (access_type) {
                 case SQLITE_ATTACH:                  case SQLITE_ATTACH:
                 {                  {
                        if (strncmp(arg3, ":memory:", sizeof(":memory:")-1) && *arg3) {                        if (memcmp(arg3, ":memory:", sizeof(":memory:")) && *arg3) {
                                 TSRMLS_FETCH();                                  TSRMLS_FETCH();
   
 #if PHP_API_VERSION < 20100412  #if PHP_API_VERSION < 20100412

Removed from v.1.1.1.2  
changed lines
  Added in v.1.1.1.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>