- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有以下现有表格,如此处所示..
显示创建表 ExpeditedAddress;
CREATE TABLE `expeditedaddress` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`description` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL,
`city` varchar(255) NOT NULL,
`country` varchar(255) NOT NULL,
`stateProvince` varchar(255) NOT NULL,
`zipPostal` varchar(255) NOT NULL,
`brokerageId` bigint(20) NOT NULL,
`timezoneCode` varchar(100) NOT NULL,
`productionFacilityId` bigint(20) NOT NULL,
`deliveryCutoffTime` time NOT NULL,
`deliveredByTime` time NOT NULL,
`daysToDeliver` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `FK_ExpeditedAddress_Brokerage_ID` (`brokerageId`),
KEY `FK_ExpeditedAddress_Country_StateProvince` (`country`,`stateProvince`),
CONSTRAINT `ExpeditedAddress_ibfk_1` FOREIGN KEY (`brokerageId`) REFERENCES `brokerage` (`id`),
CONSTRAINT `ExpeditedAddress_ibfk_2` FOREIGN KEY (`country`, `stateProvince`) REFERENCES `stateprovince` (`countryName`, `name`)
) ENGINE=InnoDB AUTO_INCREMENT=149 DEFAULT CHARSET=utf8;
它引用了这个表
显示创建表 ProductionFacility;
CREATE TABLE `productionfacility` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`description` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL,
`city` varchar(255) NOT NULL,
`country` varchar(255) NOT NULL,
`stateProvince` varchar(255) NOT NULL,
`zipPostal` varchar(255) NOT NULL,
`timezoneCode` varchar(100) NOT NULL,
`workingWeek` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `FK_ProductionFacility_Country_StateProvince` (`country`,`stateProvince`),
CONSTRAINT `productionfacility_ibfk_1` FOREIGN KEY (`country`, `stateProvince`) REFERENCES `stateprovince` (`countryName`, `name`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
然后当我尝试添加外键时...
alter table ExpeditedAddress add foreign key FK_ExpeditedAddress_Productionfacility(productionFacilityId) references ProductionFacility(id);
我得到以下...
[2012-08-09 15:39:22] [42S01][1050] Table '.\realtorprint_dev_prod\expeditedaddress' already exists
[2012-08-09 15:39:22] [HY000][1025] Error on rename of '.\realtorprint_dev_prod\#sql-1d74_710a' to '.\realtorprint_dev_prod\expeditedaddress' (errno: -1)
[2012-08-09 15:39:22] [42S01][1050] Table '.\realtorprint_dev_prod\expeditedaddress' already exists
似乎是一个非常奇怪的错误。列的类型都是“bigint(20) not null”。两个表都是 InnoDB。引用的列是主键。
有没有人有什么想法?
另外,这是运行的结果
显示引擎 InnoDB 状态;
=====================================
120809 15:45:41 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 54 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 9322 1_second, 9321 sleeps, 846 10_second, 894 background, 894 flush
srv_master_thread log flush and writes: 9323
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 520, signal count 520
Mutex spin waits 197, rounds 836, OS waits 12
RW-shared spins 499, rounds 14942, OS waits 498
RW-excl spins 2, rounds 242, OS waits 8
Spin rounds per wait: 4.24 mutex, 29.94 RW-shared, 121.00 RW-excl
------------------------
LATEST FOREIGN KEY ERROR
------------------------
120809 15:34:11 Transaction:
TRANSACTION 40CE, ACTIVE 0 sec inserting, thread declared inside InnoDB 485
mysql tables in use 2, locked 2
7 lock struct(s), heap size 1248, 16 row lock(s), undo log entries 7
MySQL thread id 28938, OS thread handle 0x16d4, query id 350923 localhost 127.0.0.1 rpuser copy to tmp table
alter table ExpeditedAddress add foreign key FK_ExpeditedAddress_Productionfacility(id) references ProductionFacility(id)
Foreign key constraint fails for table `realtorprint_dev_prod`.`#sql-1d74_710a`:
,
CONSTRAINT `#sql-1d74_710a_ibfk_1` FOREIGN KEY (`id`) REFERENCES `productionfacility` (`id`)
Trying to add in child table, in index `PRIMARY` tuple:
DATA TUPLE: 15 fields;
0: len 8; hex 8000000000000008; asc ;;
1: len 6; hex 0000000040ce; asc @ ;;
2: len 7; hex a3000005f90176; asc v;;
3: len 12; hex 536f757468204f6666696365; asc South Office;;
4: len 25; hex 233235322c2031313438382d20323420537472656574205345; asc #252, 11488- 24 Street SE;;
5: len 7; hex 43616c67617279; asc Calgary;;
6: len 6; hex 43616e616461; asc Canada;;
7: len 7; hex 416c6265727461; asc Alberta;;
8: len 7; hex 54325a20344339; asc T2Z 4C9;;
9: len 8; hex 8000000000000012; asc ;;
10: len 16; hex 416d65726963612f45646d6f6e746f6e; asc America/Edmonton;;
11: len 8; hex 8000000000000001; asc ;;
12: len 3; hex 81adb0; asc ;;
13: len 3; hex 829810; asc ;;
14: len 4; hex 80000001; asc ;;
But in parent table `realtorprint_dev_prod`.`productionfacility`, in index `PRIMARY`,
the closest match we can find is record:
PHYSICAL RECORD: n_fields 11; compact format; info bits 0
0: len 8; hex 8000000000000007; asc ;;
1: len 6; hex 00000000401f; asc @ ;;
2: len 7; hex b6000003a10176; asc v;;
3: len 16; hex 4461746147726f7570204c6f6e646f6e; asc DataGroup London;;
4: len 21; hex 313837302043686561707369646520537472656574; asc 1870 Cheapside Street;;
5: len 6; hex 4c6f6e646f6e; asc London;;
6: len 6; hex 43616e616461; asc Canada;;
7: len 7; hex 4f6e746172696f; asc Ontario;;
8: len 7; hex 4e355620334537; asc N5V 3E7;;
9: len 15; hex 416d65726963612f546f726f6e746f; asc America/Toronto;;
10: len 0; hex ; asc ;;
InnoDB: Renaming table `realtorprint_dev_prod`.`#sql-1d74_710a` to `realtorprint_dev_prod`.`expeditedaddress` failed!
InnoDB: Renaming table `realtorprint_dev_prod`.`#sql-1d74_710a` to `realtorprint_dev_prod`.`expeditedaddress` failed!
InnoDB: Renaming table `realtorprint_dev_prod`.`#sql-1d74_710a` to `realtorprint_dev_prod`.`expeditedaddress` failed!
InnoDB: Renaming table `realtorprint_dev_prod`.`#sql-1d74_710b` to `realtorprint_dev_prod`.`expeditedaddress` failed!
------------
TRANSACTIONS
------------
Trx id counter 40FD
Purge done for trx's n:o < 40F2 undo n:o < 0
History list length 827
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 40F3, not started
MySQL thread id 28939, OS thread handle 0x2ed8, query id 350949 localhost 127.0.0.1 rpuser
show engine innodb status
--------
FILE I/O
--------
I/O thread 0 state: wait Windows aio (insert buffer thread)
I/O thread 1 state: wait Windows aio (log thread)
I/O thread 2 state: wait Windows aio (read thread)
I/O thread 3 state: wait Windows aio (read thread)
I/O thread 4 state: wait Windows aio (read thread)
I/O thread 5 state: wait Windows aio (read thread)
I/O thread 6 state: wait Windows aio (write thread)
I/O thread 7 state: wait Windows aio (write thread)
I/O thread 8 state: wait Windows aio (write thread)
I/O thread 9 state: wait Windows aio (write thread)
Pending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] ,
ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; buffer pool: 0
1363 OS file reads, 17403 OS file writes, 4157 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.11 writes/s, 0.11 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 0, seg size 2, 11 merges
merged operations:
insert 11, delete mark 0, delete 0
discarded operations:
insert 0, delete mark 0, delete 0
Hash table size 1458971, node heap has 15 buffer(s)
3.54 hash searches/s, 12.39 non-hash searches/s
---
LOG
---
Log sequence number 121733086
Log flushed up to 121733086
Last checkpoint at 121601659
0 pending log writes, 0 pending chkp writes
2674 log i/o's done, 0.11 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 754434048; in additional pool allocated 0
Dictionary memory allocated 795806
Buffer pool size 44992
Free buffers 42494
Database pages 2483
Old database pages 896
Modified db pages 36
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 335, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 1352, created 1131, written 13915
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 2483, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
1 read views open inside InnoDB
Main thread id 7616, state: sleeping
Number of rows inserted 194766, updated 699, deleted 143, read 806318
2.74 inserts/s, 0.00 updates/s, 0.00 deletes/s, 2.74 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================
最佳答案
如果您查看“最新的外键错误”,那条长长的错误会提示您尝试添加的外键被违反:您现有的数据不符合外键约束。
(我不是 100% 确定它是这么说的,它可能是在提示索引损坏,在这种情况下你需要弄清楚你的索引是如何损坏的并重建索引,但我认为不是。我认为自从我上次看到它以来,他们刚刚更改了违反外键的错误消息)。
关于mysql - 添加外键时报错 'Table ' .\schema\table' already exists,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11892377/
这个问题在这里已经有了答案: What is the best way to parse html in C#? [closed] (15 个答案) 关闭 3 年前。 string input =
为什么 wrapper #4 没有继承其父表容器的高度?表格嵌套在一个显示 block 包装器中,每个嵌套的div是显示表格,每个表格继承到最里面的一个。是什么原因造成的,我该如何解决? jsfidd
我正在使用带有 Bootstrap 的自定义 css 作为外边框。但顶部边框不可见,除非我将其大小设置为 2 px。 我该如何解决这个问题? HTML #name 1.one 2.two 3.thr
我正在逻辑层面上设计一个数据库,以便稍后将其传递给程序员来交付。我只是粗略地了解它们的工作原理,所以我很难简洁地表达我的问题。这是我的问题: 我有一个名为 MEANINGS 的表。 我有一个名为 WO
在 Laravel 上,我们可以使用 DB::table('table')->get(); 或使用 model::('table')->all() 进行访问;我的问题是它们之间有什么区别? 谢谢。 最
我试图从以下内容中抓取 URL从 WorldOMeter 获取 CoVid 数据,在此页面上存在一个表,id 为:main_table_countries_today其中包含我希望收集的 15x225
这是我的图表数据库:/image/CGAwh.png 我用 SEQUELIZE 制作了我的数据库模型: 型号:级别 module.exports = (sequelize, DataTypes) =>
我真的不明白为什么我的代码不能按预期工作。当我将鼠标悬停在表格的每一行上时,我想显示一个图像(来 self 之前加载的 JSON)。每个图像根据行的不同而不同,我想将它们显示在表格之外的另一个元素中。
假设我的数据库中有一张地铁 map ,其中每条线路的每个站点都是一行。如果我想知道我的线路在哪里互连: mysql> SELECT LineA.stop_id FROM LineA, LineB WH
我最近经常使用这些属性,尤其是 display: table-cell。它在现代浏览器中得到了很好的支持,并且它对某些网格有很多好处,并且可以非常轻松地对齐内容,而无需棘手的标记。但在过去的几天里,我
在 CSS 中,我可以这样做: http://s1.ipicture.ru/uploads/20120612/Uk1Z8iZ1.png http://s1.ipicture.ru/uploads/20
问题作为标题,我正在学习sparkSQL,但我无法很好地理解它们之间的区别。谢谢。 最佳答案 spark.table之间没有区别& spark.read.table功能。 内部 spark.read.
我正在尝试根据 this answer 删除表上的非空约束.但是,它似乎没有在 sqlite_sequence 中创建条目。这样做之后,即使我可以在使用测试表时让它正常工作。 有趣的是,如果我备份我的
var otable = new sap.m.Table();//here table is created //here multiple header I'm trying to create t
下面两种方法有什么区别: 内存 性能 答: select table.id from table B: select a.id from table a 谢谢(抱歉,如果我的问题重复)。 最佳答案 完
我尝试在表格后添加点,方法是使用 table::after 选择器创建一个点元素并使用 margin: 5px auto 5px auto; 将其居中。它有效,但似乎在第一个表格列之后添加了点,而不是
我正在设计一个可以标记任何内容的数据库,我可能希望能够选择带有特定标记的所有内容。 我正在为以下两个选项而苦苦挣扎,希望得到一些建议。如果有更好的方法请告诉我。 选项A 多个“多对多”连接表。 tag
"center" div 中的下表元素导致 "left" div 中的内容从顶部偏移几个像素(在我的浏览器中为 8 ).在表格之前添加一些文本可消除此偏移量。 为什么?如何在不要求在我的表格前添加“虚
我是一名优秀的程序员,十分优秀!