Comments (1)
MySQL simply can't make an update like that.
Here is a little test sql, which will result in
#1062 - Duplicate entry 'b' for key 't_name_unique'
CREATE TABLE `t` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(254) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `t_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci
INSERT INTO `t` (`id`, `name`) VALUES (1, 'a'), (2, 'b');
UPDATE t SET `name` = CASE `id` WHEN 1 THEN 'b' WHEN 2 THEN 'a' END WHERE `id` IN (1, 2);
I believe PostgreSQL can do this as it checks unique constraints only at the end of a transaction, but sadly MySQL can't.
from phpmyadmin.
Related Issues (20)
- Status > Monitor charts should look like before
- Export/Import database problem
- phpmyadmin HOT 1
- Server connection: SSL is not being used
- SSL issue on the directory when it worked before the switch to php 8.2
- Column sorting does not work when names contain dots
- Add config parameter: Enable/Disable backtick quoting HOT 2
- Drop comma from input
- TypeError: PhpMyAdmin\ConfigStorage\Relation::setHistory(): Argument #4 ($sqlquery) must be of type string, null given HOT 1
- ErrorException: foreach() argument must be of type array|object, string given
- Error in a function IN(...) and NOT IN(....) for query
- Javascript error in bootstrap.bundle.min.js - Popper__namespace.createPopper is not a function after clicking "more" option
- Phpmyadmin login error
- SQL Editor unexpected token with numeric db suffix and table name prefix
- strange character on breadcrumb on pmahomme theme HOT 3
- Edit privileges doesn't work
- better hint / autocompletion for INNER JOIN, LEFT JOIN, GROUP BY
- 6.0 snapshots build fail HOT 1
- Browse table cell has no height when value is empty string HOT 1
- Simulate query reports syntax error but the statement works HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpmyadmin.