From 9ef68dd176d10bebf92cd937f8b6115a9d40b0bf Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sun, 4 Feb 2018 13:40:19 +0100 Subject: bin/build-master-status: be more flexible when creating the temporary todos-table --- bin/build-master-status | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/build-master-status b/bin/build-master-status index 0e80bd6..d74ff8a 100755 --- a/bin/build-master-status +++ b/bin/build-master-status @@ -561,13 +561,13 @@ if ${web}; then # insert unfound todos # shellcheck disable=SC2016 { - printf 'CREATE TEMPORARY TABLE `td` (' - printf '`file` VARCHAR(64), ' - printf '`line` MEDIUMINT, ' - printf '`description` VARCHAR(128), ' - printf 'UNIQUE KEY `position` (`file`,`line`), ' - printf 'UNIQUE KEY `content` (`file`,`description`)' - printf ');' + printf 'SHOW CREATE TABLE `todos`' | \ + ${mysql_command} --raw --batch | \ + sed ' + 1d + 2s/^\S\+\s\+CREATE TABLE `todos` /CREATE TEMPORARY TABLE `td` / + ' + printf ';\n' printf 'INSERT INTO `td` (`file`,`line`,`description`) VALUES ' while read -r file line desc; do printf '(' -- cgit v1.2.3-54-g00ecf