cvs: php4 /ext/mysql php_mysql.c

From: Date: Thu, 10 Apr 2003 04:35:39 +0000
Subject: cvs: php4 /ext/mysql php_mysql.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-20204@lists.php.net to get a copy of this message
iliaa Thu Apr 10 00:35:39 2003 EDT Modified files: /php4/ext/mysql php_mysql.c Log: Fixed a crash in the query tracer output due to buffer overflow. Fixed a crash in notice message for unbuffered query. Index: php4/ext/mysql/php_mysql.c diff -u php4/ext/mysql/php_mysql.c:1.186 php4/ext/mysql/php_mysql.c:1.187 --- php4/ext/mysql/php_mysql.c:1.186 Fri Mar 7 00:15:18 2003 +++ php4/ext/mysql/php_mysql.c Thu Apr 10 00:35:39 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_mysql.c,v 1.186 2003/03/07 05:15:18 sniper Exp $ */ +/* $Id: php_mysql.c,v 1.187 2003/04/10 04:35:39 iliaa Exp $ */ /* TODO: * @@ -1170,7 +1170,6 @@ { php_mysql_conn *mysql; MYSQL_RES *mysql_result; - char tmp[128]; ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, link_id, "MySQL-Link", le_link, le_plink); @@ -1189,7 +1188,7 @@ mysql_result = (MYSQL_RES *) zend_list_find(mysql->active_result_id, &type); if (mysql_result && type==le_result) { if (!mysql_eof(mysql_result)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s(): Function called without first fetching all rows from a previous unbuffered query"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Function called without first fetching all rows from a previous unbuffered query"); while (mysql_fetch_row(mysql_result)); } zend_list_delete(mysql->active_result_id); @@ -1216,12 +1215,9 @@ mysql_result = mysql_use_result(&mysql->conn); while ((row = mysql_fetch_row(mysql_result))) { if (!strcmp("ALL", row[1])) { - sprintf((char *)&tmp, "Your query requires a full tablescan (table %s, %s rows affected). Use EXPLAIN to optimize your query.", row[0], row[6]); - php_error_docref("http://www.mysql.com/doc" TSRMLS_CC, E_WARNING, tmp); - } - else if (!strcmp("INDEX", row[1])) { - sprintf((char *)&tmp, "Your query requires a full indexscan (table %s, %s rows affected). Use EXPLAIN to optimize your query.", row[0], row[6]); - php_error_docref("http://www.mysql.com/doc" TSRMLS_CC, E_WARNING, tmp); + php_error_docref("http://www.mysql.com/doc" TSRMLS_CC, E_WARNING, "Your query requires a full tablescan (table %s, %s rows affected). Use EXPLAIN to optimize your query.", row[0], row[6]); + } else if (!strcmp("INDEX", row[1])) { + php_error_docref("http://www.mysql.com/doc" TSRMLS_CC, E_WARNING, "Your query requires a full indexscan (table %s, %s rows affected). Use EXPLAIN to optimize your query.", row[0], row[6]); } } mysql_free_result(mysql_result);

« previous php.cvs (#20204) next »