Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
6fce7146
Commit
6fce7146
authored
Nov 26, 2008
by
Horst Hunger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug#37702: Inserted the review results into the patch.
parent
9300f20d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
111 additions
and
75 deletions
+111
-75
mysql-test/r/timestamp_func.result
mysql-test/r/timestamp_func.result
+18
-26
mysql-test/r/timestamp_sysdate_is_now_func.result
mysql-test/r/timestamp_sysdate_is_now_func.result
+25
-0
mysql-test/t/timestamp_func.test
mysql-test/t/timestamp_func.test
+20
-49
mysql-test/t/timestamp_sysdate_is_now_func-master.opt
mysql-test/t/timestamp_sysdate_is_now_func-master.opt
+1
-0
mysql-test/t/timestamp_sysdate_is_now_func.test
mysql-test/t/timestamp_sysdate_is_now_func.test
+47
-0
No files found.
mysql-test/r/timestamp_func.result
View file @
6fce7146
** Setup **
** Connecting con0 using root **
** Connecting con1 using root **
** Connecting con1 using root **
'#-----------------------------FN_DYNVARS_179_01------------------#'
SELECT date(now()) = date(sysdate());
** Connection con0 **
date(now()) = date(sysdate())
SET @ts_old = @@SESSION.timestamp;
1
waiting 1 sec
SET @@session.timestamp = 1100000000;
SET @ts_new = @@SESSION.timestamp;
SELECT date(now()) != date(sysdate());
SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
date(now()) != date(sysdate())
Timestamp Difference
1
** Connecting con0 using root **
SELECT @@session.timestamp != 1100000000;
@@session.timestamp != 1100000000
1
SET @@session.timestamp = 1000000000;
SELECT date(now()) != date(sysdate());
date(now()) != date(sysdate())
1
1
1 means >=1 expected is true
** Connection con1 **
** Connection con1 **
SET @ts_old = @@SESSION.timestamp;
SELECT @@session.timestamp != 1000000000;
waiting 4 sec
@@session.timestamp != 1000000000
SET @ts_new = @@SESSION.timestamp;
SELECT @ts_new - @ts_old >= 4 AS 'Timestamp Difference';
Timestamp Difference
1
1
1 means >=4 expected is true
SELECT @@session.timestamp = 1100000000;
'#-----------------------------FN_DYNVARS_179_02---------------------#'
@@session.timestamp = 1100000000
SET @ts_old = @@SESSION.timestamp;
Changing time zone
SET time_zone = 'MET';
SET @ts_new = @@SESSION.timestamp;
SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
Timestamp Difference
1
1
1 means >=1 expected is true
** Cleanup **
** Connection default **
** Connection default **
Disconnecting Connections con0, con1
Disconnecting Connections con0, con1
mysql-test/r/timestamp_sysdate_is_now_func.result
0 → 100644
View file @
6fce7146
** Connecting con1 using root **
SELECT date(now()) = date(sysdate());
date(now()) = date(sysdate())
1
SET @@session.timestamp = 1100000000;
SELECT date(now()) != date(sysdate());
date(now()) != date(sysdate())
0
** Connecting con0 using root **
SELECT @@session.timestamp != 1100000000;
@@session.timestamp != 1100000000
1
SET @@session.timestamp = 1000000000;
SELECT date(now()) != date(sysdate());
date(now()) != date(sysdate())
0
** Connection con1 **
SELECT @@session.timestamp != 1000000000;
@@session.timestamp != 1000000000
1
SELECT @@session.timestamp = 1100000000;
@@session.timestamp = 1100000000
1
** Connection default **
Disconnecting Connections con0, con1
mysql-test/t/timestamp_func.test
View file @
6fce7146
...
@@ -9,6 +9,8 @@
...
@@ -9,6 +9,8 @@
# Creation Date: 2008-02-25 #
# Creation Date: 2008-02-25 #
# Author: Sharique Abdullah #
# Author: Sharique Abdullah #
# #
# #
# Modified: HHunger 2008-08-28 Reimplemented the test completely. #
# #
# Description: Test Cases of Dynamic System Variable "timestamp" #
# Description: Test Cases of Dynamic System Variable "timestamp" #
# that checks behavior of this variable in the following ways #
# that checks behavior of this variable in the following ways #
# * Functionality based on different values #
# * Functionality based on different values #
...
@@ -17,63 +19,32 @@
...
@@ -17,63 +19,32 @@
# #
# #
############################################################################
############################################################################
--
echo
**
Setup
**
# Change timestamp which must have an effect on now(), but not on sysdate().
--
echo
# Use Unix epoch timestamp
#
# All comparisons must deliver true(1)
# Setup
# Exception: --sysdate-is-now switches off this behaviour and must not be set.
#
--
echo
**
Connecting
con0
using
root
**
connect
(
con0
,
localhost
,
root
,,);
--
echo
**
Connecting
con1
using
root
**
connect
(
con1
,
localhost
,
root
,,);
--
echo
'#-----------------------------FN_DYNVARS_179_01------------------#'
#
# Checking for connection 1
#
--
echo
**
Connection
con0
**
--
echo
**
Connecting
con1
using
root
**
connection
con0
;
connect
(
con1
,
localhost
,
root
,,);
SET
@
ts_old
=
@@
SESSION
.
timestamp
;
SELECT
date
(
now
())
=
date
(
sysdate
());
--
echo
waiting
1
sec
SET
@@
session
.
timestamp
=
1100000000
;
--
sleep
1
SELECT
date
(
now
())
!=
date
(
sysdate
());
SET
@
ts_new
=
@@
SESSION
.
timestamp
;
SELECT
@
ts_new
-
@
ts_old
>=
1
AS
'Timestamp Difference'
;
--
echo
1
means
>=
1
expected
is
true
# Assure that setting of the variable has no effect on other session.
--
echo
**
Connecting
con0
using
root
**
connect
(
con0
,
localhost
,
root
,,);
SELECT
@@
session
.
timestamp
!=
1100000000
;
SET
@@
session
.
timestamp
=
1000000000
;
SELECT
date
(
now
())
!=
date
(
sysdate
());
#
# Checking for connection 2
#
--
echo
**
Connection
con1
**
--
echo
**
Connection
con1
**
connection
con1
;
connection
con1
;
SET
@
ts_old
=
@@
SESSION
.
timestamp
;
SELECT
@@
session
.
timestamp
!=
1000000000
;
--
echo
waiting
4
sec
SELECT
@@
session
.
timestamp
=
1100000000
;
--
sleep
4
SET
@
ts_new
=
@@
SESSION
.
timestamp
;
SELECT
@
ts_new
-
@
ts_old
>=
4
AS
'Timestamp Difference'
;
--
echo
1
means
>=
4
expected
is
true
--
echo
'#-----------------------------FN_DYNVARS_179_02---------------------#'
#
# Testing timezone change effect
#
SET
@
ts_old
=
@@
SESSION
.
timestamp
;
--
sleep
1
--
echo
Changing
time
zone
SET
time_zone
=
'MET'
;
SET
@
ts_new
=
@@
SESSION
.
timestamp
;
SELECT
@
ts_new
-
@
ts_old
>=
1
AS
'Timestamp Difference'
;
--
echo
1
means
>=
1
expected
is
true
#
# Cleanup
#
--
echo
**
Cleanup
**
--
echo
**
Connection
default
**
--
echo
**
Connection
default
**
connection
default
;
connection
default
;
--
echo
Disconnecting
Connections
con0
,
con1
--
echo
Disconnecting
Connections
con0
,
con1
disconnect
con0
;
disconnect
con0
;
disconnect
con1
;
disconnect
con1
;
mysql-test/t/timestamp_sysdate_is_now_func-master.opt
0 → 100644
View file @
6fce7146
--sysdate-is-now
mysql-test/t/timestamp_sysdate_is_now_func.test
0 → 100644
View file @
6fce7146
############################################################################
# #
# Variable Name: timestamp with sysdate-is-now #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: INTEGER #
# #
# #
# Creation Date: 2008-11-25 #
# Author: Horst Hunger #
# #
# Description: Test Cases of Dynamic System Variable "timestamp" #
# that checks behavior of this variable in the following ways #
# * Like timstamp_func, but with set "sysdate-is-now". #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html #
# #
############################################################################
# Use Unix epoch timestamp
# Due to "--sysdate-is-now" timestamp must have an effect on both.
# See also timestamp_func.test.
--
echo
**
Connecting
con1
using
root
**
connect
(
con1
,
localhost
,
root
,,);
SELECT
date
(
now
())
=
date
(
sysdate
());
SET
@@
session
.
timestamp
=
1100000000
;
SELECT
date
(
now
())
!=
date
(
sysdate
());
# Assure that setting of the variable has no effect on other session.
--
echo
**
Connecting
con0
using
root
**
connect
(
con0
,
localhost
,
root
,,);
SELECT
@@
session
.
timestamp
!=
1100000000
;
SET
@@
session
.
timestamp
=
1000000000
;
SELECT
date
(
now
())
!=
date
(
sysdate
());
--
echo
**
Connection
con1
**
connection
con1
;
SELECT
@@
session
.
timestamp
!=
1000000000
;
SELECT
@@
session
.
timestamp
=
1100000000
;
--
echo
**
Connection
default
**
connection
default
;
--
echo
Disconnecting
Connections
con0
,
con1
disconnect
con0
;
disconnect
con1
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment