Changeset:
4eadba1977a4
https://sourceforge.net/p/mrbs/hg-code/ci/4eadba1977a4a31136e102056135dc398142c966
Author:
Campbell Morrison <[email protected]>
Date:
Thu Oct 06 22:56:08 2016 +0100
Log message:
Fixed duplicate function declaration
diffstat:
web/upgrade/24/post.inc | 34 ++++++++--------------------------
web/upgrade/47/post.inc | 37 ++++++++-----------------------------
2 files changed, 16 insertions(+), 55 deletions(-)
diffs (200 lines):
diff -r 9636655a05bb -r 4eadba1977a4 web/upgrade/24/post.inc
--- a/web/upgrade/24/post.inc Thu Oct 06 17:39:22 2016 +0100
+++ b/web/upgrade/24/post.inc Thu Oct 06 22:56:08 2016 +0100
@@ -14,24 +14,6 @@
// as this upgrade procedure is only used once for existing entries).
-function do_sql_command($sql)
-{
- global $admin_handle;
- static $step = 0;
-
- $step++;
-
- try
- {
- $admin_handle->command($sql);
- }
- catch (DBException $e)
- {
- echo "<span class=\"error\">Step $step failed</span><br>";
- throw $e;
- }
-}
-
global $dbsys, $tbl_entry, $tbl_repeat, $admin_handle;
// There's the option here to display some timing information as this upgrade
@@ -59,14 +41,14 @@
SET ical_uid=CONCAT(CAST(id AS char), '-', UUID()),
timestamp=timestamp
WHERE ical_uid='' AND repeat_id=0";
- do_sql_command($sql);
+ $admin_handle->command($sql);
// Give everything in the repeat table, that doesn't already have one, an
ical uid
$sql = "UPDATE $tbl_repeat
SET ical_uid=CONCAT(CAST(id AS char), '-', UUID()),
timestamp=timestamp
WHERE ical_uid=''";
- do_sql_command($sql);
+ $admin_handle->command($sql);
// Now go through the entry table and give all entries, that don't have an
ical uid
// and are members of a series, the ical_uid from the corresponding uid from
the
@@ -77,7 +59,7 @@
R.timestamp=R.timestamp
WHERE E.ical_uid=''
AND E.repeat_id=R.id";
- do_sql_command($sql);
+ $admin_handle->command($sql);
// Finally give a recurrence id to any entry in the entry table that hasn't
got one
// and should have one - ie if it is a member of a series
@@ -86,7 +68,7 @@
timestamp=timestamp
WHERE repeat_id!=0
AND ical_recur_id=''";
- do_sql_command($sql);
+ $admin_handle->command($sql);
}
// PostgreSQL
@@ -120,13 +102,13 @@
SET ical_uid='MRBS-' || CAST(id AS varchar(255)) || '-' ||
CURRENT_DATE || CURRENT_TIME || '-' || SUBSTRING((MD5(name || CAST(RANDOM() AS
varchar(255)))) from 1 for 8) || '@$domain_name'
WHERE ical_uid=''
AND repeat_id=0";
- do_sql_command($sql);
+ $admin_handle->command($sql);
// Give everything in the repeat table, that doesn't already have one, an
ical uid
$sql = "UPDATE $tbl_repeat
SET ical_uid='MRBS-' || CAST(id AS varchar(255)) || '-' ||
CURRENT_DATE || CURRENT_TIME || '-' || SUBSTRING((MD5(name || CAST(RANDOM() AS
varchar(255)))) from 1 for 8) || '@$domain_name'
WHERE ical_uid=''";
- do_sql_command($sql);
+ $admin_handle->command($sql);
// Now go through the entry table and give all entries, that don't have an
ical uid
// and are members of a series, the ical_uid from the corresponding uid from
the
@@ -136,7 +118,7 @@
FROM $tbl_repeat AS R
WHERE $tbl_entry.ical_uid=''
AND $tbl_entry.repeat_id=R.id";
- do_sql_command($sql);
+ $admin_handle->command($sql);
// Finally give a recurrence id to any entry in the entry table that hasn't
got one
// and should have one - ie if it is a member of a series (The SQL is
slightly
@@ -145,7 +127,7 @@
SET ical_recur_id=TO_CHAR(TIMESTAMP 'epoch' + start_time *
INTERVAL '1 second', 'YYYYMMDD\"T\"HH24MISS\"Z\"')
WHERE repeat_id!=0
AND ical_recur_id=''";
- do_sql_command($sql);
+ $admin_handle->command($sql);
}
$stop_clock = get_microtime();
diff -r 9636655a05bb -r 4eadba1977a4 web/upgrade/47/post.inc
--- a/web/upgrade/47/post.inc Thu Oct 06 17:39:22 2016 +0100
+++ b/web/upgrade/47/post.inc Thu Oct 06 22:56:08 2016 +0100
@@ -17,27 +17,6 @@
// have the date. So I've taken the view here that it's not worth bothering
about
// as this upgrade procedure is only used once for existing entries).
-
-
-function do_sql_command($sql)
-{
- global $admin_handle;
-
- static $step = 0;
-
- $step++;
-
- try
- {
- $admin_handle->command($sql);
- }
- catch (DBException $e)
- {
- echo "<span class=\"error\">Step $step failed</span><br>";
- throw $e;
- }
-}
-
global $dbsys, $tbl_entry, $tbl_repeat, $admin_handle;
// There's the option here to display some timing information as this upgrade
@@ -66,7 +45,7 @@
SET ical_uid=CONCAT(CAST(id AS char), '-', UUID()),
timestamp=timestamp
WHERE ical_uid=''";
- do_sql_command($sql);
+ $admin_handle->command($sql);
// Now go through the entry table and give all entries, that don't have an
ical uid
// and are members of a series, the ical_uid from the corresponding uid from
the
@@ -77,7 +56,7 @@
R.timestamp=R.timestamp
WHERE E.ical_uid=''
AND E.repeat_id=R.id";
- do_sql_command($sql);
+ $admin_handle->command($sql);
// Finally give a recurrence id to any entry in the entry table that hasn't
got one
// and should have one - ie if it is a member of a series
@@ -86,7 +65,7 @@
timestamp=timestamp
WHERE repeat_id!=0
AND ical_recur_id=''";
- do_sql_command($sql);
+ $admin_handle->command($sql);
// Give all the individual entries, that haven't already got one, an ical uid
// (There shouldn't be any of these as the bug was only affecting repeats)
@@ -94,7 +73,7 @@
SET ical_uid=CONCAT(CAST(id AS char), '-', UUID()),
timestamp=timestamp
WHERE ical_uid='' AND repeat_id IS NULL";
- do_sql_command($sql);
+ $admin_handle->command($sql);
// Sequence numbers were being generated correctly under the bug, so we
don't need to worry about them
}
@@ -129,7 +108,7 @@
$sql = "UPDATE $tbl_repeat
SET ical_uid='MRBS-' || CAST(id AS varchar(255)) || '-' ||
CURRENT_DATE || CURRENT_TIME || '-' || SUBSTRING((MD5(name || CAST(RANDOM() AS
varchar(255)))) from 1 for 8) || '@$domain_name'
WHERE ical_uid=''";
- do_sql_command($sql);
+ $admin_handle->command($sql);
// Now go through the entry table and give all entries, that don't have an
ical uid
// and are members of a series, the ical_uid from the corresponding uid from
the
@@ -139,7 +118,7 @@
FROM $tbl_repeat AS R
WHERE E.ical_uid=''
AND E.repeat_id=R.id";
- do_sql_command($sql);
+ $admin_handle->command($sql);
// Finally give a recurrence id to any entry in the entry table that hasn't
got one
// and should have one - ie if it is a member of a series (The SQL is
slightly
@@ -148,7 +127,7 @@
SET ical_recur_id=TO_CHAR(TIMESTAMP 'epoch' + start_time *
INTERVAL '1 second', 'YYYYMMDD\"T\"HH24MISS\"Z\"')
WHERE repeat_id!=0
AND ical_recur_id=''";
- do_sql_command($sql);
+ $admin_handle->command($sql);
// Give all the individual entries, that haven't already got one, an ical uid
// (There shouldn't be any of these as the bug was only affecting repeats)
@@ -156,7 +135,7 @@
SET ical_uid='MRBS-' || CAST(id AS varchar(255)) || '-' ||
CURRENT_DATE || CURRENT_TIME || '-' || SUBSTRING((MD5(name || CAST(RANDOM() AS
varchar(255)))) from 1 for 8) || '@$domain_name'
WHERE ical_uid=''
AND repeat_id IS NULL";
- do_sql_command($sql);
+ $admin_handle->command($sql);
// Sequence numbers were being generated correctly under the bug, so we
don't need to worry about them
}
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits