![]() Updating multiple columns and multiple rows with one My. SQL query - Databases. We are well expertise with PHP CRUD operations by accessing MySQL via PHP logic. Yet, we have seen about how to update and delete table rows one at a time. This. ![]() My. SQL Bugs: #1. Update from multiple tables. Description. Server: Red. ![]() Mysql Select For Update
Hat 7. 3, My. SQL 4. Dual Xeon 2. 0, 1. G RAM). Slave: Red. Hat 9. 0, My. SQL 4. Celeron 1. 4, 5. 12. M RAM). From mysqld. ERROR: 1. 03. 2 Can't find record in 't'. Slave: Error 'Can't find record in 't'' on query 'UPDATE urltable url,logtable t SET t. WHERE t. rid=0 AND t. AND t. reftable='A''. Default database: 'logging', Error_code: 1. Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'baka- bin. CREATE TABLE `logtable` (. NOT NULL default ''. NOT NULL default '0'. NOT NULL default '0'. NOT NULL default '0'. NOT NULL default ''. NOT NULL default '0'. NOT NULL default '0'. NOT NULL default '0'. NOT NULL default '0'. NOT NULL default '0'. NOT NULL default '0'. NOT NULL default '0'. NOT NULL default ''. NOT NULL default ''. NOT NULL default '0'. Y','N') NOT NULL default 'Y'. Y','N') NOT NULL default 'Y'. NOT NULL default '0'. NOT NULL default '0'. NOT NULL default '0'. NOT NULL default ''. NOT NULL default ''. KEY `reftable` (`reftable`). KEY `bid` (`bid`). KEY `vid` (`vid`). KEY `uid` (`uri_id`). KEY `rid` (`ref_id`). KEY `ip_id` (`ip_id`). CREATE TABLE `urltable` (. NOT NULL default '0'. NOT NULL default ''. NOT NULL default '1'. PRIMARY KEY (`url_id`). UNIQUE KEY `url` (`url`). KEY `hits` (`hits`). It happens with large data set. Current setting: master generates about 5. Insert new rows. INSERT IGNORE INTO urltable (url) SELECT DISTINCT uri FROM logtable WHERE uid=0. Assign the ids for the entries in log table. UPDATE urltable url,logtable t SET t. WHERE t. rid=0 AND t. AND t. reftable='A'. I did do REPAIR/OPTIMIZE slave tables since I searched and it seems the problem is only when the table corrupted but it wasn't). Currently I use another solution, which is much less efficient (not multiple table update but single table update, go through row by row) but it works w/o any problem on the slave.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
October 2017
Categories |