some kinda mssql server DB issue that maybe someon...
# lucee
d
some kinda mssql server DB issue that maybe someone knows the answer to:
a delete statement, followed by a create index statement, in the same query, will not throw a CF exception, if the index creation fails. Not sure if lucee bug, jdbc bug, or expected behavior. repro for anyone having an mssql setup:
Copy code
transaction {
	try {
		queryExecute("
			create table RMME_FOO (id int);
			insert into RMME_FOO (id) values (1), (1), (1), (1); -- comment this out to cause the index creation to succeed
		")
		v = queryExecute("
			delete top (1) from RMME_FOO;
			create unique index RMME_FOO_UNIQUE_BY_ID on RMME_FOO (id);
		")
		
		writedump(v); // no error ??
		
		idx = queryExecute("
			select * from sys.indexes where name = N'RMME_FOO_UNIQUE_BY_ID'
		")
		
		writedump(idx); // nothing, index creation failed because there were duplicates
	}
	finally {
		transaction action="rollback";
	}
}
b
@David Rogers Lucee bug
And a freaking annoying one at that
Looking for the ticket
d
wow, good to know. you have restored my sanity, haha
b
I assume that's what you're hitting
Yeah, it can create some VERY HARD TO TRACK bugs in your code 😕
d
Note that if you pass in the
lucee.datasource.mssql.modern=true
environment variable to Lucee, it should throw the exception.
I'm not sure why @micha end up hiding my fixes behind the feature flag, but we've been using my fixes for almost a year without incident.
d
i'll give that a shot, what other behavior does it change? just
onReceiveExceptionsThrowExceptions
, or there's other stuff