Skip to content

Commit e75081a

Browse files
committed
added Token::asInteger64(); ODBC tests fix for case-sensitive DB
1 parent 83b5000 commit e75081a

6 files changed

Lines changed: 179 additions & 186 deletions

File tree

Data/MySQL/testsuite/src/SQLExecutor.cpp

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1695,47 +1695,47 @@ void SQLExecutor::sessionTransaction(const std::string& connect)
16951695

16961696
_pSession->begin();
16971697
assert (_pSession->isTransaction());
1698-
try { (*_pSession) << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
1698+
try { (*_pSession) << "INSERT INTO Person VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
16991699
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
17001700
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
17011701
assert (_pSession->isTransaction());
17021702

1703-
local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
1703+
local << "SELECT COUNT(*) FROM Person", into(locCount), now;
17041704
assert (0 == locCount);
17051705

1706-
try { (*_pSession) << "SELECT COUNT(*) FROM PERSON", into(count), now; }
1706+
try { (*_pSession) << "SELECT COUNT(*) FROM Person", into(count), now; }
17071707
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
17081708
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
17091709
assert (2 == count);
17101710
assert (_pSession->isTransaction());
17111711
_pSession->rollback();
17121712
assert (!_pSession->isTransaction());
17131713

1714-
local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
1714+
local << "SELECT COUNT(*) FROM Person", into(locCount), now;
17151715
assert (0 == locCount);
17161716

1717-
try { (*_pSession) << "SELECT count(*) FROM PERSON", into(count), now; }
1717+
try { (*_pSession) << "SELECT count(*) FROM Person", into(count), now; }
17181718
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
17191719
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
17201720
assert (0 == count);
17211721
assert (!_pSession->isTransaction());
17221722

17231723
_pSession->begin();
1724-
try { (*_pSession) << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
1724+
try { (*_pSession) << "INSERT INTO Person VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
17251725
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
17261726
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
17271727
assert (_pSession->isTransaction());
17281728

1729-
local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
1729+
local << "SELECT COUNT(*) FROM Person", into(locCount), now;
17301730
assert (0 == locCount);
17311731

17321732
_pSession->commit();
17331733
assert (!_pSession->isTransaction());
17341734

1735-
local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
1735+
local << "SELECT COUNT(*) FROM Person", into(locCount), now;
17361736
assert (2 == locCount);
17371737

1738-
try { (*_pSession) << "SELECT count(*) FROM PERSON", into(count), now; }
1738+
try { (*_pSession) << "SELECT count(*) FROM Person", into(count), now; }
17391739
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
17401740
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
17411741
assert (2 == count);
@@ -1788,14 +1788,14 @@ void SQLExecutor::transaction(const std::string& connect)
17881788
assert (trans.isActive());
17891789
assert (_pSession->isTransaction());
17901790

1791-
try { (*_pSession) << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
1791+
try { (*_pSession) << "INSERT INTO Person VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
17921792
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
17931793
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
17941794

17951795
assert (_pSession->isTransaction());
17961796
assert (trans.isActive());
17971797

1798-
try { (*_pSession) << "SELECT COUNT(*) FROM PERSON", into(count), now; }
1798+
try { (*_pSession) << "SELECT COUNT(*) FROM Person", into(count), now; }
17991799
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
18001800
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
18011801
assert (2 == count);
@@ -1804,90 +1804,90 @@ void SQLExecutor::transaction(const std::string& connect)
18041804
}
18051805
assert (!_pSession->isTransaction());
18061806

1807-
try { (*_pSession) << "SELECT count(*) FROM PERSON", into(count), now; }
1807+
try { (*_pSession) << "SELECT count(*) FROM Person", into(count), now; }
18081808
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
18091809
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
18101810
assert (0 == count);
18111811
assert (!_pSession->isTransaction());
18121812

18131813
{
18141814
Transaction trans((*_pSession));
1815-
try { (*_pSession) << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
1815+
try { (*_pSession) << "INSERT INTO Person VALUES (?,?,?,?)", use(lastNames), use(firstNames), use(addresses), use(ages), now; }
18161816
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
18171817
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
18181818

1819-
local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
1819+
local << "SELECT COUNT(*) FROM Person", into(locCount), now;
18201820
assert (0 == locCount);
18211821

18221822
assert (_pSession->isTransaction());
18231823
assert (trans.isActive());
18241824
trans.commit();
18251825
assert (!_pSession->isTransaction());
18261826
assert (!trans.isActive());
1827-
local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
1827+
local << "SELECT COUNT(*) FROM Person", into(locCount), now;
18281828
assert (2 == locCount);
18291829
}
18301830

1831-
try { (*_pSession) << "SELECT count(*) FROM PERSON", into(count), now; }
1831+
try { (*_pSession) << "SELECT count(*) FROM Person", into(count), now; }
18321832
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
18331833
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
18341834
assert (2 == count);
18351835

18361836
_pSession->begin();
1837-
try { (*_pSession) << "DELETE FROM PERSON", now; }
1837+
try { (*_pSession) << "DELETE FROM Person", now; }
18381838
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
18391839
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
18401840

1841-
local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
1841+
local << "SELECT COUNT(*) FROM Person", into(locCount), now;
18421842
assert (2 == locCount);
18431843

1844-
try { (*_pSession) << "SELECT count(*) FROM PERSON", into(count), now; }
1844+
try { (*_pSession) << "SELECT count(*) FROM Person", into(count), now; }
18451845
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
18461846
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
18471847
assert (0 == count);
18481848
_pSession->commit();
18491849

1850-
local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
1850+
local << "SELECT COUNT(*) FROM Person", into(locCount), now;
18511851
assert (0 == locCount);
18521852

1853-
std::string sql1 = format("INSERT INTO PERSON VALUES ('%s','%s','%s',%d)", lastNames[0], firstNames[0], addresses[0], ages[0]);
1854-
std::string sql2 = format("INSERT INTO PERSON VALUES ('%s','%s','%s',%d)", lastNames[1], firstNames[1], addresses[1], ages[1]);
1853+
std::string sql1 = format("INSERT INTO Person VALUES ('%s','%s','%s',%d)", lastNames[0], firstNames[0], addresses[0], ages[0]);
1854+
std::string sql2 = format("INSERT INTO Person VALUES ('%s','%s','%s',%d)", lastNames[1], firstNames[1], addresses[1], ages[1]);
18551855
std::vector<std::string> sql;
18561856
sql.push_back(sql1);
18571857
sql.push_back(sql2);
18581858

18591859
Transaction trans((*_pSession));
18601860

18611861
trans.execute(sql1, false);
1862-
try { (*_pSession) << "SELECT count(*) FROM PERSON", into(count), now; }
1862+
try { (*_pSession) << "SELECT count(*) FROM Person", into(count), now; }
18631863
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
18641864
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
18651865
assert (1 == count);
18661866
trans.execute(sql2, false);
1867-
try { (*_pSession) << "SELECT count(*) FROM PERSON", into(count), now; }
1867+
try { (*_pSession) << "SELECT count(*) FROM Person", into(count), now; }
18681868
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
18691869
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
18701870
assert (2 == count);
18711871

1872-
local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
1872+
local << "SELECT COUNT(*) FROM Person", into(locCount), now;
18731873
assert (0 == locCount);
18741874

18751875
trans.rollback();
18761876

1877-
local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
1877+
local << "SELECT COUNT(*) FROM Person", into(locCount), now;
18781878
assert (0 == locCount);
18791879

1880-
try { (*_pSession) << "SELECT count(*) FROM PERSON", into(count), now; }
1880+
try { (*_pSession) << "SELECT count(*) FROM Person", into(count), now; }
18811881
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
18821882
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
18831883
assert (0 == count);
18841884

18851885
trans.execute(sql);
18861886

1887-
local << "SELECT COUNT(*) FROM PERSON", into(locCount), now;
1887+
local << "SELECT COUNT(*) FROM Person", into(locCount), now;
18881888
assert (2 == locCount);
18891889

1890-
try { (*_pSession) << "SELECT count(*) FROM PERSON", into(count), now; }
1890+
try { (*_pSession) << "SELECT count(*) FROM Person", into(count), now; }
18911891
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
18921892
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
18931893
assert (2 == count);
@@ -1906,12 +1906,12 @@ void SQLExecutor::reconnect()
19061906
int count = 0;
19071907
std::string result;
19081908

1909-
try { (*_pSession) << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastName), use(firstName), use(address), use(age), now; }
1909+
try { (*_pSession) << "INSERT INTO Person VALUES (?,?,?,?)", use(lastName), use(firstName), use(address), use(age), now; }
19101910
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
19111911
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
19121912

19131913
count = 0;
1914-
try { (*_pSession) << "SELECT COUNT(*) FROM PERSON", into(count), now; }
1914+
try { (*_pSession) << "SELECT COUNT(*) FROM Person", into(count), now; }
19151915
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
19161916
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
19171917
assert (count == 1);
@@ -1921,15 +1921,15 @@ void SQLExecutor::reconnect()
19211921
assert (!_pSession->isConnected());
19221922
try
19231923
{
1924-
(*_pSession) << "SELECT LastName FROM PERSON", into(result), now;
1924+
(*_pSession) << "SELECT LastName FROM Person", into(result), now;
19251925
fail ("must fail");
19261926
}
19271927
catch(NotConnectedException&){ }
19281928
assert (!_pSession->isConnected());
19291929

19301930
_pSession->open();
19311931
assert (_pSession->isConnected());
1932-
try { (*_pSession) << "SELECT Age FROM PERSON", into(count), now; }
1932+
try { (*_pSession) << "SELECT Age FROM Person", into(count), now; }
19331933
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
19341934
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
19351935
assert (count == age);

0 commit comments

Comments
 (0)