summaryrefslogtreecommitdiff
path: root/sql-bench
diff options
context:
space:
mode:
authorunknown <walrus@mysql.com>2003-01-29 14:00:08 +0500
committerunknown <walrus@mysql.com>2003-01-29 14:00:08 +0500
commit7a7407535c9a4fc850af0594d638dd17856c054a (patch)
tree68f3e44c452a099a9f59d4a8a0ff094c259afe21 /sql-bench
parentc4ab5e0f09c23d96c8441df1167c1cb62171b0ca (diff)
downloadmariadb-git-7a7407535c9a4fc850af0594d638dd17856c054a.tar.gz
crash-me.sh:
restore nake_time and make_time_r sql-bench/crash-me.sh: restore nake_time and make_time_r
Diffstat (limited to 'sql-bench')
-rw-r--r--sql-bench/crash-me.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/sql-bench/crash-me.sh b/sql-bench/crash-me.sh
index 05011288de7..1ae2550d69d 100644
--- a/sql-bench/crash-me.sh
+++ b/sql-bench/crash-me.sh
@@ -2786,6 +2786,39 @@ sub check_constraint {
print "$res\n";
}
+sub make_time_r {
+ my $hour=shift;
+ my $minute=shift;
+ my $second=shift;
+ $_ = $limits{'time_format_inresult'};
+ return sprintf "%02d:%02d:%02d", ($hour%24),$minute,$second if (/^iso$/);
+ return sprintf "%02d.%02d.%02d", ($hour%24),$minute,$second if (/^euro/);
+ return sprintf "%02d:%02d %s",
+ ($hour >= 13? ($hour-12) : $hour),$minute,($hour >=13 ? 'PM':'AM')
+ if (/^usa/);
+ return sprintf "%02d%02d%02d", ($hour%24),$minute,$second if (/^HHMMSS/);
+ return sprintf "%04d%02d%02d", ($hour%24),$minute,$second if (/^HHHHMMSS/);
+ return "UNKNOWN FORMAT";
+}
+
+sub make_time {
+ my $hour=shift;
+ my $minute=shift;
+ my $second=shift;
+ return sprintf "%02d:%02d:%02d", ($hour%24),$minute,$second
+ if ($limits{'time_format_ISO'} eq "yes");
+ return sprintf "%02d.%02d.%02d", ($hour%24),$minute,$second
+ if ($limits{'time_format_EUR'} eq "yes");
+ return sprintf "%02d:%02d %s",
+ ($hour >= 13? ($hour-12) : $hour),$minute,($hour >=13 ? 'PM':'AM')
+ if ($limits{'time_format_USA'} eq "yes");
+ return sprintf "%02d%02d%02d", ($hour%24),$minute,$second
+ if ($limits{'time_format_HHMMSS'} eq "yes");
+ return sprintf "%04d%02d%02d", ($hour%24),$minute,$second
+ if ($limits{'time_format_HHHHMMSS'} eq "yes");
+ return "UNKNOWN FORMAT";
+}
+
sub make_date_r {
my $year=shift;
my $month=shift;