php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31467 sql_fetch_column_types
Submitted: 2005-01-10 06:58 UTC Modified: 2005-01-10 08:20 UTC
From: irchtml@php.net Assigned: helly (profile)
Status: Closed Package: SQLite related
PHP Version: 5.1.0-dev OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: irchtml@php.net
New email:
PHP Version: OS:

 

 [2005-01-10 06:58 UTC] irchtml@php.net
Description:
------------
In ext/sqlite/sqlite.c, sqlite_fetch_column_types doesn't allow the use of the optional parameter, result_type when not using the OO "interface".  Patch follows.

Index: sqlite.c
===================================================================
RCS file: /repository/php-src/ext/sqlite/sqlite.c,v
retrieving revision 1.151
diff -u -B -r1.151 sqlite.c
--- sqlite.c	26 Nov 2004 13:17:30 -0000	1.151
+++ sqlite.c	10 Jan 2005 05:57:01 -0000
@@ -1591,8 +1591,8 @@
 		DB_FROM_OBJECT(db, object);
 	} else {
 		if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
-				ZEND_NUM_ARGS() TSRMLS_CC, "sr", &tbl, &tbl_len, &zdb) && 
-			FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &zdb, &tbl, &tbl_len)) {
+				ZEND_NUM_ARGS() TSRMLS_CC, "sr|l", &tbl, &tbl_len, &zdb, &result_type) && 
+			FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &zdb, &tbl, &tbl_len, &result_type)) {
 			return;
 		}
 		DB_FROM_ZVAL(db, &zdb);



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-10 07:08 UTC] irchtml@php.net
Apologies, above patch won't fix it, there was an extra parameter floating in there that isn't used.

Index: sqlite.c
===================================================================
RCS file: /repository/php-src/ext/sqlite/sqlite.c,v
retrieving revision 1.151
diff -u -B -r1.151 sqlite.c
--- sqlite.c	26 Nov 2004 13:17:30 -0000	1.151
+++ sqlite.c	10 Jan 2005 06:06:27 -0000
@@ -1576,7 +1576,6 @@
 	zval *zdb;
 	struct php_sqlite_db *db;
 	char *tbl, *sql;
-	int tbl_len;
 	char *errtext = NULL;
 	zval *object = getThis();
 	struct php_sqlite_result res;
@@ -1585,14 +1584,14 @@
 	long result_type = PHPSQLITE_ASSOC;
 
 	if (object) {
-		if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &tbl, &tbl_len, &result_type)) {
+		if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &tbl, &result_type)) {
 			return;
 		}
 		DB_FROM_OBJECT(db, object);
 	} else {
 		if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
-				ZEND_NUM_ARGS() TSRMLS_CC, "sr", &tbl, &tbl_len, &zdb) && 
-			FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &zdb, &tbl, &tbl_len)) {
+				ZEND_NUM_ARGS() TSRMLS_CC, "sr|l", &tbl, &zdb, &result_type) && 
+			FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &zdb, &tbl, &result_type)) {
 			return;
 		}
 		DB_FROM_ZVAL(db, &zdb);

 [2005-01-10 08:10 UTC] irchtml@php.net
The first patch is actually correct.  It's getting late, I'll be leaving now. ;)
 [2005-01-10 08:20 UTC] helly@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

thanks
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 21:01:29 2024 UTC