mirror of
				https://github.com/MariaDB/server.git
				synced 2025-11-03 14:33:32 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			34 lines
		
	
	
		
			1004 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			1004 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
drop table if exists t1;
 | 
						|
CREATE TABLE t1 (
 | 
						|
gesuchnr int(11) DEFAULT '0' NOT NULL,
 | 
						|
benutzer_id int(11) DEFAULT '0' NOT NULL,
 | 
						|
PRIMARY KEY (gesuchnr,benutzer_id)
 | 
						|
) engine=ndbcluster;
 | 
						|
replace into t1 (gesuchnr,benutzer_id) values (2,1);
 | 
						|
replace into t1 (gesuchnr,benutzer_id) values (1,1);
 | 
						|
replace into t1 (gesuchnr,benutzer_id) values (1,1);
 | 
						|
insert into t1 (gesuchnr, benutzer_id) value (3,2);
 | 
						|
replace into t1 (gesuchnr,benutzer_id) values (1,1);
 | 
						|
replace into t1 (gesuchnr,benutzer_id) values (1,1);
 | 
						|
insert into t1 (gesuchnr,benutzer_id) values (1,1);
 | 
						|
ERROR 23000: Duplicate entry '1-1' for key 'PRIMARY'
 | 
						|
replace into t1 (gesuchnr,benutzer_id) values (1,1);
 | 
						|
select * from t1 order by gesuchnr;
 | 
						|
gesuchnr	benutzer_id
 | 
						|
1	1
 | 
						|
2	1
 | 
						|
3	2
 | 
						|
drop table t1;
 | 
						|
CREATE TABLE t1(i INT PRIMARY KEY AUTO_INCREMENT, 
 | 
						|
j INT, 
 | 
						|
k INT, 
 | 
						|
UNIQUE INDEX(j)
 | 
						|
) ENGINE = ndb;
 | 
						|
INSERT  INTO t1 VALUES (1,1,23),(2,2,24);
 | 
						|
REPLACE INTO t1 (j,k) VALUES (1,42);
 | 
						|
REPLACE INTO t1 (i,j) VALUES (17,2);
 | 
						|
SELECT * from t1 ORDER BY i;
 | 
						|
i	j	k
 | 
						|
3	1	42
 | 
						|
17	2	24
 |