summaryrefslogtreecommitdiff
path: root/ext/mysql
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>1999-08-17 22:06:55 +0000
committerZeev Suraski <zeev@php.net>1999-08-17 22:06:55 +0000
commitcd2006f8b7c1ea3733ecd748f307ca1afcf885c0 (patch)
treeaf6d1548158ab09e18e7c29ce92e10f16578b044 /ext/mysql
parent39f6b22dae27ff58d4864d245968784d5a820701 (diff)
downloadphp-git-cd2006f8b7c1ea3733ecd748f307ca1afcf885c0.tar.gz
Fix #2090
Diffstat (limited to 'ext/mysql')
-rw-r--r--ext/mysql/mysql.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/mysql/mysql.c b/ext/mysql/mysql.c
index 5b2982f1fe..ff66ba7483 100644
--- a/ext/mysql/mysql.c
+++ b/ext/mysql/mysql.c
@@ -69,8 +69,12 @@ static int le_result,le_link,le_plink;
#if MYSQL_VERSION_ID > 32199
#define mysql_row_length_type unsigned long
+#define HAVE_MYSQL_ERRNO
#else
#define mysql_row_length_type unsigned int
+# ifdef mysql_errno
+# define HAVE_MYSQL_ERRNO
+# endif
#endif
#define MYSQL_ASSOC 1<<0
@@ -90,7 +94,7 @@ function_entry mysql_functions[] = {
PHP_FE(mysql_list_tables, NULL)
PHP_FE(mysql_list_fields, NULL)
PHP_FE(mysql_error, NULL)
-#ifdef mysql_errno
+#ifdef HAVE_MYSQL_ERRNO
PHP_FE(mysql_errno, NULL)
#endif
PHP_FE(mysql_affected_rows, NULL)
@@ -492,7 +496,7 @@ static void php3_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
#if APACHE
handler=signal(SIGPIPE,SIG_IGN);
#endif
-#if defined(mysql_errno) && defined(CR_SERVER_GONE_ERROR)
+#if defined(HAVE_MYSQL_ERRNO) && defined(CR_SERVER_GONE_ERROR)
mysql_stat(le->ptr);
if (mysql_errno((MYSQL *)le->ptr) == CR_SERVER_GONE_ERROR) {
#else
@@ -1108,7 +1112,7 @@ PHP_FUNCTION(mysql_error)
/* {{{ proto int mysql_errno([int link_identifier])
Returns the number of the error message from previous MySQL operation */
-#ifdef mysql_errno
+#ifdef HAVE_MYSQL_ERRNO
PHP_FUNCTION(mysql_errno)
{
pval *mysql_link;