diff options
author | Remi Collet <remi@remirepo.net> | 2019-07-09 09:17:21 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2019-07-09 09:17:21 +0200 |
commit | 3abb79ec386c98c43eaf2681948760ac1774dbe1 (patch) | |
tree | fcc1d85896da27730a4940923515e0315806c315 | |
parent | 185e6553ea299fb7aa88cafee3a2a4d07e4054fb (diff) |
- add patch for PHP 7.4 from
https://github.com/php/pecl-database-mysql_xdevapi/pull/6
https://github.com/php/pecl-database-mysql_xdevapi/pull/7
-rw-r--r-- | 6.patch | 38 | ||||
-rw-r--r-- | 7.patch | 382 | ||||
-rw-r--r-- | php-pecl-mysql-xdevapi.spec | 21 |
3 files changed, 438 insertions, 3 deletions
@@ -0,0 +1,38 @@ +From cdc9220d8585011cf48fbbb82f2d2a6b2b3352ac Mon Sep 17 00:00:00 2001 +From: Peter Kokot <peterkokot@gmail.com> +Date: Thu, 27 Jun 2019 00:43:21 +0200 +Subject: [PATCH] Remove HAVE_SPL + +The HAVE_SPL symbol is defined in PHP to indicate the presence of the +spl extension. Since PHP 5.3 the spl extension is always availabe and +since PHP-7.4 the HAVE_SPL symbol has also been removed. +--- + mysqlx_exception.cc | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/mysqlx_exception.cc b/mysqlx_exception.cc +index a2e423d6..5fc2883e 100644 +--- a/mysqlx_exception.cc ++++ b/mysqlx_exception.cc +@@ -19,9 +19,7 @@ + extern "C" { + #include <zend_exceptions.h> + #include "mysqlnd_api.h" +-#ifdef HAVE_SPL + #include <ext/spl/spl_exceptions.h> /* spl_ce_RuntimeException */ +-#endif + } + #include "xmysqlnd/xmysqlnd.h" + #include "php_mysqlx.h" +@@ -140,11 +138,7 @@ mysqlx_register_exception_class(UNUSED_INIT_FUNC_ARGS, zend_object_handlers * my + { + zend_class_entry tmp_ce; + INIT_NS_CLASS_ENTRY(tmp_ce, "mysql_xdevapi", "Exception", mysqlx_exception_methods); +-#ifdef HAVE_SPL + mysqlx_exception_class_entry = zend_register_internal_class_ex(&tmp_ce, spl_ce_RuntimeException); +-#else +- mysqlx_exception_class_entry = zend_register_internal_class_ex(&tmp_ce, zend_ce_exception); +-#endif + } + + zend_hash_init(&mysqlx_exception_properties, 0, nullptr, mysqlx_free_property_cb, 1); @@ -0,0 +1,382 @@ +From 97041c5937f9699623fb17871e833efaa5b95d64 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Tue, 9 Jul 2019 09:01:38 +0200 +Subject: [PATCH] fix for 7.4 + +--- + messages/mysqlx_resultset__data_row.cc | 24 +++++++++--------- + mysqlx_class_properties.cc | 8 ++++++ + mysqlx_class_properties.h | 4 +++ + xmysqlnd/xmysqlnd_protocol_dumper.cc | 14 +++++------ + xmysqlnd/xmysqlnd_rowset_fwd.cc | 6 ++--- + xmysqlnd/xmysqlnd_session.cc | 2 +- + xmysqlnd/xmysqlnd_stmt.cc | 4 +-- + xmysqlnd/xmysqlnd_stmt_execution_state.cc | 8 +++--- + xmysqlnd/xmysqlnd_stmt_result.cc | 2 +- + xmysqlnd/xmysqlnd_wireprotocol.cc | 30 +++++++++++------------ + xmysqlnd/xmysqlnd_zval2any.cc | 8 +++--- + 11 files changed, 61 insertions(+), 49 deletions(-) + +diff --git a/messages/mysqlx_resultset__data_row.cc b/messages/mysqlx_resultset__data_row.cc +index 31aad8ff..3042cd56 100644 +--- a/messages/mysqlx_resultset__data_row.cc ++++ b/messages/mysqlx_resultset__data_row.cc +@@ -258,15 +258,15 @@ MYSQL_XDEVAPI_PHP_METHOD(mysqlx_data_row, decode) + } + do { + if (!util::pb::read_variant_64(input_stream, &neg)) break; +- DBG_INF_FMT("neg =" MYSQLND_LLU_SPEC, neg); ++ DBG_INF_FMT("neg =" PRIu64, neg); + if (!util::pb::read_variant_64(input_stream, &hours)) break; +- DBG_INF_FMT("hours=" MYSQLND_LLU_SPEC, hours); ++ DBG_INF_FMT("hours=" PRIu64, hours); + if (!util::pb::read_variant_64(input_stream, &minutes)) break; +- DBG_INF_FMT("mins =" MYSQLND_LLU_SPEC, minutes); ++ DBG_INF_FMT("mins =" PRIu64, minutes); + if (!util::pb::read_variant_64(input_stream, &seconds)) break; +- DBG_INF_FMT("secs =" MYSQLND_LLU_SPEC, seconds); ++ DBG_INF_FMT("secs =" PRIu64, seconds); + if (!util::pb::read_variant_64(input_stream, &useconds)) break; +- DBG_INF_FMT("usecs=" MYSQLND_LLU_SPEC, useconds); ++ DBG_INF_FMT("usecs=" PRIu64, useconds); + } while (0); + #define TIME_FMT_STR "%s%02u:%02u:%02u.%08u" + ZVAL_NEW_STR(&zv, strpprintf(0, TIME_FMT_STR , neg? "-":"", +@@ -296,19 +296,19 @@ MYSQL_XDEVAPI_PHP_METHOD(mysqlx_data_row, decode) + } + do { + if (!util::pb::read_variant_64(input_stream, &year)) break; +- DBG_INF_FMT("year =" MYSQLND_LLU_SPEC, year); ++ DBG_INF_FMT("year =" PRIu64, year); + if (!util::pb::read_variant_64(input_stream, &month)) break; +- DBG_INF_FMT("month=" MYSQLND_LLU_SPEC, month); ++ DBG_INF_FMT("month=" PRIu64, month); + if (!util::pb::read_variant_64(input_stream, &day)) break; +- DBG_INF_FMT("day =" MYSQLND_LLU_SPEC, day); ++ DBG_INF_FMT("day =" PRIu64, day); + if (!util::pb::read_variant_64(input_stream, &hours)) break; +- DBG_INF_FMT("hours=" MYSQLND_LLU_SPEC, hours); ++ DBG_INF_FMT("hours=" PRIu64, hours); + if (!util::pb::read_variant_64(input_stream, &minutes)) break; +- DBG_INF_FMT("mins =" MYSQLND_LLU_SPEC, minutes); ++ DBG_INF_FMT("mins =" PRIu64, minutes); + if (!util::pb::read_variant_64(input_stream, &seconds)) break; +- DBG_INF_FMT("secs =" MYSQLND_LLU_SPEC, seconds); ++ DBG_INF_FMT("secs =" PRIu64, seconds); + if (!util::pb::read_variant_64(input_stream, &useconds)) break; +- DBG_INF_FMT("usecs=" MYSQLND_LLU_SPEC, useconds); ++ DBG_INF_FMT("usecs=" PRIu64, useconds); + } while (0); + #define DATETIME_FMT_STR "%04u-%02u-%02u %02u:%02u:%02u" + ZVAL_NEW_STR(&zv, strpprintf(0, DATETIME_FMT_STR , +diff --git a/mysqlx_class_properties.cc b/mysqlx_class_properties.cc +index 3f1b13b2..a167561a 100644 +--- a/mysqlx_class_properties.cc ++++ b/mysqlx_class_properties.cc +@@ -126,7 +126,11 @@ mysqlx_property_get_value(zval * object, zval * member, int type, void ** cache_ + + + /* {{{ mysqlx_property_set_value */ ++#if PHP_VERSION_ID >= 70400 ++zval * ++#else + void ++#endif + mysqlx_property_set_value(zval * object, zval * member, zval * value, void **cache_slot) + { + zval tmp_member; +@@ -158,7 +162,11 @@ mysqlx_property_set_value(zval * object, zval * member, zval * value, void **cac + if (member == &tmp_member) { + zval_dtor(member); + } ++#if PHP_VERSION_ID >= 70400 ++ DBG_RETURN(value); ++#else + DBG_VOID_RETURN; ++#endif + } + /* }}} */ + +diff --git a/mysqlx_class_properties.h b/mysqlx_class_properties.h +index 878248fa..1e3758ec 100644 +--- a/mysqlx_class_properties.h ++++ b/mysqlx_class_properties.h +@@ -45,7 +45,11 @@ struct st_mysqlx_property + void mysqlx_add_properties(HashTable * ht, const st_mysqlx_property_entry* entries); + + zval * mysqlx_property_get_value(zval * object, zval * member, int type, void ** cache_slot, zval * rv); ++#if PHP_VERSION_ID >= 70400 ++zval *mysqlx_property_set_value(zval * object, zval * member, zval * value, void ** cache_slot); ++#else + void mysqlx_property_set_value(zval * object, zval * member, zval * value, void ** cache_slot); ++#endif + int mysqlx_object_has_property(zval * object, zval *member, int has_set_exists, void ** cache_slot); + + void mysqlx_free_property_cb(zval *el); +diff --git a/xmysqlnd/xmysqlnd_protocol_dumper.cc b/xmysqlnd/xmysqlnd_protocol_dumper.cc +index aeccf049..63ce118e 100644 +--- a/xmysqlnd/xmysqlnd_protocol_dumper.cc ++++ b/xmysqlnd/xmysqlnd_protocol_dumper.cc +@@ -407,8 +407,8 @@ xmysqlnd_dump_client_message(const zend_uchar packet_type, const void * payload, + DBG_INF_FMT("limit is %s", has_collection? "SET":"NOT SET"); + if (has_limit) { + const Mysqlx::Crud::Limit & limit = message.limit(); +- DBG_INF_FMT("row_count[%s]=" MYSQLND_LLU_SPEC, limit.has_row_count()? "SET":"NOT SET", limit.has_row_count()? limit.row_count() :0); +- DBG_INF_FMT("offset [%s]=" MYSQLND_LLU_SPEC, limit.has_offset()? "SET":"NOT SET", limit.has_offset()? limit.offset() :0); ++ DBG_INF_FMT("row_count[%s]=" PRIu64, limit.has_row_count()? "SET":"NOT SET", limit.has_row_count()? limit.row_count() :0); ++ DBG_INF_FMT("offset [%s]=" PRIu64, limit.has_offset()? "SET":"NOT SET", limit.has_offset()? limit.offset() :0); + } + + DBG_INF_FMT("order_size=%d", message.order_size()); +@@ -507,8 +507,8 @@ xmysqlnd_dump_client_message(const zend_uchar packet_type, const void * payload, + DBG_INF_FMT("limit is %s", has_collection? "SET":"NOT SET"); + if (has_limit) { + const Mysqlx::Crud::Limit & limit = message.limit(); +- DBG_INF_FMT("row_count[%s]=" MYSQLND_LLU_SPEC, limit.has_row_count()? "SET":"NOT SET", limit.has_row_count()? limit.row_count() :0); +- DBG_INF_FMT("offset [%s]=" MYSQLND_LLU_SPEC, limit.has_offset()? "SET":"NOT SET", limit.has_offset()? limit.offset() :0); ++ DBG_INF_FMT("row_count[%s]=" PRIu64, limit.has_row_count()? "SET":"NOT SET", limit.has_row_count()? limit.row_count() :0); ++ DBG_INF_FMT("offset [%s]=" PRIu64, limit.has_offset()? "SET":"NOT SET", limit.has_offset()? limit.offset() :0); + } + + DBG_INF_FMT("order_size=%d", message.order_size()); +@@ -569,8 +569,8 @@ xmysqlnd_dump_client_message(const zend_uchar packet_type, const void * payload, + DBG_INF_FMT("limit is %s", has_collection? "SET":"NOT SET"); + if (has_limit) { + const Mysqlx::Crud::Limit & limit = message.limit(); +- DBG_INF_FMT("row_count[%s]=" MYSQLND_LLU_SPEC, limit.has_row_count()? "SET":"NOT SET", limit.has_row_count()? limit.row_count() :0); +- DBG_INF_FMT("offset [%s]=" MYSQLND_LLU_SPEC, limit.has_offset()? "SET":"NOT SET", limit.has_offset()? limit.offset() :0); ++ DBG_INF_FMT("row_count[%s]=" PRIu64, limit.has_row_count()? "SET":"NOT SET", limit.has_row_count()? limit.row_count() :0); ++ DBG_INF_FMT("offset [%s]=" PRIu64, limit.has_offset()? "SET":"NOT SET", limit.has_offset()? limit.offset() :0); + } + + DBG_INF_FMT("order_size=%d", message.order_size()); +@@ -641,7 +641,7 @@ xmysqlnd_dump_column_meta(const Mysqlx::Resultset::ColumnMetaData & meta) + has_catalog? meta.catalog().c_str() : "n/a"); + + const bool has_collation = meta.has_collation(); +- DBG_INF_FMT("collation[%s] is [" MYSQLND_LLU_SPEC "]", has_collation? "SET":"NOT SET", ++ DBG_INF_FMT("collation[%s] is [" PRIu64 "]", has_collation? "SET":"NOT SET", + has_collation? meta.collation() : 0); + + const bool has_frac_digits = meta.has_fractional_digits(); +diff --git a/xmysqlnd/xmysqlnd_rowset_fwd.cc b/xmysqlnd/xmysqlnd_rowset_fwd.cc +index ebdabea0..7683817b 100644 +--- a/xmysqlnd/xmysqlnd_rowset_fwd.cc ++++ b/xmysqlnd/xmysqlnd_rowset_fwd.cc +@@ -54,7 +54,7 @@ XMYSQLND_METHOD(xmysqlnd_rowset_fwd, next)(XMYSQLND_ROWSET_FWD * const result, + { + const zend_bool no_more_on_the_line = !result->stmt->get_msg_stmt_exec().reader_ctx.has_more_rows_in_set; + DBG_ENTER("xmysqlnd_rowset_fwd::next"); +- DBG_INF_FMT("row_cursor=" MYSQLND_LLU_SPEC " row_count=" MYSQLND_LLU_SPEC, result->row_cursor, result->row_count); ++ DBG_INF_FMT("row_cursor=" PRIu64 " row_count=" PRIu64, result->row_cursor, result->row_count); + + if ((result->row_count - result->row_cursor) == 1 && !no_more_on_the_line) { + DBG_INF_FMT("We have to prefetch %u row(s)", result->prefetch_rows); +@@ -101,7 +101,7 @@ XMYSQLND_METHOD(xmysqlnd_rowset_fwd, fetch_one)(XMYSQLND_ROWSET_FWD * const resu + const unsigned int field_count = result->meta->m->get_field_count(result->meta); + const size_t row_count = result->row_count; + DBG_ENTER("xmysqlnd_rowset_fwd::fetch_one"); +- DBG_INF_FMT("row_cursor=" MYSQLND_LLU_SPEC " row_count=" MYSQLND_LLU_SPEC, result->row_cursor, result->row_count); ++ DBG_INF_FMT("row_cursor=" PRIu64 " row_count=" PRIu64, result->row_cursor, result->row_count); + if (row_cursor >= row_count || !result->rows[row_cursor]) { + DBG_RETURN(FAIL); + } +@@ -153,7 +153,7 @@ XMYSQLND_METHOD(xmysqlnd_rowset_fwd, fetch_all)(XMYSQLND_ROWSET_FWD * const resu + /* Remove what we have, as we don't need it anymore */ + result->m.free_rows_contents(result, stats, error_info); + } +- DBG_INF_FMT("total_row_count=" MYSQLND_LLU_SPEC, result->total_row_count); ++ DBG_INF_FMT("total_row_count=" PRIu64, result->total_row_count); + DBG_RETURN(PASS); + } + /* }}} */ +diff --git a/xmysqlnd/xmysqlnd_session.cc b/xmysqlnd/xmysqlnd_session.cc +index 4d849d41..52f3d1da 100644 +--- a/xmysqlnd/xmysqlnd_session.cc ++++ b/xmysqlnd/xmysqlnd_session.cc +@@ -1057,7 +1057,7 @@ xmysqlnd_session_data_set_client_id(void * context, const size_t id) + enum_func_status ret{FAIL}; + xmysqlnd_session_data * session = (xmysqlnd_session_data *) context; + DBG_ENTER("xmysqlnd_session_data_set_client_id"); +- DBG_INF_FMT("id=" MYSQLND_LLU_SPEC, id); ++ DBG_INF_FMT("id=" PRIu64, id); + if (context) { + session->client_id = id; + ret = PASS; +diff --git a/xmysqlnd/xmysqlnd_stmt.cc b/xmysqlnd/xmysqlnd_stmt.cc +index d2a9908b..3222da52 100644 +--- a/xmysqlnd/xmysqlnd_stmt.cc ++++ b/xmysqlnd/xmysqlnd_stmt.cc +@@ -161,7 +161,7 @@ static const enum_hnd_func_status handler_on_row_field(void * context, + + ctx->rowset->m.destroy_row(ctx->rowset, ctx->current_row, ctx->stats, ctx->error_info); + } else { +- DBG_INF_FMT("fwd_prefetch_count=" MYSQLND_LLU_SPEC " prefetch_counter=" MYSQLND_LLU_SPEC, ctx->fwd_prefetch_count, ctx->prefetch_counter); ++ DBG_INF_FMT("fwd_prefetch_count=" PRIu64 " prefetch_counter=" PRIu64, ctx->fwd_prefetch_count, ctx->prefetch_counter); + ctx->rowset->m.add_row(ctx->rowset, ctx->current_row, ctx->stats, ctx->error_info); + if (ctx->fwd_prefetch_count && !--ctx->prefetch_counter) { + ret = HND_PASS; /* Otherwise it is HND_AGAIN */ +@@ -611,7 +611,7 @@ xmysqlnd_stmt::get_fwd_result(xmysqlnd_stmt * const stmt, + const struct st_xmysqlnd_on_stmt_execute_ok_bind on_stmt_execute_ok = { nullptr, nullptr }; + const struct st_xmysqlnd_on_resultset_end_bind on_resultset_end = { nullptr, nullptr }; + DBG_ENTER("xmysqlnd_stmt::get_fwd_result"); +- DBG_INF_FMT("rows=" MYSQLND_LLU_SPEC, rows); ++ DBG_INF_FMT("rows=" PRIu64, rows); + + if (FALSE == stmt->partial_read_started) { + read_ctx.stmt = stmt; +diff --git a/xmysqlnd/xmysqlnd_stmt_execution_state.cc b/xmysqlnd/xmysqlnd_stmt_execution_state.cc +index 5a187555..eed0e1a5 100644 +--- a/xmysqlnd/xmysqlnd_stmt_execution_state.cc ++++ b/xmysqlnd/xmysqlnd_stmt_execution_state.cc +@@ -97,7 +97,7 @@ static void + XMYSQLND_METHOD(xmysqlnd_stmt_execution_state, set_affected_items_count)(XMYSQLND_STMT_EXECUTION_STATE * const state, const size_t value) + { + DBG_ENTER("xmysqlnd_stmt_execution_state::set_affected_items_count"); +- DBG_INF_FMT("value=" MYSQLND_LLU_SPEC, value); ++ DBG_INF_FMT("value=" PRIu64, value); + state->items_affected = value; + DBG_VOID_RETURN; + } +@@ -109,7 +109,7 @@ static void + XMYSQLND_METHOD(xmysqlnd_stmt_execution_state, set_matched_items_count)(XMYSQLND_STMT_EXECUTION_STATE * const state, const size_t value) + { + DBG_ENTER("xmysqlnd_stmt_execution_state::set_matched_items_count"); +- DBG_INF_FMT("value=" MYSQLND_LLU_SPEC, value); ++ DBG_INF_FMT("value=" PRIu64, value); + state->items_matched = value; + DBG_VOID_RETURN; + } +@@ -121,7 +121,7 @@ static void + XMYSQLND_METHOD(xmysqlnd_stmt_execution_state, set_found_items_count)(XMYSQLND_STMT_EXECUTION_STATE * const state, const size_t value) + { + DBG_ENTER("xmysqlnd_stmt_execution_state::set_found_items_count"); +- DBG_INF_FMT("value=" MYSQLND_LLU_SPEC, value); ++ DBG_INF_FMT("value=" PRIu64, value); + state->items_found = value; + DBG_VOID_RETURN; + } +@@ -145,7 +145,7 @@ static void + XMYSQLND_METHOD(xmysqlnd_stmt_execution_state, set_last_insert_id)(XMYSQLND_STMT_EXECUTION_STATE * const state, const uint64_t value) + { + DBG_ENTER("xmysqlnd_stmt_execution_state::set_last_insert_id"); +- DBG_INF_FMT("value=" MYSQLND_LLU_SPEC, value); ++ DBG_INF_FMT("value=" PRIu64, value); + state->last_insert_id = value; + DBG_VOID_RETURN; + } +diff --git a/xmysqlnd/xmysqlnd_stmt_result.cc b/xmysqlnd/xmysqlnd_stmt_result.cc +index 2a8c1c32..acc21ff4 100644 +--- a/xmysqlnd/xmysqlnd_stmt_result.cc ++++ b/xmysqlnd/xmysqlnd_stmt_result.cc +@@ -224,7 +224,7 @@ XMYSQLND_METHOD(xmysqlnd_stmt_result, get_row_count)(const XMYSQLND_STMT_RESULT + if (result->rowset) { + ret = result->rowset->m.get_row_count(result->rowset); + } +- DBG_INF_FMT("rows=" MYSQLND_LLU_SPEC, ret); ++ DBG_INF_FMT("rows=" PRIu64, ret); + DBG_RETURN(ret); + } + /* }}} */ +diff --git a/xmysqlnd/xmysqlnd_wireprotocol.cc b/xmysqlnd/xmysqlnd_wireprotocol.cc +index ae7d3a91..9bc1da70 100644 +--- a/xmysqlnd/xmysqlnd_wireprotocol.cc ++++ b/xmysqlnd/xmysqlnd_wireprotocol.cc +@@ -1347,15 +1347,15 @@ enum_func_status xmysqlnd_row_time_field_to_zval( zval* zv, + } else { + do { + if (!util::pb::read_variant_64(input_stream, &neg)) break; +- DBG_INF_FMT("neg =" MYSQLND_LLU_SPEC, neg); ++ DBG_INF_FMT("neg =" PRIu64, neg); + if (!util::pb::read_variant_64(input_stream, &hours)) break; +- DBG_INF_FMT("hours =" MYSQLND_LLU_SPEC, hours); ++ DBG_INF_FMT("hours =" PRIu64, hours); + if (!util::pb::read_variant_64(input_stream, &minutes)) break; +- DBG_INF_FMT("mins =" MYSQLND_LLU_SPEC, minutes); ++ DBG_INF_FMT("mins =" PRIu64, minutes); + if (!util::pb::read_variant_64(input_stream, &seconds)) break; +- DBG_INF_FMT("secs =" MYSQLND_LLU_SPEC, seconds); ++ DBG_INF_FMT("secs =" PRIu64, seconds); + if (!util::pb::read_variant_64(input_stream, &useconds)) break; +- DBG_INF_FMT("usecs =" MYSQLND_LLU_SPEC, useconds); ++ DBG_INF_FMT("usecs =" PRIu64, useconds); + } while (0); + + auto str = util::formatter("%s%02u:%02u:%02u.%08u") +@@ -1395,19 +1395,19 @@ enum_func_status xmysqlnd_row_datetime_field_to_zval( zval* zv, + } else { + do { + if (!util::pb::read_variant_64(input_stream, &year)) break; +- DBG_INF_FMT("year =" MYSQLND_LLU_SPEC, year); ++ DBG_INF_FMT("year =" PRIu64, year); + if (!util::pb::read_variant_64(input_stream, &month)) break; +- DBG_INF_FMT("month =" MYSQLND_LLU_SPEC, month); ++ DBG_INF_FMT("month =" PRIu64, month); + if (!util::pb::read_variant_64(input_stream, &day)) break; +- DBG_INF_FMT("day =" MYSQLND_LLU_SPEC, day); ++ DBG_INF_FMT("day =" PRIu64, day); + if (!util::pb::read_variant_64(input_stream, &hours)) break; +- DBG_INF_FMT("hours =" MYSQLND_LLU_SPEC, hours); ++ DBG_INF_FMT("hours =" PRIu64, hours); + if (!util::pb::read_variant_64(input_stream, &minutes)) break; +- DBG_INF_FMT("mins =" MYSQLND_LLU_SPEC, minutes); ++ DBG_INF_FMT("mins =" PRIu64, minutes); + if (!util::pb::read_variant_64(input_stream, &seconds)) break; +- DBG_INF_FMT("secs =" MYSQLND_LLU_SPEC, seconds); ++ DBG_INF_FMT("secs =" PRIu64, seconds); + if (!util::pb::read_variant_64(input_stream, &useconds)) break; +- DBG_INF_FMT("usecs =" MYSQLND_LLU_SPEC, useconds); ++ DBG_INF_FMT("usecs =" PRIu64, useconds); + } while (0); + + auto str = util::formatter("%04u-%02u-%02u %02u:%02u:%02u") +@@ -1450,11 +1450,11 @@ enum_func_status xmysqlnd_row_date_field_to_zval( + } else { + do { + if (!util::pb::read_variant_64(input_stream, &year)) break; +- DBG_INF_FMT("year =" MYSQLND_LLU_SPEC, year); ++ DBG_INF_FMT("year =" PRIu64, year); + if (!util::pb::read_variant_64(input_stream, &month)) break; +- DBG_INF_FMT("month =" MYSQLND_LLU_SPEC, month); ++ DBG_INF_FMT("month =" PRIu64, month); + if (!util::pb::read_variant_64(input_stream, &day)) break; +- DBG_INF_FMT("day =" MYSQLND_LLU_SPEC, day); ++ DBG_INF_FMT("day =" PRIu64, day); + } while (0); + + auto str = util::formatter("%04u-%02u-%02u") +diff --git a/xmysqlnd/xmysqlnd_zval2any.cc b/xmysqlnd/xmysqlnd_zval2any.cc +index 79a68450..0c8ad118 100644 +--- a/xmysqlnd/xmysqlnd_zval2any.cc ++++ b/xmysqlnd/xmysqlnd_zval2any.cc +@@ -382,10 +382,10 @@ scalar2string(const Mysqlx::Datatypes::Scalar & scalar) + DBG_INF_FMT("subtype=%s", Scalar::Type_Name(scalar.type()).c_str()); + switch (scalar.type()) { + case Scalar_Type_V_SINT: +- ret.l = mnd_sprintf(&ret.s, 0, MYSQLND_LLU_SPEC, scalar.v_signed_int()); ++ ret.l = mnd_sprintf(&ret.s, 0, PRIu64, scalar.v_signed_int()); + break; + case Scalar_Type_V_UINT: +- ret.l = mnd_sprintf(&ret.s, 0, MYSQLND_LLU_SPEC, scalar.v_unsigned_int()); ++ ret.l = mnd_sprintf(&ret.s, 0, PRIu64, scalar.v_unsigned_int()); + break; + case Scalar_Type_V_NULL: + break; +@@ -434,7 +434,7 @@ scalar2log(const Mysqlx::Datatypes::Scalar & scalar) + } else + #endif + { +- DBG_INF_FMT("value=" MYSQLND_LLU_SPEC, scalar.v_signed_int()); ++ DBG_INF_FMT("value=" PRIu64, scalar.v_signed_int()); + } + break; + case Scalar_Type_V_UINT: +@@ -447,7 +447,7 @@ scalar2log(const Mysqlx::Datatypes::Scalar & scalar) + snprintf(tmp, sizeof(tmp), "%s", util::to_string(scalar.v_unsigned_int()).c_str()); + DBG_INF_FMT("value=%s", tmp); + } else { +- DBG_INF_FMT("value=" MYSQLND_LLU_SPEC, scalar.v_unsigned_int()); ++ DBG_INF_FMT("value=" PRIu64, scalar.v_unsigned_int()); + } + break; + case Scalar_Type_V_NULL: diff --git a/php-pecl-mysql-xdevapi.spec b/php-pecl-mysql-xdevapi.spec index 0269670..8e12477 100644 --- a/php-pecl-mysql-xdevapi.spec +++ b/php-pecl-mysql-xdevapi.spec @@ -25,12 +25,15 @@ Summary: MySQL database access functions Name: %{?sub_prefix}php-pecl-mysql-xdevapi Version: 8.0.16 -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: PHP URL: http://pecl.php.net/package/%{pecl_name} Source0: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz +Patch0: https://patch-diff.githubusercontent.com/raw/php/pecl-database-mysql_xdevapi/pull/6.patch +Patch1: https://patch-diff.githubusercontent.com/raw/php/pecl-database-mysql_xdevapi/pull/7.patch + BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?dtsprefix}gcc-c++ BuildRequires: %{?scl_prefix}php-devel > 7.1 @@ -73,10 +76,14 @@ Obsoletes: php71w-pecl-%{pecl_name} <= %{version} Obsoletes: php72u-pecl-%{pecl_name} <= %{version} Obsoletes: php72w-pecl-%{pecl_name} <= %{version} %endif -%if "%{php_version}" > "7.2" -Obsoletes: php73u-pecl-%{pecl_name} <= %{version} +%if "%{php_version}" > "7.3" +Obsoletes: php73-pecl-%{pecl_name} <= %{version} Obsoletes: php73w-pecl-%{pecl_name} <= %{version} %endif +%if "%{php_version}" > "7.4" +Obsoletes: php74-pecl-%{pecl_name} <= %{version} +Obsoletes: php74w-pecl-%{pecl_name} <= %{version} +%endif %endif %if 0%{?fedora} < 20 && 0%{?rhel} < 7 @@ -125,6 +132,9 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS +%patch0 -p1 -b .pr6 +%patch1 -p1 -b .pr7 + # Check version as upstream often forget to update this extver=$(sed -n '/#define PHP_MYSQL_XDEVAPI_VERSION/{s/.* "//;s/".*$//;p}' php_mysql_xdevapi.h) if test "x${extver}" != "x%{version}%{?prever}%{?gh_date:-dev}"; then @@ -312,6 +322,11 @@ fi %changelog +* Tue Jul 9 2019 Remi Collet <remi@remirepo.net> - 8.0.16-2 +- add patch for PHP 7.4 from + https://github.com/php/pecl-database-mysql_xdevapi/pull/6 + https://github.com/php/pecl-database-mysql_xdevapi/pull/7 + * Thu Apr 25 2019 Remi Collet <remi@remirepo.net> - 8.0.16-1 - update to 8.0.16 |