예제 #1
0
        private void ResetTestAfterClose(Session session, int threadId, int id)
        {
            Assert.Equal(threadId, session.ThreadId);
            SqlResult res = session.SQL("SELECT @a IS NULL").Execute();

            Assert.Equal((sbyte)1, res.FetchOne()[0]);
            var ex = Assert.Throws <MySqlException>(() => session.SQL("SHOW CREATE TABLE testResetSession" + id).Execute());

            Assert.Equal(string.Format("Table 'test.testresetsession{0}' doesn't exist", id), ex.Message);

            session.SQL(string.Format("SET @a='session{0}'", id)).Execute();
            res = session.SQL("SELECT @a AS a").Execute();
            Assert.Equal("session" + id, res.FetchAll()[0][0]);
        }