December 4, 2007
I have some software that generates SQL we support multiple versions of Microsoft SQL Server and Oracle. I ran into a failing test on Oracle today that was totally unexpected. [Test] public void Case_History_containing_a_queue_tag_should_be_destined_for_that_queue() { string queueName = "SUPPORT"; string caseHistory = String.Format("case is in queue {0}", queueName); string caseIDNumber = "275"; SetCaseHistoryForCase(caseIDNumber, caseHistory); string ruleText = String.Format(@"(case_history contains '{0}') -> ""{0}""", queueName); string[] queues = AutoDestRule.RunRule("case", ruleText, caseIDNumber); Assert.AreEqual(1, queues.Length); Assert.AreEqual(queueName, queues[0]); } The Gist There is a bit of noise in the test but the gist is that RunRule() generates and executes the following SQL: Here is what the database looks like for table_case: id_number case_history "275" "case is in queue SUPPORT" The test passes in Microsoft SQL Server but fails against Oracle. There is no difference in the SQL being generated between databases. I fired up Query…