~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/microsecond.test

This patch completes the first step in the splitting of
the XA resource manager API from the storage engine API,
as outlined in the specification here:

http://drizzle.org/wiki/XaStorageEngine

* Splits plugin::StorageEngine into a base StorageEngine
  class and two derived classes, TransactionalStorageEngine
  and XaStorageEngine.  XaStorageEngine derives from
  TransactionalStorageEngine and creates the XA Resource
  Manager API for storage engines.

  - The methods moved from StorageEngine to TransactionalStorageEngine
    include releaseTemporaryLatches(), startConsistentSnapshot(), 
    commit(), rollback(), setSavepoint(), releaseSavepoint(),
    rollbackToSavepoint() and hasTwoPhaseCommit()
  - The methods moved from StorageEngine to XaStorageEngine
    include recover(), commitXid(), rollbackXid(), and prepare()

* Places all static "EngineVector"s into their proper
  namespaces (typedefs belong in header files, not implementation files)
  and places all static methods corresponding
  to either only transactional engines or only XA engines
  into their respective files in /drizzled/plugin/

* Modifies the InnoDB "handler" files to extend plugin::XaStorageEngine
  and not plugin::StorageEngine

The next step, as outlined in the wiki spec page above, is to isolate
the XA Resource Manager API into its own plugin class and modify
plugin::XaStorageEngine to implement plugin::XaResourceManager via
composition.  This is necessary to enable building plugins which can
participate in an XA transaction *without having to have that plugin
implement the entire storage engine API*

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
# Test improper argument list 
17
17
#
18
18
# 1 arg is required.
19
 
--error ER_PARSE_ERROR 
 
19
--error 1064 
20
20
# Wrong parameter count...but unfortunately produces 1064 Syntax Error due to limitations of 
21
21
# the SQL parser, which considers MICROSECOND a keyword before being a function symbol
22
22
SELECT MICROSECOND();
23
 
--error ER_PARSE_ERROR
 
23
--error 1064
24
24
# Wrong parameter count...but unfortunately produces 1064 Syntax Error due to limitations of 
25
25
# the SQL parser, which considers MICROSECOND a keyword before being a function symbol
26
26
SELECT MICROSECOND(1, 0);
30
30
# produce an error, not a NULL or anything
31
31
# else...
32
32
#
33
 
--error ER_INVALID_DATETIME_VALUE
 
33
--error 1686
34
34
SELECT MICROSECOND("xxx");
35
35
 
36
36
39
39
# The following are all bad dates, with no possibility of interpreting
40
40
# the values as TIME-only components.
41
41
#
42
 
--error ER_INVALID_DATETIME_VALUE
 
42
--error 1686
43
43
SELECT MICROSECOND("0000-00-00"); # No 0000-00-00 dates!...
44
 
--error ER_INVALID_DATETIME_VALUE
 
44
--error 1686
45
45
SELECT MICROSECOND("0000-01-01"); # No zero year parts
46
 
--error ER_INVALID_DATETIME_VALUE
 
46
--error 1686
47
47
SELECT MICROSECOND("0001-00-01"); # No zero month parts
48
 
--error ER_INVALID_DATETIME_VALUE
 
48
--error 1686
49
49
SELECT MICROSECOND("0001-01-00"); # No zero day parts
50
 
--error ER_INVALID_DATETIME_VALUE
 
50
--error 1686
51
51
SELECT MICROSECOND("2000-02-30"); # No Feb 30th!
52
 
--error ER_INVALID_DATETIME_VALUE
 
52
--error 1686
53
53
SELECT MICROSECOND("1900-02-29"); # Not a leap MICROSECOND since not divisible evenly by 400...
54
 
--error ER_INVALID_DATETIME_VALUE
 
54
--error 1686
55
55
SELECT MICROSECOND('1976-15-15'); # No 15th month!
56
 
--error ER_INVALID_DATETIME_VALUE
 
56
--error 1686
57
57
SELECT MICROSECOND('23:59:70'); # No 70th second!
58
 
--error ER_INVALID_DATETIME_VALUE
 
58
--error 1686
59
59
SELECT MICROSECOND('23:70:59'); # No 70th minute!
60
 
--error ER_INVALID_DATETIME_VALUE
 
60
--error 1686
61
61
SELECT MICROSECOND('26:00:00'); # No 26th hour!
62
 
--error ER_INVALID_DATETIME_VALUE
 
62
--error 1686
63
63
SELECT MICROSECOND('26:00:00.9999999'); # Microseconds are 6 places, not 7
64
64
 
65
65
# A good date, which cannot be interpreted as a TIME component.  Should return 0.