Skip to content

Commit

Permalink
remove not nulls test since it is not supported in 2x
Browse files Browse the repository at this point in the history
  • Loading branch information
KushaalShroff committed Aug 30, 2024
1 parent d2b930f commit 307baa1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 60 deletions.
35 changes: 8 additions & 27 deletions test/dotnet/ExpectedOutput/insertBulkErrors.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Q#Create table sourceTable(a int, b int not null)
#Q#Create table destinationTable(a int, b int not null)
#Q#Create table sourceTable(a int, b int PRIMARY KEY)
#Q#Create table destinationTable(a int, b int PRIMARY KEY)
#Q#Insert into sourceTable values (1, 1);
#Q#Insert into sourceTable values (NULL, 2);
#Q#select @@trancount;
Expand All @@ -18,8 +18,8 @@
#!#2
#Q#drop table sourceTable
#Q#drop table destinationTable
#Q#Create table sourceTable(a int, b int not null)
#Q#Create table destinationTable(a int, b int not null)
#Q#Create table sourceTable(a int, b int PRIMARY KEY)
#Q#Create table destinationTable(a int, b int PRIMARY KEY)
#Q#Insert into sourceTable values (1, 1);
#Q#Insert into sourceTable values (NULL, 2);
#Q#select @@trancount;
Expand All @@ -35,8 +35,8 @@
#Q#Select * from destinationTable
#Q#drop table sourceTable
#Q#drop table destinationTable
#Q#Create table sourceTable(a int, b int not null)
#Q#Create table destinationTable(a int, b int not null)
#Q#Create table sourceTable(a int, b int PRIMARY KEY)
#Q#Create table destinationTable(a int, b int PRIMARY KEY)
#Q#create index idx on destinationTable(a);
#Q#Insert into sourceTable values (1, 1);
#Q#Insert into sourceTable values (NULL, 2);
Expand Down Expand Up @@ -81,8 +81,8 @@ on
on
#Q#drop table sourceTable
#Q#drop table destinationTable
#Q#Create table sourceTable(a int, b int not null)
#Q#Create table destinationTable(a int, b int not null)
#Q#Create table sourceTable(a int, b int PRIMARY KEY)
#Q#Create table destinationTable(a int, b int PRIMARY KEY)
#Q#create index idx on destinationTable(a);
#Q#Insert into sourceTable values (1, 1);
#Q#Insert into sourceTable values (NULL, 2);
Expand Down Expand Up @@ -250,25 +250,6 @@ on
#Q#drop table sourceTable1
#Q#drop table destinationTable
#Q#create table sourceTable(c1 int, c2 CHAR(1024))
#Q#INSERT INTO sourceTable SELECT generate_series(1, 1000, 1), 'Foo'
#Q#INSERT INTO sourceTable VALUES (NULL, NULL)
#Q#create table destinationTable(c1 int NOT NULL, c2 CHAR(1024))
#Q#create table sourceTable1(c1 int, c2 CHAR(1024))
#Q#INSERT INTO sourceTable1 VALUES(NULL, NULL)
#Q#INSERT INTO sourceTable1 SELECT generate_series(1, 999, 1), 'Foo'
#Q#Select count(*) from sourceTable
#D#int
1001
#Q#select count(*) from sourceTable1
#D#int
1000
#Q#Select count(*) from destinationTable
#D#int
0
#Q#drop table sourceTable
#Q#drop table sourceTable1
#Q#drop table destinationTable
#Q#create table sourceTable(c1 int, c2 CHAR(1024))
#Q#INSERT INTO sourceTable SELECT generate_series(1, 1001, 1), 'Foo'
#Q#create table destinationTable(c1 int, c2 CHAR(1024), check(c1 < 1000))
#Q#create table sourceTable1(c1 int, c2 CHAR(1024))
Expand Down
41 changes: 8 additions & 33 deletions test/dotnet/input/InsertBulk/insertBulkErrors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

####### Testing explicit transaction #######
# commit and then check for inserts
Create table sourceTable(a int, b int not null)
Create table destinationTable(a int, b int not null)
Create table sourceTable(a int, b int PRIMARY KEY)
Create table destinationTable(a int, b int PRIMARY KEY)
Insert into sourceTable values (1, 1);
Insert into sourceTable values (NULL, 2);
txn#!#begin
Expand All @@ -36,8 +36,8 @@ drop table sourceTable
drop table destinationTable

# rollback and then check for inserts
Create table sourceTable(a int, b int not null)
Create table destinationTable(a int, b int not null)
Create table sourceTable(a int, b int PRIMARY KEY)
Create table destinationTable(a int, b int PRIMARY KEY)
Insert into sourceTable values (1, 1);
Insert into sourceTable values (NULL, 2);
txn#!#begin
Expand All @@ -54,8 +54,8 @@ drop table sourceTable
drop table destinationTable

# Index without transaction
Create table sourceTable(a int, b int not null)
Create table destinationTable(a int, b int not null)
Create table sourceTable(a int, b int PRIMARY KEY)
Create table destinationTable(a int, b int PRIMARY KEY)
create index idx on destinationTable(a);
Insert into sourceTable values (1, 1);
Insert into sourceTable values (NULL, 2);
Expand All @@ -81,8 +81,8 @@ drop table sourceTable
drop table destinationTable

####### Index with transaction #######
Create table sourceTable(a int, b int not null)
Create table destinationTable(a int, b int not null)
Create table sourceTable(a int, b int PRIMARY KEY)
Create table destinationTable(a int, b int PRIMARY KEY)
create index idx on destinationTable(a);
Insert into sourceTable values (1, 1);
Insert into sourceTable values (NULL, 2);
Expand Down Expand Up @@ -208,31 +208,6 @@ drop table sourceTable
drop table sourceTable1
drop table destinationTable

####### Not Null #######
# last row is error (last packet will be flushed)
create table sourceTable(c1 int, c2 CHAR(1024))
INSERT INTO sourceTable SELECT generate_series(1, 1000, 1), 'Foo'
INSERT INTO sourceTable VALUES (NULL, NULL)
create table destinationTable(c1 int NOT NULL, c2 CHAR(1024))

insertbulk#!#sourceTable#!#destinationTable

# 1st row is error (remaining packets to be discarded)
create table sourceTable1(c1 int, c2 CHAR(1024))
INSERT INTO sourceTable1 VALUES(NULL, NULL)
INSERT INTO sourceTable1 SELECT generate_series(1, 999, 1), 'Foo'

insertbulk#!#sourceTable1#!#destinationTable

Select count(*) from sourceTable
select count(*) from sourceTable1

Select count(*) from destinationTable

drop table sourceTable
drop table sourceTable1
drop table destinationTable

####### Check #######
##### THESE TESTS ALSO TEST REUSING THE SAME CONNECTION
##### ON WHICH WE ERROR OUT AND NEED TO RESET TDS STATE
Expand Down

0 comments on commit 307baa1

Please sign in to comment.