[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pecl-cvs
Subject:    [PECL-CVS] com =?UTF-8?Q?pecl/database/mysql=5Fxdevapi=3A=20orabug=20=23=33=30=31=33?= =?UTF-8?Q?=34
From:       hery ramilison <mysqlre () php ! net>
Date:       2020-08-27 17:16:44
Message-ID: php-mail-9f49e9d140f4fd55cf70db93bbb9139f564761532 () git ! php ! net
[Download RAW message or body]

Commit:    efdbf968c37e52b87206d887c49e122f2867948f
Author:    Darek Slusarczyk <dariusz.slusarczyk@oracle.com>         Thu, 27 Aug 2020 \
                19:16:44 +0200
Parents:   8b531e53eca4db4514a64ba0efad2ec41064f0f5
Branches:  release/8.0.23

Link:       http://git.php.net/?p=pecl/database/mysql_xdevapi.git;a=commitdiff;h=efdbf968c37e52b87206d887c49e122f2867948f


Log:
orabug #30134451: mysqlndx replace raw zval with improved zvalue where possible

fix warnings on win32 - size_t vs uint64_t

Bugs:
https://bugs.php.net/30134451

Changed paths:
  M  mysqlx_execution_status.cc
  M  mysqlx_result.cc
  M  mysqlx_sql_statement_result.cc
  M  xmysqlnd/xmysqlnd_session.cc
  M  xmysqlnd/xmysqlnd_session.h


Diff:
diff --git a/mysqlx_execution_status.cc b/mysqlx_execution_status.cc
index 2541379a..e2279abe 100644
--- a/mysqlx_execution_status.cc
+++ b/mysqlx_execution_status.cc
@@ -36,9 +36,9 @@ static zend_class_entry * mysqlx_execution_status_class_entry;
 
 struct st_mysqlx_execution_status : public util::custom_allocable
 {
-	size_t items_affected;
-	size_t items_matched;
-	size_t items_found;
+	uint64_t items_affected;
+	uint64_t items_matched;
+	uint64_t items_found;
 	uint64_t last_insert_id;
 
 	zend_bool persistent;
@@ -62,7 +62,7 @@ mysqlx_execution_status_property_affected_items(const \
st_mysqlx_object* obj, uti  {
 	const st_mysqlx_execution_status* object = (st_mysqlx_execution_status*)(obj->ptr);
 	DBG_ENTER("mysqlx_execution_status_property_affected_items");
-	ZVAL_LONG(return_value, object->items_affected);
+	ZVAL_LONG(return_value, static_cast<zend_long>(object->items_affected));
 	DBG_RETURN(return_value);
 }
 
@@ -71,7 +71,7 @@ mysqlx_execution_status_property_matched_items(const \
st_mysqlx_object* obj, util  {
 	const st_mysqlx_execution_status* object = (st_mysqlx_execution_status*)(obj->ptr);
 	DBG_ENTER("mysqlx_execution_status_property_matched_items");
-	ZVAL_LONG(return_value, object->items_matched);
+	ZVAL_LONG(return_value, static_cast<zend_long>(object->items_matched));
 	DBG_RETURN(return_value);
 }
 
@@ -80,7 +80,7 @@ mysqlx_execution_status_property_found_items(const \
st_mysqlx_object* obj, util::  {
 	const st_mysqlx_execution_status* object = (st_mysqlx_execution_status*)(obj->ptr);
 	DBG_ENTER("mysqlx_execution_status_property_found_items");
-	ZVAL_LONG(return_value, object->items_found);
+	ZVAL_LONG(return_value, static_cast<zend_long>(object->items_found));
 	DBG_RETURN(return_value);
 }
 
diff --git a/mysqlx_result.cc b/mysqlx_result.cc
index 0b1011d5..62fe164e 100644
--- a/mysqlx_result.cc
+++ b/mysqlx_result.cc
@@ -86,12 +86,12 @@ MYSQL_XDEVAPI_PHP_METHOD(mysqlx_result, getAffectedItemsCount)
 	const XMYSQLND_STMT_EXECUTION_STATE* exec_state = data_object.result->exec_state;
 	/* Maybe check here if there was an error and throw an Exception or return a \
warning */  if (exec_state) {
-		const size_t value = exec_state->m->get_affected_items_count(exec_state);
+		const uint64_t value = exec_state->m->get_affected_items_count(exec_state);
 		if (UNEXPECTED(value >= ZEND_LONG_MAX)) {
 			ZVAL_NEW_STR(return_value, strpprintf(0, "%s", util::to_string(value).c_str()));
 			DBG_INF_FMT("value(S)=%s", Z_STRVAL_P(return_value));
 		} else {
-			RETVAL_LONG(value);
+			RETVAL_LONG(static_cast<zend_long>(value));
 			DBG_INF_FMT("value(L)=%lu", Z_LVAL_P(return_value));
 		}
 	}
diff --git a/mysqlx_sql_statement_result.cc b/mysqlx_sql_statement_result.cc
index 7907ad96..17eb6c99 100644
--- a/mysqlx_sql_statement_result.cc
+++ b/mysqlx_sql_statement_result.cc
@@ -228,12 +228,12 @@ MYSQL_XDEVAPI_PHP_METHOD(mysqlx_sql_statement_result, \
getAffectedItemsCount)  const XMYSQLND_STMT_EXECUTION_STATE* exec_state = \
data_object.result->exec_state;  /* Maybe check here if there was an error and throw \
an Exception or return a warning */  if (exec_state) {
-		const size_t value = exec_state->m->get_affected_items_count(exec_state);
+		const uint64_t value = exec_state->m->get_affected_items_count(exec_state);
 		if (UNEXPECTED(value >= ZEND_LONG_MAX)) {
 			ZVAL_NEW_STR(return_value, strpprintf(0, "%s", util::to_string(value).c_str()));
 			DBG_INF_FMT("value(S)=%s", Z_STRVAL_P(return_value));
 		} else {
-			RETVAL_LONG(value);
+			RETVAL_LONG(static_cast<zend_long>(value));
 			DBG_INF_FMT("value(L)=%lu", Z_LVAL_P(return_value));
 		}
 	}
diff --git a/xmysqlnd/xmysqlnd_session.cc b/xmysqlnd/xmysqlnd_session.cc
index 6ab761da..09c2a866 100644
--- a/xmysqlnd/xmysqlnd_session.cc
+++ b/xmysqlnd/xmysqlnd_session.cc
@@ -636,7 +636,7 @@ bool xmysqlnd_session_data::is_session_properly_supported()
 	return *session_properly_supported;
 }
 
-size_t
+uint64_t
 xmysqlnd_session_data::get_client_id()
 {
 	return client_id;
diff --git a/xmysqlnd/xmysqlnd_session.h b/xmysqlnd/xmysqlnd_session.h
index 745bf47d..9b5b75d3 100644
--- a/xmysqlnd/xmysqlnd_session.h
+++ b/xmysqlnd/xmysqlnd_session.h
@@ -465,7 +465,7 @@ public:
 	size_t            negotiate_client_api_capabilities(const size_t flags);
 
 	bool is_session_properly_supported();
-	size_t            get_client_id();
+	uint64_t          get_client_id();
 	void              cleanup();
 public:
 	/* Operation related */


--
PECL CVS Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic