- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我正在尝试将数据库从 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?
谢谢!
关于mysql - Infinidb -"` CREATE_TIMESTAMP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"给出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21829271/
因此,重新格式化了开发机器并盲目地重新安装了 MAMP 堆栈。现在我的 mariadb 与我们的服务器版本不同(10.2.6 vs 10.0.17)。 将服务器数据库转移到开发人员后,新版本似乎已将所
我得到了以下实体: @Entity public class Person { @Id @GeneratedValue(strategy=GenerationType.AUTO) @Column(co
当我创建一个新表时 create table test(rId int auto_increment, createtimestamp timestamp not null, PRIMARY KEY
关闭。这个问题需要更多 focused .它目前不接受答案。 想要改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 7 年前。 Improve this q
关闭。这个问题需要更多 focused .它目前不接受答案。 想要改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 7 年前。 Improve this q
In MariaDB 5.5 and before there could only be one TIMESTAMP column per table that had CURRENT_TIMEST
我写了一个sql来计算现在和上次更新时间之间的时间差异。首先,我只使用 CURRENT_TIMESTAMP - Updated_time 并发现结果在时间单位秒内看起来是正确的。但它并不稳定,有时结果
我刚刚花了几个小时来追踪这个错误。给定以下 SQL: DROP DATABASE IF EXISTS db; CREATE DATABASE db; CREATE TABLE db.tbl (t1 T
我正在尝试将数据库从 mysql 移植到 infinidb。但是在移植时出现上述错误(在标题中描述)。 `CREATE_TIMESTAMP` TIMESTAMP NOT NULL DEFAULT CU
我有一个这样的模型 - { "name": "MakeCallTestConfiguration", "base": "PersistedModel", "idInjection": tr
我们正在使用 Oracle 数据库。 在我们的表中时间戳存储为自 1970 年以来的秒数,如何将通过 current_timestamp() 函数获得的时间戳转换为秒 最佳答案 这样做: select
我正在使用Grails版本2.4.0,Java版本1.7和oracle 12c。 我想将apiEventLogList的记录保留在数据库表中。我不想在Java中设置createdTs字段,而是在GOR
我有一个如下所示的查询: $query = "INSERT INTO `SmsServ`.`SmsReceived` ( `Id` , `Body` , `DateRecei
我试图在将行插入数据库之前将 CURRENT_TIMESTAMP 设置为 UTC。根据我的阅读,这就是针对每个连接执行此操作的方法。 我的服务器时区是 EST (+5:00)。 我在调试时执行以下操作
我有一个数据库,其中有一个名为日期(时间戳)的列,该列设置为默认的 CURRENT_TIMESTAMP。这曾经工作正常,但是将数据库迁移到不同的服务器后,时间戳仅在执行 UPDATE 查询后应用,IN
我们目前在 MySQL 数据库上使用触发器,将“上次修改”时间戳设置为 CURRENT_TIMESTAMP。它在更新时调用。 我们还需要对集群使用基于语句的复制。 有没有办法修改触发器,以便传播的 C
我使用准备好的语句插入数据。如何将变量分配给 CURRENT_TIMESTAMP 并绑定(bind)该值? 我有一个包含列“name、lastfed、lastdoc 和 id”的数据库表。名为 las
我犯了一个出生在新西兰的错误,现在必须弄清楚如何在我的服务器时间上增加 15 小时!将不胜感激任何想法。 目前我正在使用: mysql_query(" INSERT INTO articles (Id
我正在尝试向该表中添加一个时间戳列: CREATE TABLE `task` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(
我在我的数据库中创建了一个表格,其中付款时间为 payment_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP。当我在将 payment_time
我是一名优秀的程序员,十分优秀!