| 1 |
############################################################################ |
| 2 |
# # |
| 3 |
# Variable Name: timestamp # |
| 4 |
# Scope: GLOBAL # |
| 5 |
# Access Type: Dynamic # |
| 6 |
# Data Type: INTEGER # |
| 7 |
# # |
| 8 |
# # |
| 9 |
# Creation Date: 2008-02-25 # |
| 10 |
# Author: Sharique Abdullah # |
| 11 |
# # |
| 12 |
# Modified: HHunger 2008-08-28 Reimplemented the test completely. # |
| 13 |
# # |
| 14 |
# Description: Test Cases of Dynamic System Variable "timestamp" # |
| 15 |
# that checks behavior of this variable in the following ways # |
| 16 |
# * Functionality based on different values # |
| 17 |
# # |
| 18 |
# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html # |
| 19 |
# # |
| 20 |
############################################################################ |
| 21 |
|
| 22 |
# Change timestamp which must have an effect on now(), but not on sysdate(). |
| 23 |
# Use Unix epoch timestamp |
| 24 |
# All comparisons must deliver true(1) |
| 25 |
# Exception: --sysdate-is-now switches off this behaviour and must not be set. |
| 26 |
|
| 27 |
--echo ** Connecting con1 using root ** |
| 28 |
connect (con1,localhost,root,,); |
| 29 |
SELECT date(now()) = date(sysdate()); |
| 30 |
SET @@session.timestamp = 1100000000; |
| 31 |
SELECT date(now()) != date(sysdate()); |
| 32 |
|
| 33 |
# Assure that setting of the variable has no effect on other session. |
| 34 |
--echo ** Connecting con0 using root ** |
| 35 |
connect (con0,localhost,root,,); |
| 36 |
SELECT @@session.timestamp != 1100000000; |
| 37 |
SET @@session.timestamp = 1000000000; |
| 38 |
SELECT date(now()) != date(sysdate()); |
| 39 |
|
| 40 |
--echo ** Connection con1 ** |
| 41 |
connection con1; |
| 42 |
SELECT @@session.timestamp != 1000000000; |
| 43 |
SELECT @@session.timestamp = 1100000000; |
| 44 |
|
| 45 |
--echo ** Connection default ** |
| 46 |
connection default; |
| 47 |
--echo Disconnecting Connections con0, con1 |
| 48 |
disconnect con0; |
| 49 |
disconnect con1; |
| 50 |
|