Mysql Infinidb-“`在更新当前时间戳时创建“时间戳非空默认当前时间戳”;给出错误

Mysql Infinidb-“`在更新当前时间戳时创建“时间戳非空默认当前时间戳”;给出错误,mysql,database,database-design,sqldatatypes,infinidb,Mysql,Database,Database Design,Sqldatatypes,Infinidb,我试图将一个数据库从mysql移植到infinidb,但在移植过程中出现了上述错误(如标题所述) `CREATE_TIMESTAMP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 在mysql中有效,但在infinidb中无效。错误是:错误代码:138。infinidb不支持语法或数据类型。任何帮助都将不胜感激。这是您尝试的完整SQL语句吗?我能够使用: create table test (

我试图将一个数据库从mysql移植到infinidb,但在移植过程中出现了上述错误(如标题所述)

`CREATE_TIMESTAMP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

在mysql中有效,但在infinidb中无效。错误是:错误代码:138。infinidb不支持语法或数据类型。任何帮助都将不胜感激。

这是您尝试的完整SQL语句吗?我能够使用:

create table test (`CREATE_TIMESTAMP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
这里是控制台输出

[root@centos6 bin]# idbmysql 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.1.73 Calpont InfiniDB 4.5 Alpha

Copyright (c) 2014, InfiniDB, Inc. and/or its affiliates. All rights reserved.
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

InfiniDB is a registered trademark of InfiniDB, Inc. and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use test;
Database changed
mysql> create table test (`CREATE_TIMESTAMP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
Query OK, 0 rows affected (0.00 sec)

mysql> describe test;
+------------------+-----------+------+-----+-------------------+-----------------------------+
| Field            | Type      | Null | Key | Default           | Extra                       |
+------------------+-----------+------+-----+-------------------+-----------------------------+
| CREATE_TIMESTAMP | timestamp | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
+------------------+-----------+------+-----+-------------------+-----------------------------+
1 row in set (0.00 sec)

mysql> 
如果这不起作用或者您正在以不同的方式尝试语法,请告诉我。另外,您正在尝试什么版本的InfiniDB


谢谢

这是您尝试的完整SQL语句吗?我能够使用:

create table test (`CREATE_TIMESTAMP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
这里是控制台输出

[root@centos6 bin]# idbmysql 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.1.73 Calpont InfiniDB 4.5 Alpha

Copyright (c) 2014, InfiniDB, Inc. and/or its affiliates. All rights reserved.
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

InfiniDB is a registered trademark of InfiniDB, Inc. and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use test;
Database changed
mysql> create table test (`CREATE_TIMESTAMP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
Query OK, 0 rows affected (0.00 sec)

mysql> describe test;
+------------------+-----------+------+-----+-------------------+-----------------------------+
| Field            | Type      | Null | Key | Default           | Extra                       |
+------------------+-----------+------+-----+-------------------+-----------------------------+
| CREATE_TIMESTAMP | timestamp | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
+------------------+-----------+------+-----+-------------------+-----------------------------+
1 row in set (0.00 sec)

mysql> 
如果这不起作用或者您正在以不同的方式尝试语法,请告诉我。另外,您正在尝试什么版本的InfiniDB


谢谢

看起来您无法将TimePSamp数据类型与InfiniDB一起使用。我的版本与@mhoglan相同,但该查询中似乎有一点错误:

mysql> create table test (`CREATE_TIMESTAMP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
Query OK, 0 rows affected (0.00 sec) 
末尾缺少“engine=infinib;”“,这将在infinib中创建表。 相反,该表是使用MySQL的默认引擎(MyISAM或其他任何引擎)创建的

如您所见,添加engine=infinidb失败


如果你可以改用datetime,那可能是最好的选择;时间戳目前似乎不受支持:(

您似乎无法将时间戳数据类型与InfiniDB一起使用。我的版本与@mhoglan相同,但该查询中似乎有一点错误:

mysql> create table test (`CREATE_TIMESTAMP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
Query OK, 0 rows affected (0.00 sec) 
末尾缺少“engine=infinib;”“,这将在infinib中创建表。 相反,该表是使用MySQL的默认引擎(MyISAM或其他任何引擎)创建的

如您所见,添加engine=infinidb失败


如果您可以使用datetime,那么这可能是一种方法;时间戳现在似乎不受支持:(

我想这是InfiniDB中不允许的NOTNULL约束。

我想这是InfiniDB中不允许的NOTNULL约束