1630 err = TheDb.Open(KTestDatabase7); |
1631 err = TheDb.Open(KTestDatabase7); |
1631 TEST2(err, KErrNone); |
1632 TEST2(err, KErrNone); |
1632 TheDb.Close(); |
1633 TheDb.Close(); |
1633 } |
1634 } |
1634 |
1635 |
|
1636 /** |
|
1637 Test defect where calling RSQLStatement::DeclaredColumnType() on a table which contains long (> 20 characters) column type |
|
1638 names results in a USER 11 panic. |
|
1639 This test should pass because these are valid SQL column types |
|
1640 */ |
|
1641 void LongColumnTypeTest() |
|
1642 { |
|
1643 (void)RSqlDatabase::Delete(KTestDatabase3); |
|
1644 TInt err = TheDb.Create(KTestDatabase3); |
|
1645 TEST2(err, KErrNone); |
|
1646 |
|
1647 _LIT8(KCreateStmt, "CREATE TABLE t(a CHARACTER VARYING(100000), b NCHAR VARYING(100000), c NATIONAL CHARACTER(100000), d NATIONAL CHARACTER VARYING(100000))"); |
|
1648 err = TheDb.Exec(KCreateStmt); |
|
1649 TEST(err >= 0); |
|
1650 |
|
1651 //Select all columns (SELECT *) |
|
1652 _LIT(KSelectStmt, "SELECT * FROM t"); |
|
1653 RSqlStatement stmt; |
|
1654 err = stmt.Prepare(TheDb, KSelectStmt); |
|
1655 TEST2(err, KErrNone); |
|
1656 |
|
1657 TSqlColumnType colType; |
|
1658 err = stmt.DeclaredColumnType(0, colType); |
|
1659 TEST2(err,KErrNone); |
|
1660 TEST2(colType, ESqlText); |
|
1661 |
|
1662 err = stmt.DeclaredColumnType(1, colType); |
|
1663 TEST2(err,KErrNone); |
|
1664 TEST2(colType, ESqlText); |
|
1665 |
|
1666 err = stmt.DeclaredColumnType(2, colType); |
|
1667 TEST2(err,KErrNone); |
|
1668 TEST2(colType, ESqlText); |
|
1669 |
|
1670 err = stmt.DeclaredColumnType(3, colType); |
|
1671 TEST2(err,KErrNone); |
|
1672 TEST2(colType, ESqlText); |
|
1673 |
|
1674 stmt.Close(); |
|
1675 |
|
1676 TheDb.Close(); |
|
1677 (void)RSqlDatabase::Delete(KTestDatabase3); |
|
1678 } |
|
1679 |
1635 void DoTestsL() |
1680 void DoTestsL() |
1636 { |
1681 { |
1637 TheTest.Start(_L(" @SYMTestCaseID:SYSLIB-SQL-CT-1763 \"SQL against a detached db\" test ")); |
1682 TheTest.Start(_L(" @SYMTestCaseID:SYSLIB-SQL-CT-1763 \"SQL against a detached db\" test ")); |
1638 SqlDetachedDbTest(); |
1683 SqlDetachedDbTest(); |
1639 |
1684 |
1640 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4034 Corrupted db file (file length too short)")); |
1685 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4034 Corrupted db file (file length too short)")); |
1641 CorruptDbFileTest(); |
1686 CorruptDbFileTest(); |
1642 |
1687 |
1643 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4035 Attempt to attach a file which name cannot be parsed")); |
1688 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4035 Attempt to attach a file which name cannot be parsed")); |
1644 AttachBadDbFileNameTest(); |
1689 AttachBadDbFileNameTest(); |
1645 |
1690 |
1646 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4036 Attempt to attach a secure database. The client cannot pass the security checks")); |
1691 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4036 Attempt to attach a secure database. The client cannot pass the security checks")); |
1647 AttachSecureDbTest(); |
1692 AttachSecureDbTest(); |
1648 |
1693 |
1649 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4032 INC091579 - SQL Panic 7 when streaming BLOB fields")); |
1694 TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4032 INC091579 - SQL Panic 7 when streaming BLOB fields")); |
1650 INC091579L(); |
1695 INC091579L(); |