Version in base suite: 9.3.4+dfsg1-2 Base version: tango_9.3.4+dfsg1-2 Target version: tango_9.3.4+dfsg1-2+deb12u1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/t/tango/tango_9.3.4+dfsg1-2.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/t/tango/tango_9.3.4+dfsg1-2+deb12u1.dsc changelog | 13 + dbconfig-common/data/tango-db/upgrade/mysql/9.3.4 | 12 + gitlab-ci.yml | 2 patches/0001-Fix-timestamp-columns-in-Mariadb-10.11-and-newer.patch | 94 ++++++++++ patches/series | 1 tests/control | 7 tests/starter-basic | 50 +++++ 7 files changed, 178 insertions(+), 1 deletion(-) diff -Nru tango-9.3.4+dfsg1/debian/changelog tango-9.3.4+dfsg1/debian/changelog --- tango-9.3.4+dfsg1/debian/changelog 2022-11-11 17:59:16.000000000 +0000 +++ tango-9.3.4+dfsg1/debian/changelog 2024-12-05 02:30:01.000000000 +0000 @@ -1,3 +1,16 @@ +tango (9.3.4+dfsg1-2+deb12u1) bookworm; urgency=medium + + * Team upload + * Make the property_* tables compatible with MariaDB 10.11 at install time. + Thanks to Thomas Braun. Also update table modifications accordingly in + dbconfig-common when upgrading from 9.3.4 (Closes: #1062979). + * Add d/tests/starter-basic, including a test for #1062979. + * Switch Salsa CI RELEASE variable from experimental to bookworm. Otherwise, + Salsa CI runs the pipeline on experimental, and it has to be manually + overriden. + + -- Santiago Ruano Rincón Wed, 04 Dec 2024 23:30:01 -0300 + tango (9.3.4+dfsg1-2) unstable; urgency=medium [ Picca Frédéric-Emmanuel ] diff -Nru tango-9.3.4+dfsg1/debian/dbconfig-common/data/tango-db/upgrade/mysql/9.3.4 tango-9.3.4+dfsg1/debian/dbconfig-common/data/tango-db/upgrade/mysql/9.3.4 --- tango-9.3.4+dfsg1/debian/dbconfig-common/data/tango-db/upgrade/mysql/9.3.4 2022-11-10 12:09:20.000000000 +0000 +++ tango-9.3.4+dfsg1/debian/dbconfig-common/data/tango-db/upgrade/mysql/9.3.4 2024-12-05 02:30:01.000000000 +0000 @@ -15,3 +15,15 @@ DELETE FROM property_class WHERE class='DServer' AND count >= 11; INSERT INTO property_class VALUES('DServer','AllowedAccessCmd',11,'EventConfirmSubscription',NOW(),NOW(),NULL); + +# +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1062979 +# + +ALTER TABLE property_hist MODIFY date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; +ALTER TABLE property_device_hist MODIFY date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; +ALTER TABLE property_class_hist MODIFY date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; +ALTER TABLE property_attribute_class_hist MODIFY date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; +ALTER TABLE property_attribute_device_hist MODIFY date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; +ALTER TABLE property_pipe_class_hist MODIFY date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; +ALTER TABLE property_pipe_device_hist MODIFY date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; diff -Nru tango-9.3.4+dfsg1/debian/gitlab-ci.yml tango-9.3.4+dfsg1/debian/gitlab-ci.yml --- tango-9.3.4+dfsg1/debian/gitlab-ci.yml 2022-11-10 12:09:20.000000000 +0000 +++ tango-9.3.4+dfsg1/debian/gitlab-ci.yml 2024-12-05 02:30:01.000000000 +0000 @@ -3,4 +3,4 @@ - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml variables: - RELEASE: 'experimental' + RELEASE: 'bookworm' diff -Nru tango-9.3.4+dfsg1/debian/patches/0001-Fix-timestamp-columns-in-Mariadb-10.11-and-newer.patch tango-9.3.4+dfsg1/debian/patches/0001-Fix-timestamp-columns-in-Mariadb-10.11-and-newer.patch --- tango-9.3.4+dfsg1/debian/patches/0001-Fix-timestamp-columns-in-Mariadb-10.11-and-newer.patch 1970-01-01 00:00:00.000000000 +0000 +++ tango-9.3.4+dfsg1/debian/patches/0001-Fix-timestamp-columns-in-Mariadb-10.11-and-newer.patch 2024-12-05 02:30:01.000000000 +0000 @@ -0,0 +1,94 @@ +From 8e1f9ec9b0b3346d65d20e791391bb3a9594a256 Mon Sep 17 00:00:00 2001 +From: Thomas Braun +Date: Sun, 27 Oct 2024 11:29:44 +0100 +Subject: [PATCH] Fix timestamp columns in Mariadb 10.11 and newer +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This problem appears in MariaDb 10.11 since default value of +explicit_defaults_for_timestamp changed from OFF to ON, setting it to +OFF (set global explicit_defaults_for_timestamp=OFF;) make the +create_db_tables.sql.in work properly. + +Initial patch by Santiago Ruano Rincón with refinements by Graziano +Scalamera. + +Upgrade script and tests by the author. + +Origin: backport, https://gitlab.com/tango-controls/TangoDatabase/-/merge_requests/95 +--- + configure/CMakeLists.txt | 1 + + create_db_tables.sql.in | 14 +++++++------- + test/test.cpp | 27 +++++++++++++++++++++++++++ + update_db_from_5.23_to_5.24.sql.in | 11 +++++++++++ + 4 files changed, 46 insertions(+), 7 deletions(-) + create mode 100644 update_db_from_5.23_to_5.24.sql.in + +Index: tango/cppserver/database/create_db_tables.sql.in +=================================================================== +--- tango.orig/cppserver/database/create_db_tables.sql.in ++++ tango/cppserver/database/create_db_tables.sql.in +@@ -256,7 +256,7 @@ CREATE TABLE IF NOT EXISTS object_histor + + CREATE TABLE IF NOT EXISTS property_hist ( + id bigint unsigned NOT NULL default '0', +- date timestamp NOT NULL, ++ date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + object varchar(255) NOT NULL default '', + name varchar(255) NOT NULL default '', + count int(11) NOT NULL default '0', +@@ -268,7 +268,7 @@ CREATE TABLE IF NOT EXISTS property_hist + + CREATE TABLE IF NOT EXISTS property_device_hist ( + id bigint unsigned NOT NULL default '0', +- date timestamp NOT NULL, ++ date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + device varchar(255) NOT NULL default '', + name varchar(255) NOT NULL default '', + count int(11) NOT NULL default '0', +@@ -280,7 +280,7 @@ CREATE TABLE IF NOT EXISTS property_devi + + CREATE TABLE IF NOT EXISTS property_class_hist ( + id bigint unsigned NOT NULL default '0', +- date timestamp NOT NULL, ++ date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + class varchar(255) NOT NULL default '', + name varchar(255) NOT NULL default '', + count int(11) NOT NULL default '0', +@@ -292,7 +292,7 @@ CREATE TABLE IF NOT EXISTS property_clas + + CREATE TABLE IF NOT EXISTS property_attribute_class_hist ( + id bigint unsigned NOT NULL default '0', +- date timestamp NOT NULL, ++ date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + class varchar(255) NOT NULL default '', + attribute varchar(255) NOT NULL default '', + name varchar(255) NOT NULL default '', +@@ -306,7 +306,7 @@ CREATE TABLE IF NOT EXISTS property_attr + + CREATE TABLE IF NOT EXISTS property_attribute_device_hist ( + id bigint unsigned NOT NULL default '0', +- date timestamp NOT NULL, ++ date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + device varchar(255) NOT NULL default '', + attribute varchar(255) NOT NULL default '', + name varchar(255) NOT NULL default '', +@@ -320,7 +320,7 @@ CREATE TABLE IF NOT EXISTS property_attr + + CREATE TABLE IF NOT EXISTS property_pipe_class_hist ( + id bigint unsigned NOT NULL default '0', +- date timestamp NOT NULL, ++ date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + class varchar(255) NOT NULL default '', + pipe varchar(255) NOT NULL default '', + name varchar(255) NOT NULL default '', +@@ -334,7 +334,7 @@ CREATE TABLE IF NOT EXISTS property_pipe + + CREATE TABLE IF NOT EXISTS property_pipe_device_hist ( + id bigint unsigned NOT NULL default '0', +- date timestamp NOT NULL, ++ date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + device varchar(255) NOT NULL default '', + pipe varchar(255) NOT NULL default '', + name varchar(255) NOT NULL default '', diff -Nru tango-9.3.4+dfsg1/debian/patches/series tango-9.3.4+dfsg1/debian/patches/series --- tango-9.3.4+dfsg1/debian/patches/series 2022-11-10 12:09:20.000000000 +0000 +++ tango-9.3.4+dfsg1/debian/patches/series 2024-12-05 02:30:01.000000000 +0000 @@ -1,3 +1,4 @@ 0001-debian-fix_database_scripts.patch 0002-debian-my.cnf.in.patch 0003-doc-not-install-doc-with-make-install.patch +0001-Fix-timestamp-columns-in-Mariadb-10.11-and-newer.patch diff -Nru tango-9.3.4+dfsg1/debian/tests/control tango-9.3.4+dfsg1/debian/tests/control --- tango-9.3.4+dfsg1/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ tango-9.3.4+dfsg1/debian/tests/control 2024-12-03 18:03:01.000000000 +0000 @@ -0,0 +1,7 @@ +Tests: + starter-basic, +Depends: + mariadb-server, + @, +Restrictions: + needs-root, diff -Nru tango-9.3.4+dfsg1/debian/tests/starter-basic tango-9.3.4+dfsg1/debian/tests/starter-basic --- tango-9.3.4+dfsg1/debian/tests/starter-basic 1970-01-01 00:00:00.000000000 +0000 +++ tango-9.3.4+dfsg1/debian/tests/starter-basic 2024-12-05 02:30:01.000000000 +0000 @@ -0,0 +1,50 @@ +#!/usr/bin/sh + +set -e + +. /etc/tangorc + +HOST=$(echo $TANGO_HOST | sed -e "s/:[[:digit:]]*//") + +pstree + +# These stops and starts seem to be needed, as a work around. +# The first time tango-starter starts, there is an ENOENT, even if the service +# seems active. +# +# See https://gitlab.com/tango-controls/starter/-/issues/25#note_1499130131 + +systemctl stop tango-starter +systemctl stop tango-accesscontrol +systemctl stop tango-db + +sleep 3 + +systemctl start tango-db + +sleep 5 + +systemctl start tango-accesscontrol + +sleep 5 + +systemctl restart tango-starter + +# Give *enough* time to Starter for being able to be ping'ed +sleep 10 + +pstree + +tango_admin --ping-device dserver/Starter/${HOST} + +# test https://bugs.debian.org/1062979: +# +tango_admin --add-property sys/tg_test/1 key value + +# check if the property was actually inserted in the related table: +# +mysql -u root -D tango --disable-column-names --silent \ + --execute "SELECT IFNULL( (SELECT device FROM property_device_hist \ + WHERE device = 'sys/tg_test/1' AND name = 'key' AND value = 'value' \ + LIMIT 1) ,'not found');" \ + | grep -v "not found"