From 21a91a2b9773ef266308c1f986a5c26d7ccf2c33 Mon Sep 17 00:00:00 2001 From: Nuno Carvalho Date: Fri, 6 Jun 2025 15:17:18 +0200 Subject: [PATCH 1/9] BUG#37829550: WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS validations Improve WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS validations. Change-Id: I1860ede80acce348896738dd9fdc6565e9b3ac03 --- sql/item_func.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/item_func.cc b/sql/item_func.cc index c8a0417d3ecb..d61268ec4967 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -5108,7 +5108,7 @@ longlong Item_master_gtid_set_wait::val_int() null_value= 1; DBUG_RETURN(0); } - mi= channel_map.get_mi(channel_str->ptr()); + mi= channel_map.get_mi(channel_str->c_ptr_safe()); } else { From c4cbcd60345a00a4d72907f119336a13b844721e Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Wed, 4 Jun 2025 11:45:38 +0200 Subject: [PATCH 2/9] Bug#38027636 Add support for cmake 4 [MySQL 5.7] This patch is for 5.7, which is EOL, but we would still like to be able to build it, to compare features/results in 5.7 vs newer releases. The patch disables features/policies which are no longer supported in cmake 4.0. In particular we disable embedded server, which depends on unsupported cmake policies. Change-Id: I3b0d13ab66f81529e607e712840a2df65dca2403 --- CMakeLists.txt | 25 ++++++++++++++----- cmake/build_configurations/feature_set.cmake | 8 ++++-- .../libevent-2.1.11-stable/CMakeLists.txt | 2 +- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a3bf5f801764..dc09fc26bffe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,30 +24,38 @@ IF(WIN32) # CMake 2.8.12 is needed for Visual Studio 2013 # CMake 3.1.0 is needed for $ - CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) + # We add ...3.10 to keep cmake 4 happy. + CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0...3.10) ELSE() # There's a bug in unzipping prior to 2.8.2 # Debian 7 has the oldest cmake we need to support - CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9) + # We add ...3.10 to keep cmake 4 happy. + CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9...3.10) ENDIF() # We use CMAKE_SHARED_LIBRARY__FLAGS. See cmake --help-policy CMP0018 IF(CMAKE_VERSION VERSION_GREATER "2.8.8") - CMAKE_POLICY(SET CMP0018 OLD) + IF(CMAKE_VERSION VERSION_LESS "4") + CMAKE_POLICY(SET CMP0018 OLD) + ENDIF() ENDIF() # We use PROPERTIES LINK_INTERFACE_LIBRARIES. See cmake --help-policy CMP0022 IF(CMAKE_VERSION VERSION_EQUAL "2.8.12" OR CMAKE_VERSION VERSION_GREATER "2.8.12") - CMAKE_POLICY(SET CMP0022 OLD) + IF(CMAKE_VERSION VERSION_LESS "4") + CMAKE_POLICY(SET CMP0022 OLD) + ENDIF() ENDIF() # We use get_target_property() for non-existent targets (CMP0045) # and INSTALL_NAME_DIR (CMP0042) IF(CMAKE_VERSION VERSION_EQUAL "3.0.0" OR CMAKE_VERSION VERSION_GREATER "3.0.0") - CMAKE_POLICY(SET CMP0045 OLD) - CMAKE_POLICY(SET CMP0042 OLD) + IF(CMAKE_VERSION VERSION_LESS "4") + CMAKE_POLICY(SET CMP0045 OLD) + CMAKE_POLICY(SET CMP0042 OLD) + ENDIF() ENDIF() # In CMake 3.12 and above, the @@ -63,6 +71,11 @@ IF(POLICY CMP0075) CMAKE_POLICY(SET CMP0075 OLD) ENDIF() +# The exec_program command should not be called +IF(POLICY CMP0153) + CMAKE_POLICY(SET CMP0153 OLD) +ENDIF() + MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}") # Will set GIT_EXECUTABLE and GIT_FOUND diff --git a/cmake/build_configurations/feature_set.cmake b/cmake/build_configurations/feature_set.cmake index 76f2ac81200a..05c1b76771af 100644 --- a/cmake/build_configurations/feature_set.cmake +++ b/cmake/build_configurations/feature_set.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2012, 2023, Oracle and/or its affiliates. +# Copyright (c) 2012, 2025, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2.0, @@ -26,7 +26,11 @@ SET(FEATURE_SET "community" CACHE STRING ) IF(FEATURE_SET AND NOT WITHOUT_SERVER) - SET(WITH_EMBEDDED_SERVER ON CACHE BOOL "") + # embedded server cannot be built, + # MERGE_CONVENIENCE_LIBRARIES depends on unsupported policies + IF(CMAKE_VERSION VERSION_LESS "4") + SET(WITH_EMBEDDED_SERVER ON CACHE BOOL "") + ENDIF() # Set these ON by default. They can be disabled with # -DWITHOUT_${eng}_STORAGE_ENGINE diff --git a/extra/libevent/libevent-2.1.11-stable/CMakeLists.txt b/extra/libevent/libevent-2.1.11-stable/CMakeLists.txt index d93b84ed8f67..af10f9199eb0 100644 --- a/extra/libevent/libevent-2.1.11-stable/CMakeLists.txt +++ b/extra/libevent/libevent-2.1.11-stable/CMakeLists.txt @@ -19,7 +19,7 @@ # start libevent.sln # -cmake_minimum_required(VERSION 2.8.12.2 FATAL_ERROR) +# cmake_minimum_required(VERSION 2.8.12.2 FATAL_ERROR) if (POLICY CMP0054) cmake_policy(SET CMP0054 NEW) From 48a0edd1bdbf08a199d99671530f80954c7aec90 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Thu, 5 Jun 2025 14:14:00 +0200 Subject: [PATCH 3/9] Bug #30562248 ADD SUPPORT FOR GCC AND CLANG ON SOLARIS Manual backport to 5.7 of parts of the original patch (which was pushed to 8.0.20) Change-Id: Iefbbe5c22676559b05323ff9fdfac13da35fc035 --- rapid/plugin/group_replication/CMakeLists.txt | 10 +++++++++- storage/innobase/CMakeLists.txt | 12 +++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/rapid/plugin/group_replication/CMakeLists.txt b/rapid/plugin/group_replication/CMakeLists.txt index 2d37deaac300..963f8b25a765 100644 --- a/rapid/plugin/group_replication/CMakeLists.txt +++ b/rapid/plugin/group_replication/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2014, 2023, Oracle and/or its affiliates. +# Copyright (c) 2014, 2025, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2.0, @@ -214,6 +214,14 @@ ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR "-Wno-unused-variable -Wno-unused-function -Wno-conversion -Wno-switch") ENDIF() +IF(SOLARIS AND MY_COMPILER_IS_GNU) + # rpcgen generates 'void bzero();' + ADD_COMPILE_FLAGS(${XCOM_RPCGEN_SOURCES} + COMPILE_FLAGS + "-Wno-builtin-declaration-mismatch" + ) +ENDIF() + IF (WIN32) SET(LIBRARIES_TO_LINK ${LZ4_LIBRARY} ${SSL_LIBRARIES} ${TIRPC_LIBRARIES} crypt32) ELSE() diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index 1db5e37779c5..b97bf03b9572 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2023, Oracle and/or its affiliates. +# Copyright (c) 2006, 2025, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2.0, @@ -194,6 +194,16 @@ IF(MY_COMPILER_IS_GNU AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11) COMPILE_FLAGS "-Wno-free-nonheap-object") ENDIF() +# On linux: /usr/include/stdio.h:#define BUFSIZ 8192 +# On Solaris: /usr/include/iso/stdio_iso.h:#define BUFSIZ 1024 +IF(SOLARIS AND MY_COMPILER_IS_GNU) + ADD_COMPILE_FLAGS( + row/row0import.cc + row/row0quiesce.cc + COMPILE_FLAGS "-Wno-format-truncation" + ) +ENDIF() + MY_CHECK_CXX_COMPILER_FLAG("-Wcast-function-type" HAVE_CAST_FUNCTION_TYPE) IF(HAVE_CAST_FUNCTION_TYPE) ADD_COMPILE_FLAGS(fts/fts0pars.cc From b8a031da151119cfffc51769a306d29d789f0c13 Mon Sep 17 00:00:00 2001 From: Frazer Clement Date: Wed, 11 Jun 2025 12:34:52 +0100 Subject: [PATCH 4/9] Bug#37994985 All data nodes experienced a simultaneous restart following upgrade Backport to 7.6 Problem - Data node failure can result in cases where TC has no scan state, but NdbApi experiences protocol timeout. - NdbApi protocol timeout handling issues SCAN_NEXTREQ(Close) (As a result of work in Bug 37022901 Improve NdbApi Table and OI scan protocol timeout handling) - TC objects to protocol state misalignment and causes data node failure Solution - Extend work of Bug 37022901 to cover the general case of SCAN_NEXTREQ encountering an unexpected state at TC in the same way : - Log - Disconnect errant requesting API - [Disconnect errant record owning API if different] This handles the situation with lower impact API disconnect/reconnect rather than data node failures - Handle the specific case of an unexpected SCAN_NEXTREQ(Close) when the scan is already stateless in a lower impact way - Log - CONFirm the close Effects - Data node failures avoided - In this specific case, API disconnects avoided. Testing MTR test ndb_scan_protocol_timeout is extended to give coverage of this scenario. Details - Direct communication from node 1 to API blocked - Transaction hinted to node2, scanning data on node 1 - Kernel side operations complete - API receives SCAN_TABCONF for complete data set (1 row from one stream) - API does not receive TRANSID_AI for row - Data node 1 restarted - No particular NF handling - API times out - API sends scan close as part of handling timeout - Transaction ids validate, but scan record state is wrong - TC hits require failure. Further work - Avoiding protocol timeouts : Bug 38010209 Data node failure can lead to Read/Scan API timeouts Change-Id: Ide0df32dffc11a971683f818b0877beda393382b --- .../ndb/include/get_ndb_connection_id.inc | 20 +++ .../ndb/r/ndb_scan_protocol_timeout.result | 20 +++ .../ndb/t/ndb_scan_protocol_timeout.test | 91 +++++++++++++ storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp | 3 +- .../ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 128 ++++++++++++++---- 5 files changed, 237 insertions(+), 25 deletions(-) create mode 100644 mysql-test/suite/ndb/include/get_ndb_connection_id.inc diff --git a/mysql-test/suite/ndb/include/get_ndb_connection_id.inc b/mysql-test/suite/ndb/include/get_ndb_connection_id.inc new file mode 100644 index 000000000000..e61a1c4cd46d --- /dev/null +++ b/mysql-test/suite/ndb/include/get_ndb_connection_id.inc @@ -0,0 +1,20 @@ +# +# get_ndb_connection_id.inc - get API node id used by this session +# +# Usage +# --source suite/ndb/include/get_ndb_connection_id.inc +# +# $ndb_connection_id will be set to node id of current +# session's API connection + +--disable_query_log +--disable_result_log +create table get_ndb_connection_id(a int primary key) engine=ndb; +begin; +insert into get_ndb_connection_id values (1); + +let $ndb_connection_id = query_get_value(select client_node_id from ndbinfo.cluster_operations where tableid = (select id from ndbinfo.dict_obj_info where fq_name like '%get_ndb_connection_id%') limit 1, client_node_id, 1); +rollback; +drop table get_ndb_connection_id; +--enable_result_log +--enable_query_log diff --git a/mysql-test/suite/ndb/r/ndb_scan_protocol_timeout.result b/mysql-test/suite/ndb/r/ndb_scan_protocol_timeout.result index 72c905900a43..e388a1e91e38 100644 --- a/mysql-test/suite/ndb/r/ndb_scan_protocol_timeout.result +++ b/mysql-test/suite/ndb/r/ndb_scan_protocol_timeout.result @@ -509,3 +509,23 @@ ops 0 drop table test.t1; drop table test.t2; +set @save_debug = @@session.debug; +SET SESSION debug="+d,ndb_reduced_api_protocol_timeout"; +Determine our NdbApi connection id +Determine row ids used to control data nodes involved +Drop down to just the row on node 1 +Block send from node 1 to our API +Hint transaction to node 2 +a nodeid +Send select of all - will hang +Now cause restart of node 1 +Wait for data node to restart +Reap query - will get timeout error +ERROR HY000: Got error 4008 'Receive from NDB failed' from NDBCLUSTER +Issue more queries to check all is well +select * from test.t1; +select * from test.t1; +select * from test.t1; +Cleanup +drop table test.t1; +SET SESSION debug=@save_debug; diff --git a/mysql-test/suite/ndb/t/ndb_scan_protocol_timeout.test b/mysql-test/suite/ndb/t/ndb_scan_protocol_timeout.test index 599099acea54..78450348990c 100644 --- a/mysql-test/suite/ndb/t/ndb_scan_protocol_timeout.test +++ b/mysql-test/suite/ndb/t/ndb_scan_protocol_timeout.test @@ -639,3 +639,94 @@ select count(1) as ops from ndbinfo.cluster_operations; drop table test.t1; drop table test.t2; + + +# Cause reduced API timeout +set @save_debug = @@session.debug; +SET SESSION debug="+d,ndb_reduced_api_protocol_timeout"; + +--echo Determine our NdbApi connection id +--source suite/ndb/include/get_ndb_connection_id.inc +#--echo My cluster connection is $ndb_connection_id; + +--echo Determine row ids used to control data nodes involved + +# Put 100 rows into a table +--disable_query_log +--disable_result_log +--let $rows = 100 +create table test.t1 (a int primary key, nodeid int) engine=ndb comment="NDB_TABLE=READ_BACKUP=0"; + +while ($rows) +{ + --eval insert into test.t1 values ($rows, 0) + --dec $rows +} + +# Iterate over all rows, determining which data node holds +# the primary replica + storing that in the row's nodeid column +# +--let $rows = query_get_value('select count(1) as c from test.t1', c, 1) +while ($rows) +{ + begin; + --eval select * from test.t1 where a = $rows lock in share mode; + + let $nodeid = query_get_value(select node_id from ndbinfo.cluster_operations where tableid = (select id from ndbinfo.dict_obj_info where fq_name like '%t1%') limit 1, node_id, 1); + --eval update test.t1 set nodeid = $nodeid where a=$rows; + commit; + --dec $rows +} +--enable_result_log +--enable_query_log + +# Choose two semi-arbitrary key values, one on each data node + +let $node1_row_key = query_get_value('select a from test.t1 where nodeid=1 limit 1', a, 1); +let $node2_row_key = query_get_value('select a from test.t1 where nodeid=2 limit 1', a, 1); + +#--echo Node1 row : $node1_row_key +#--echo Node2 row : $node2_row_key + +--echo Drop down to just the row on node 1 +--disable_query_log +--eval delete from test.t1 where a != $node1_row_key +--enable_query_log + +--echo Block send from node 1 to our API + +--exec $NDB_MGM -e "1 DUMP 9988 $ndb_connection_id" >> $NDB_TOOLS_OUTPUT + +--echo Hint transaction to node 2 +--disable_query_log +begin; +--eval select * from test.t1 where a = $node2_row_key; + +--echo Send select of all - will hang +--send select * from test.t1; + +--echo Now cause restart of node 1 + +--exec $NDB_MGM -e "1 RESTART -a -f" >> $NDB_TOOLS_OUTPUT + +--echo Wait for data node to restart +--exec $NDB_WAITER > /dev/null + +--echo Reap query - will get timeout error +--error 1296 +--reap +--enable_query_log + +--echo Issue more queries to check all is well +--disable_result_log +select * from test.t1; +select * from test.t1; +select * from test.t1; +--enable_result_log + +--echo Cleanup + +drop table test.t1; + +SET SESSION debug=@save_debug; + diff --git a/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp b/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp index cc08823a6e93..1033c56d88ac 100644 --- a/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp +++ b/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp @@ -2133,8 +2133,6 @@ class Dbtc void checkScanActiveInFailedLqh(Signal* signal, Uint32 scanPtrI, Uint32 failedNodeId); - void checkScanFragList(Signal*, Uint32 failedNodeId, ScanRecord * scanP, - Local_ScanFragRec_dllist::Head&); void nodeFailCheckTransactions(Signal*,Uint32 transPtrI,Uint32 failedNodeId); void ndbdFailBlockCleanupCallback(Signal* signal, Uint32 failedNodeId, Uint32 ignoredRc); @@ -2599,6 +2597,7 @@ class Dbtc #ifndef DBTC_STATE_EXTRACT void dump_trans(ApiConnectRecordPtr transPtr); + void dump_scan_state(ApiConnectRecordPtr scanTransPtr); bool hasOp(ApiConnectRecordPtr transPtr, Uint32 op); #endif }; diff --git a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 905c45bbf109..3ff88f703753 100644 --- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -3031,6 +3031,71 @@ Dbtc::dump_trans(ApiConnectRecordPtr transPtr) } } +void Dbtc::dump_scan_state(ApiConnectRecordPtr scanTransPtr) { + jam(); + if (scanTransPtr.p->apiScanRec != RNIL) { + ScanRecordPtr scanRecPtr; + scanRecPtr.i = scanTransPtr.p->apiScanRec; + ptrCheckGuard(scanRecPtr, cscanrecFileSize, scanRecord); + + g_eventLogger->info( + "TC %u ACR %u scan record %u state %u noFrag %u booked %u " + "parallel %u table %u batch rows %u bytes %u block %x ri %x", + instance(), scanTransPtr.i, scanTransPtr.p->apiScanRec, + scanRecPtr.p->scanState, scanRecPtr.p->scanNoFrag, + scanRecPtr.p->m_booked_fragments_count, scanRecPtr.p->scanParallel, + scanRecPtr.p->scanTableref, scanRecPtr.p->first_batch_size_rows, + scanRecPtr.p->batch_byte_size, scanRecPtr.p->m_scan_block_no, + scanRecPtr.p->scanRequestInfo); + + { + ScanFragLocationPtr sflPtr; + Local_ScanFragLocation_list fragLocationRecs( + m_fragLocationPool, scanRecPtr.p->m_fragLocations); + for (fragLocationRecs.first(sflPtr); !sflPtr.isNull(); + fragLocationRecs.next(sflPtr)) { + g_eventLogger->info("TC %u Frag %u location %x", + instance(), sflPtr.p->fragId, sflPtr.p->blockRef); + } + } + + { + ScanFragRecPtr scanFragPtr; + Local_ScanFragRec_dllist running(c_scan_frag_pool, + scanRecPtr.p->m_running_scan_frags); + Local_ScanFragRec_dllist delivered(c_scan_frag_pool, + scanRecPtr.p->m_delivered_scan_frags); + Local_ScanFragRec_dllist queued(c_scan_frag_pool, + scanRecPtr.p->m_queued_scan_frags); + + for (running.first(scanFragPtr); !scanFragPtr.isNull(); + running.next(scanFragPtr)) { + g_eventLogger->info( + "TC %u Running scan frag %u state %u timer %u lqh %x conf %u", + instance(), scanFragPtr.i, scanFragPtr.p->scanFragState, + scanFragPtr.p->scanFragTimer, scanFragPtr.p->lqhBlockref, + scanFragPtr.p->m_scan_frag_conf_status); + } + for (delivered.first(scanFragPtr); !scanFragPtr.isNull(); + delivered.next(scanFragPtr)) { + g_eventLogger->info( + "TC %u Delivered scan frag %u state %u timer %u lqh %x conf %u", + instance(), scanFragPtr.i, scanFragPtr.p->scanFragState, + scanFragPtr.p->scanFragTimer, scanFragPtr.p->lqhBlockref, + scanFragPtr.p->m_scan_frag_conf_status); + } + for (queued.first(scanFragPtr); !scanFragPtr.isNull(); + queued.next(scanFragPtr)) { + g_eventLogger->info( + "TC %u Queued scan frag %u state %u timer %u lqh %x conf %u", + instance(), scanFragPtr.i, scanFragPtr.p->scanFragState, + scanFragPtr.p->scanFragTimer, scanFragPtr.p->lqhBlockref, + scanFragPtr.p->m_scan_frag_conf_status); + } + } + } +} + bool Dbtc::hasOp(ApiConnectRecordPtr transPtr, Uint32 opPtrI) { @@ -10594,15 +10659,6 @@ Dbtc::apiFailBlockCleanupCallback(Signal* signal, sendSignal(capiFailRef, GSN_API_FAILCONF, signal, 2, JBB); } -void -Dbtc::checkScanFragList(Signal* signal, - Uint32 failedNodeId, - ScanRecord * scanP, - Local_ScanFragRec_dllist::Head & head){ - - DEBUG("checkScanActiveInFailedLqh: scanFragError"); -} - void Dbtc::execTAKE_OVERTCCONF(Signal* signal) { jamEntry(); @@ -14461,22 +14517,48 @@ void Dbtc::execSCAN_NEXTREQ(Signal* signal) if (apiConnectptr.p->apiConnectstate != CS_START_SCAN) { jam(); releaseSections(handle); - if (apiConnectptr.p->apiConnectstate == CS_CONNECTED) { - jam(); - /********************************************************************* - * The application sends a SCAN_NEXTREQ after experiencing a time-out. - * We will send a SCAN_TABREF to indicate a time-out occurred. - *********************************************************************/ - DEBUG("scanTabRefLab: ZSCANTIME_OUT_ERROR2"); - ndbout_c("apiConnectptr(%d) -> abort", apiConnectptr.i); - ndbrequire(false); //B2 indication of strange things going on - scanTabRefLab(signal, ZSCANTIME_OUT_ERROR2); + g_eventLogger->warning( + "TC %u : SCAN_NEXTREQ(stop=%u) from node %u to ACR %u " + "finds unexpected ACR state %u", + instance(), stopScan, refToNode(signal->senderBlockRef()), + apiConnectptr.i, apiConnectptr.p->apiConnectstate); + if (apiConnectptr.p->apiConnectstate != CS_DISCONNECTED) { + jam(); + g_eventLogger->warning("TC %u : ACR seized by node %u, scanRec %u", + instance(), + refToNode(apiConnectptr.p->ndbapiBlockref), + apiConnectptr.p->apiScanRec); + if (apiConnectptr.p->apiScanRec != RNIL) { + jam(); + /* Dump scan state */ + dump_scan_state(apiConnectptr); + } + } + + if (apiConnectptr.p->apiConnectstate == CS_CONNECTED && + apiConnectptr.p->ndbapiBlockref == signal->senderBlockRef() && + stopScan) { + jam(); + + g_eventLogger->warning("TC %u : Confirming scan close", instance()); + + /* Case where client owns ApiConnectRecord, sent close and it is already + * closed. + * Acknowledge close as this is not a state problem from our pov. + */ + ScanTabConf *conf = (ScanTabConf *)&signal->theData[0]; + conf->apiConnectPtr = apiConnectptr.p->ndbapiConnect; + conf->requestInfo = ScanTabConf::EndOfData; + conf->transId1 = apiConnectptr.p->transid[0]; + conf->transId2 = apiConnectptr.p->transid[1]; + sendSignal(signal->senderBlockRef(), GSN_SCAN_TABCONF, signal, + ScanTabConf::SignalLength, JBB); return; } - DEBUG("scanTabRefLab: ZSTATE_ERROR"); - DEBUG(" apiConnectstate="<apiConnectstate); - ndbrequire(false); //B2 indication of strange things going on - scanTabRefLab(signal, ZSTATE_ERROR); + + /* Disconnect sender, and record owner, if different */ + handleSignalStateProblem(signal, apiConnectptr, + refToNode(signal->senderBlockRef()), 4); return; }//if From 5fb4b80151cf5645767e274427d44a1b4b52cc64 Mon Sep 17 00:00:00 2001 From: Justin Jose Date: Thu, 27 Feb 2025 08:44:14 +0530 Subject: [PATCH 5/9] Bug#37117875 Binlog record error when delimiter is set to other symbols Description: ------------ When the delimiter is set to a non-default symbol and the SQL statement contains an unquoted semicolon (;) within a MySQL-specific comment, the SQL executes successfully in the source database. However, the binlog record becomes incomplete, leading to a syntax error in the replica database. Analysis: ------------ When the delimiter is set to a non-default symbol and an SQL statement contains an unquoted semicolon within a MySQL-specific comment, the client transmits the entire SQL statement, including the MySQL-specific comment, up to the delimiter to the server. During parsing, the server interprets the semicolon as the end of the command while processing the comment, resulting in the execution of a partial statement. The truncated statement is then recorded in the binary log and propagated to the replica, leading to an error. Fix: ------------ When the delimiter is set to a non-default symbol, treat MySQL-specific comments containing unquoted semicolons as syntax errors and return a parser error. Change-Id: I00d6b4ced89e79a7350c94218bf2527553054aed --- sql/sql_lex.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index b8000f4e7266..19c41d777953 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2023, Oracle and/or its affiliates. + Copyright (c) 2000, 2025, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -2053,6 +2053,8 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd) state=MY_LEX_CHAR; break; case MY_LEX_END: + /* Unclosed special comments result in a syntax error */ + if (lip->in_comment == DISCARD_COMMENT) return (ABORT_SYM); lip->next_state=MY_LEX_END; return(0); // We found end of input last time From 83142cad68d040668e0244f4d2cbef4e1c7e8e49 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Mon, 9 Jun 2025 10:52:43 +0200 Subject: [PATCH 6/9] Backport of WL#16949 to 5.7 Introduced a new --commands option to mysql (default: ON) to disable mysql client side commands in non-interactive mode. Change-Id: Ie3e1f059bc79e87dbdab8161d7d6455f216d1a0c --- client/client_priv.h | 3 +- client/mysql.cc | 30 +-- mysql-test/r/mysql_commands.result | 89 ++++++++ mysql-test/t/mysql_commands.test | 346 +++++++++++++++++++++++++++++ 4 files changed, 454 insertions(+), 14 deletions(-) create mode 100644 mysql-test/r/mysql_commands.result create mode 100644 mysql-test/t/mysql_commands.test diff --git a/client/client_priv.h b/client/client_priv.h index eb982bbb4a6b..4ac50aa6ea0a 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2001, 2023, Oracle and/or its affiliates. + Copyright (c) 2001, 2025, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -116,6 +116,7 @@ enum options_client OPT_TLS_VERSION, OPT_SSL_MODE, OPT_SKIP_MYSQL_SCHEMA, + OPT_MYSQL_COMMANDS, /* Add new option above this */ OPT_MAX_CLIENT_OPTION }; diff --git a/client/mysql.cc b/client/mysql.cc index 3018450ac193..5ffd77c830b3 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2024, Oracle and/or its affiliates. + Copyright (c) 2000, 2025, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -158,6 +158,7 @@ static char * opt_mysql_unix_port=0; static char *opt_bind_addr = NULL; static int connect_flag=CLIENT_INTERACTIVE; static my_bool opt_binary_mode= FALSE; +static bool opt_commands = true; static my_bool opt_connect_expired_password= FALSE; static char *current_host,*current_db,*current_user=0,*opt_password=0, *current_prompt=0, *delimiter_str= 0, @@ -1211,7 +1212,7 @@ inline int get_command_index(char cmd_char) static int delimiter_index= -1; static int charset_index= -1; -static bool real_binary_mode= FALSE; +static bool disable_commands = false; #ifdef _WIN32 BOOL windows_ctrl_handler(DWORD fdwCtrlType) @@ -1676,6 +1677,9 @@ static struct my_option my_long_options[] = {"column-type-info", OPT_COLUMN_TYPES, "Display column type information.", &column_types_flag, &column_types_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"commands", OPT_MYSQL_COMMANDS, + "Enable or disable processing of local mysql commands.", &opt_commands, + &opt_commands, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"comments", 'c', "Preserve comments. Send comments to the server." " The default is --skip-comments (discard comments), enable with --comments.", &preserve_comments, &preserve_comments, @@ -2224,7 +2228,7 @@ static int read_and_execute(bool interactive) size_t line_length= 0; status.exit_status=1; - real_binary_mode= !interactive && opt_binary_mode; + disable_commands = !interactive && (opt_binary_mode || !opt_commands); for (;;) { /* Reset as SIGINT has already got handled. */ @@ -2237,7 +2241,7 @@ static int read_and_execute(bool interactive) In that case, we need to double check that we have a valid line before actually setting line_length to read_length. */ - line= batch_readline(status.line_buff, real_binary_mode); + line = batch_readline(status.line_buff, opt_binary_mode); if (line) { line_length= status.line_buff->read_length; @@ -2246,7 +2250,7 @@ static int read_and_execute(bool interactive) ASCII 0x00 is not allowed appearing in queries if it is not in binary mode. */ - if (!real_binary_mode && strlen(line) != line_length) + if (!opt_binary_mode && strlen(line) != line_length) { status.exit_status= 1; String msg; @@ -2398,11 +2402,11 @@ static int read_and_execute(bool interactive) #endif /* - If the function is called by 'source' command, it will return to interactive - mode, so real_binary_mode should be FALSE. Otherwise, it will exit the - program, it is safe to set real_binary_mode to FALSE. + If the function is called by 'source' command, it will return to + interactive mode, so disable_commands should be false. Otherwise, it will + exit the program, it is safe to set disable_commands to false. */ - real_binary_mode= FALSE; + disable_commands = false; return status.exit_status; } @@ -2434,10 +2438,10 @@ static COMMANDS *find_command(char cmd_char) int index= -1; /* - In binary-mode, we disallow all mysql commands except '\C' + If specified, we disallow all mysql commands except '\C' and DELIMITER. */ - if (real_binary_mode) + if (disable_commands) { if (cmd_char == 'C') index= charset_index; @@ -2479,7 +2483,7 @@ static COMMANDS *find_command(char *name) this is not a delimiter command, let add_line() take care of parsing the row and calling find_command(). */ - if ((!real_binary_mode && strstr(name, "\\g")) || + if ((!disable_commands && strstr(name, "\\g")) || (strstr(name, delimiter) && !is_delimiter_command(name, DELIMITER_NAME_LEN))) DBUG_RETURN((COMMANDS *) 0); @@ -2496,7 +2500,7 @@ static COMMANDS *find_command(char *name) len= (uint) strlen(name); int index= -1; - if (real_binary_mode) + if (disable_commands) { if (is_delimiter_command(name, len)) index= delimiter_index; diff --git a/mysql-test/r/mysql_commands.result b/mysql-test/r/mysql_commands.result new file mode 100644 index 000000000000..1f6e12b08bee --- /dev/null +++ b/mysql-test/r/mysql_commands.result @@ -0,0 +1,89 @@ +# +# WL#16949: A mysql command line option to disable all built-in commands +# +# FR1: --commands boolean option added +1 +1 +2 +2 +3 +3 +4 +4 +5 +5 +6 +6 +# FR1.1: check the default value of --commands +# test: must not fail +include/assert_grep.inc [FR1.1: checking the default --commands value] +include/assert_grep.inc [FR1.1: checking the updated --commands value] +# FR1.2.1: help short disabled +ERROR at line 1: Unknown command '\?'. +# FR1.2.2: clear disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'clear' at line 1 +# FR1.2.3: connect disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'connect' at line 1 +# FR1.2.4: delimier enabled +# FR1.2.5: edit disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'edit' at line 1 +# FR1.2.6: ego disabled +ERROR at line 1: Unknown command '\G'. +# FR1.2.7: exit disabled +ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exit' at line 1 +1 +1 +# FR1.2.8: \g disabled +ERROR at line 1: Unknown command '\g'. +# FR1.2.9: help disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +# FR1.2.10: nopager disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'nopager' at line 1 +# FR1.2.11: notee disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'notee' at line 1 +# FR1.2.12: pager disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'pager more' at line 1 +# FR1.2.13: print disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'print' at line 1 +# FR1.2.14: prompt disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'prompt foo' at line 1 +# FR1.2.15: quit disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'quit' at line 1 +# FR1.2.16: rehash disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rehash' at line 1 +# FR1.2.17: source disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'source gogo.text' at line 1 +# FR1.2.18: status disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'status' at line 1 +# FR1.2.19: system disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'system echo' at line 1 +# FR1.2.20: tee disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tee foo' at line 1 +# FR1.2.21: use disabled +ERROR at line 1: Unknown command '\u'. +# FR1.2.22: charset disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'charset latin1' at line 1 +# FR1.2.22.1: \c enabled +# FR1.2.23: warnings disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'warnings' at line 1 +# FR1.2.24: nowarning disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'nowarning' at line 1 +# FR1.2.25: resetconnection disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'resetconnection' at line 1 +# FR1.2.26: query_attributes disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_attributes a b' at line 1 +# FR1.2.27: ssl_session_data_print disabled +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl_session_data_print foo' at line 1 +# FR1.4: resetconnection enabled when commands is ON +# FR1.6: commands in .cnf files work +include/assert_grep.inc [FR1.1: the --commands value must be true] +# FR1.7: --binary-mode=1 overrides --commands +# must fail with a syntax error +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'system echo foo' at line 1 +trying in reverse +# must fail with a syntax error +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'system echo foo' at line 1 +# FR1.8: --binary-mode=0 enables --commands +# must fail with a syntax error +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'system echo foo' at line 1 +# End of tests diff --git a/mysql-test/t/mysql_commands.test b/mysql-test/t/mysql_commands.test new file mode 100644 index 000000000000..8c9d29323939 --- /dev/null +++ b/mysql-test/t/mysql_commands.test @@ -0,0 +1,346 @@ +# Can't test with embedded server +-- source include/not_embedded.inc + +--echo # +--echo # WL#16949: A mysql command line option to disable all built-in commands +--echo # + +--echo # FR1: --commands boolean option added +--exec $MYSQL --commands -e "SELECT 1" +--exec $MYSQL --disable-commands -e "SELECT 2" +--exec $MYSQL --skip-commands -e "SELECT 3" +--exec $MYSQL --enable-commands -e "SELECT 4" +--exec $MYSQL --commands=0 -e "SELECT 5" +--exec $MYSQL --commands=1 -e "SELECT 6" + +--echo # FR1.1: check the default value of --commands + +--write_file $MYSQLTEST_VARDIR/tmp/wl16949_fr1.sql +help; +EOF +--echo # test: must not fail +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/wl16949_fr1.sql > $MYSQLTEST_VARDIR/tmp/wl16949_fr1.out 2>&1 +--remove_file $MYSQLTEST_VARDIR/tmp/wl16949_fr1.sql +--remove_file $MYSQLTEST_VARDIR/tmp/wl16949_fr1.out + +--exec $MYSQL --help > $MYSQLTEST_VARDIR/tmp/wl16949_fr1_1.out 2>&1 +--let $assert_text=FR1.1: checking the default --commands value +--let $assert_file=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_1.out +--let $assert_select=^commands[\\ \\t]*TRUE\$ +--let $assert_count=1 +--source include/assert_grep.inc +--remove_file $MYSQLTEST_VARDIR/tmp/wl16949_fr1_1.out + +--exec $MYSQL --commands=0 --help > $MYSQLTEST_VARDIR/tmp/wl16949_fr1_1.out 2>&1 +--let $assert_text=FR1.1: checking the updated --commands value +--let $assert_file=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_1.out +--let $assert_select=^commands[\\ \\t]*FALSE\$ +--let $assert_count=1 +--source include/assert_grep.inc +--remove_file $MYSQLTEST_VARDIR/tmp/wl16949_fr1_1.out + +--echo # FR1.2.1: help short disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_help_short.sql +--write_file $filename +\? +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.2: clear disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_clear.sql +--write_file $filename +clear; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.3: connect disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_connect.sql +--write_file $filename +connect; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.4: delimier enabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_delimier.sql +--write_file $filename +delimiter ; +EOF +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.5: edit disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_edit.sql +--write_file $filename +edit; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.6: ego disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_ego.sql +--write_file $filename +SELECT 1\G +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.7: exit disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_exit.sql +--write_file $filename +SELECT 1; +exit; +SELECT 2; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.8: \g disabled +--error 1 +--exec $MYSQL --commands=0 -e "SELECT 1\g" 2>&1 + +--echo # FR1.2.9: help disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_help.sql +--write_file $filename +help; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.10: nopager disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_nopager.sql +--write_file $filename +nopager; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.11: notee disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_notee.sql +--write_file $filename +notee; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.12: pager disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_pager.sql +--write_file $filename +pager more; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.13: print disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_print.sql +--write_file $filename +print; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.14: prompt disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_prompt.sql +--write_file $filename +prompt foo; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.15: quit disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_quit.sql +--write_file $filename +quit; +SELECT 2; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.16: rehash disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_rehash.sql +--write_file $filename +rehash; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.17: source disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_source.sql +--write_file $filename +source gogo.text; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.18: status disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_status.sql +--write_file $filename +status; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.19: system disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_system.sql +--write_file $filename +system echo; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.20: tee disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_tee.sql +--write_file $filename +tee foo; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.21: use disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_use.sql +--write_file $filename +\u test; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.22: charset disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_charset.sql +--write_file $filename +charset latin1; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.22.1: \c enabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_uscore_c.sql +--write_file $filename +\C latin1; +EOF +--exec $MYSQL < $filename 2>$filename.2 +--remove_file $filename +--remove_file $filename.2 + + +--echo # FR1.2.23: warnings disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_warnings.sql +--write_file $filename +warnings; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.24: nowarning disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_nowarning.sql +--write_file $filename +nowarning; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.25: resetconnection disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_resetconnection.sql +--write_file $filename +resetconnection; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.26: query_attributes disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_query_attributes.sql +--write_file $filename +query_attributes a b; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.2.27: ssl_session_data_print disabled +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_2_ssl_session_data_print.sql +--write_file $filename +ssl_session_data_print foo; +EOF +--error 1 +--exec $MYSQL --commands=0 < $filename 2>&1 +--remove_file $filename + + +--echo # FR1.4: resetconnection enabled when commands is ON +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_4_resetconnection.sql +--write_file $filename +resetconnection; +EOF +--exec $MYSQL --commands=1 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.6: commands in .cnf files work +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_6.cnf +--write_file $filename +[mysql] +commands=1 +EOF +--exec $EXE_MYSQL --defaults-file=$filename --help > $filename.out 2>&1 +--let $assert_text=FR1.1: the --commands value must be true +--let $assert_file=$filename.out +--let $assert_select=^commands[\\ \\t]*TRUE\$ +--let $assert_count=1 +--source include/assert_grep.inc +--remove_file $filename.out +--remove_file $filename + +--echo # FR1.7: --binary-mode=1 overrides --commands +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_7.sql +--write_file $filename +system echo foo; +EOF +--echo # must fail with a syntax error +--error 1 +--exec $MYSQL --commands=1 --binary-mode=1 < $filename 2>&1 +--remove_file $filename + +--echo trying in reverse +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_7_reverse.sql +--write_file $filename +system echo foo; +EOF +--echo # must fail with a syntax error +--error 1 +--exec $MYSQL --binary-mode=1 --commands=1 < $filename 2>&1 +--remove_file $filename + +--echo # FR1.8: --binary-mode=0 enables --commands +--let $filename=$MYSQLTEST_VARDIR/tmp/wl16949_fr1_8.sql +--write_file $filename +system echo foo; +EOF +--echo # must fail with a syntax error +--error 1 +--exec $MYSQL --binary-mode=0 --commands=0 < $filename 2>&1 +--remove_file $filename + +--echo # End of tests From a897e38e4bfe5580af9c88a444a8d661c28d1540 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 17 Jun 2025 11:07:59 +0200 Subject: [PATCH 7/9] Raise version number before tagging 5.7.51 Approved-by: Erlend Dahl --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index f35a5cb7bcc9..2e47660beb32 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=7 -MYSQL_VERSION_PATCH=50 +MYSQL_VERSION_PATCH=51 MYSQL_VERSION_EXTRA= From 263c1cb56066333dbb45802dd4ddfa6e966cc2c7 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Wed, 18 Jun 2025 14:36:28 +0200 Subject: [PATCH 8/9] Update License Book Approved-by: Balasubramanian Kandasamy Change-Id: I538542e710b217ead2ca4e39cb5e01cae48f6537 --- LICENSE | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/LICENSE b/LICENSE index 4dd8fad63594..a47f7bdbbd3a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ Licensing Information User Manual -MySQL NDB Cluster 7.6.33 Community +MySQL NDB Cluster 7.6.34 Community __________________________________________________________________ Introduction @@ -8,18 +8,18 @@ Introduction This License Information User Manual contains Oracle's product license and other licensing information, including licensing information for third-party software which may be included in this distribution of - MySQL NDB Cluster 7.6.33 Community. + MySQL NDB Cluster 7.6.34 Community. - Last updated: March 2025 + Last updated: June 2025 Licensing Information - This release of MySQL NDB Cluster 7.6.33 Community is brought to you by + This release of MySQL NDB Cluster 7.6.34 Community is brought to you by the MySQL team at Oracle. This software is released under version 2 of the GNU General Public License (GPLv2), as set forth below, with the following additional permissions: - This distribution of MySQL NDB Cluster 7.6.33 Community is designed to + This distribution of MySQL NDB Cluster 7.6.34 Community is designed to work with certain software (including but not limited to OpenSSL) that is licensed under separate terms, as designated in a particular file or component or in the license documentation. Without limiting your rights From 7f900db6aeea2e1290751312899d699fc995c186 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Thu, 19 Jun 2025 12:10:25 +0200 Subject: [PATCH 9/9] Update version number in LICENSE to 7.6.35 Approved-by: Balasubramanian Kandasamy Change-Id: I9a838cbba47c500d23d26d4b962e96c775639537 (cherry picked from commit f0100d5395d160bea4274d4e43a1cdcc97c20f01) --- LICENSE | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LICENSE b/LICENSE index a47f7bdbbd3a..2a678e3c4c2f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ Licensing Information User Manual -MySQL NDB Cluster 7.6.34 Community +MySQL NDB Cluster 7.6.35 Community __________________________________________________________________ Introduction @@ -8,18 +8,18 @@ Introduction This License Information User Manual contains Oracle's product license and other licensing information, including licensing information for third-party software which may be included in this distribution of - MySQL NDB Cluster 7.6.34 Community. + MySQL NDB Cluster 7.6.35 Community. Last updated: June 2025 Licensing Information - This release of MySQL NDB Cluster 7.6.34 Community is brought to you by + This release of MySQL NDB Cluster 7.6.35 Community is brought to you by the MySQL team at Oracle. This software is released under version 2 of the GNU General Public License (GPLv2), as set forth below, with the following additional permissions: - This distribution of MySQL NDB Cluster 7.6.34 Community is designed to + This distribution of MySQL NDB Cluster 7.6.35 Community is designed to work with certain software (including but not limited to OpenSSL) that is licensed under separate terms, as designated in a particular file or component or in the license documentation. Without limiting your rights