mariadb/mysql-test/suite/rpl/r/rpl_hrtime.result
Michael Widenius db7edfed17 MDEV-7563 Support CHECK constraint as in (or close to) SQL Standard
MDEV-10134 Add full support for DEFAULT

- Added support for using tables with MySQL 5.7 virtual fields,
  including MySQL 5.7 syntax
- Better error messages also for old cases
- CREATE ... SELECT now also updates timestamp columns
- Blob can now have default values
- Added new system variable "check_constraint_checks", to turn of
  CHECK constraint checking if needed.
- Removed some engine independent tests in suite vcol to only test myisam
- Moved some tests from 'include' to 't'. Should some day be done for all tests.
- FRM version increased to 11 if one uses virtual fields or constraints
- Changed to use a bitmap to check if a field has got a value, instead of
  setting HAS_EXPLICIT_VALUE bit in field flags
- Expressions can now be up to 65K in total
- Ensure we are not refering to uninitialized fields when handling virtual fields or defaults
- Changed check_vcol_func_processor() to return a bitmap of used types
- Had to change some functions that calculated cached value in fix_fields to do
  this in val() or getdate() instead.
- store_now_in_TIME() now takes a THD argument
- fill_record() now updates default values
- Add a lookahead for NOT NULL, to be able to handle DEFAULT 1+1 NOT NULL
- Automatically generate a name for constraints that doesn't have a name
- Added support for ALTER TABLE DROP CONSTRAINT
- Ensure that partition functions register virtual fields used. This fixes
  some bugs when using virtual fields in a partitioning function
2016-06-30 11:43:02 +02:00

97 lines
3.3 KiB
Text

include/master-slave.inc
[connection master]
set time_zone='+03:00';
set timestamp=unix_timestamp('2011-01-01 01:01:01') + 0.123456;
create table t1 (a timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, b varchar(100), c datetime(2));
insert t1 (b,c) values (now(6), now(6));
insert t1 values ('2010-10-10 10:10:10.101010','2010-10-10 10:10:10.101010','2010-10-10 10:10:10.101010');
set timestamp=unix_timestamp('2022-02-02 02:02:02') + 0.654321;
insert t1 (b,c) values (now(), now());
insert t1 (b,c) values (0,0);
insert t1 (a,b,c) values (0,0,now(6));
select * from t1;
a b c
2011-01-01 01:01:01.1234 2011-01-01 01:01:01.123456 2011-01-01 01:01:01.12
2010-10-10 10:10:10.1010 2010-10-10 10:10:10.101010 2010-10-10 10:10:10.10
2022-02-02 02:02:02.6543 2022-02-02 02:02:02 2022-02-02 02:02:02.00
2022-02-02 02:02:02.6543 0 0000-00-00 00:00:00.00
0000-00-00 00:00:00.0000 0 2022-02-02 02:02:02.65
connection slave;
connection slave;
set time_zone='+03:00';
select * from t1;
a b c
2011-01-01 01:01:01.1234 2011-01-01 01:01:01.123456 2011-01-01 01:01:01.12
2010-10-10 10:10:10.1010 2010-10-10 10:10:10.101010 2010-10-10 10:10:10.10
2022-02-02 02:02:02.6543 2022-02-02 02:02:02 2022-02-02 02:02:02.00
2022-02-02 02:02:02.6543 0 0000-00-00 00:00:00.00
0000-00-00 00:00:00.0000 0 2022-02-02 02:02:02.65
connection master;
drop table t1;
include/rpl_end.inc
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1293832861/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
SET @@session.sql_mode=1342177280/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, b varchar(100), c datetime(2))
/*!*/;
BEGIN
/*!*/;
SET TIMESTAMP=1293832861.123456/*!*/;
SET @@session.time_zone='+03:00'/*!*/;
insert t1 (b,c) values (now(6), now(6))
/*!*/;
SET TIMESTAMP=1293832861.123456/*!*/;
COMMIT
/*!*/;
BEGIN
/*!*/;
SET TIMESTAMP=1293832861/*!*/;
insert t1 values ('2010-10-10 10:10:10.101010','2010-10-10 10:10:10.101010','2010-10-10 10:10:10.101010')
/*!*/;
SET TIMESTAMP=1293832861/*!*/;
COMMIT
/*!*/;
BEGIN
/*!*/;
SET TIMESTAMP=1643756522.654321/*!*/;
insert t1 (b,c) values (now(), now())
/*!*/;
SET TIMESTAMP=1643756522.654321/*!*/;
COMMIT
/*!*/;
BEGIN
/*!*/;
SET TIMESTAMP=1643756522.654321/*!*/;
insert t1 (b,c) values (0,0)
/*!*/;
SET TIMESTAMP=1643756522.654321/*!*/;
COMMIT
/*!*/;
BEGIN
/*!*/;
SET TIMESTAMP=1643756522.654321/*!*/;
insert t1 (a,b,c) values (0,0,now(6))
/*!*/;
SET TIMESTAMP=1643756522.654321/*!*/;
COMMIT
/*!*/;
SET TIMESTAMP=1643756522/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;