1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
43 static TUint8 TheBinaryColumnData[MAX(KLongColumnSize, KLongParameterSize) * sizeof(TUint16)]; |
43 static TUint8 TheBinaryColumnData[MAX(KLongColumnSize, KLongParameterSize) * sizeof(TUint16)]; |
44 |
44 |
45 //"RSqlStatement::Prepare()" OOM test (8-bit SELECT SQL statement) |
45 //"RSqlStatement::Prepare()" OOM test (8-bit SELECT SQL statement) |
46 void PrepareStmt8L(RSqlDatabase& aDb, RSqlStatement& aStmt) |
46 void PrepareStmt8L(RSqlDatabase& aDb, RSqlStatement& aStmt) |
47 { |
47 { |
48 _LIT8(KSqlString, "SELECT * FROM BBB"); |
48 _LIT8(KSqlString, "SELECT * FROM BBB WHERE Fld1=? AND Fld4<>?"); |
49 TInt err = aStmt.Prepare(aDb, KSqlString); |
49 TInt err = aStmt.Prepare(aDb, KSqlString); |
50 User::LeaveIfError(err); |
50 User::LeaveIfError(err); |
51 } |
51 } |
52 |
52 |
53 //"RSqlStatement::PrepareL()" OOM test (8-bit SELECT SQL statement) |
53 //"RSqlStatement::PrepareL()" OOM test (8-bit SELECT SQL statement) |
54 void PrepareStmt8_2L(RSqlDatabase& aDb, RSqlStatement& aStmt) |
54 void PrepareStmt8_2L(RSqlDatabase& aDb, RSqlStatement& aStmt) |
55 { |
55 { |
56 _LIT8(KSqlString, "SELECT * FROM BBB"); |
56 _LIT8(KSqlString, "SELECT * FROM BBB WHERE Fld1=? AND Fld4<>?"); |
57 aStmt.PrepareL(aDb, KSqlString); |
57 aStmt.PrepareL(aDb, KSqlString); |
58 } |
58 } |
59 |
59 |
60 //"RSqlStatement::Prepare()" OOM test (8-bit SELECT SQL statement), syntax error |
60 //"RSqlStatement::Prepare()" OOM test (8-bit SELECT SQL statement), syntax error |
61 void PrepareBadStmt8L(RSqlDatabase& aDb, RSqlStatement& aStmt) |
61 void PrepareBadStmt8L(RSqlDatabase& aDb, RSqlStatement& aStmt) |
62 { |
62 { |
63 _LIT8(KSqlString, "SELECT123 * FROM BBB"); |
63 _LIT8(KSqlString, "SELECT123 * FROM BBB WHERE Fld1=? AND Fld4<>?"); |
64 TInt err = aStmt.Prepare(aDb, KSqlString); |
64 TInt err = aStmt.Prepare(aDb, KSqlString); |
65 User::LeaveIfError(err); |
65 User::LeaveIfError(err); |
66 } |
66 } |
67 |
67 |
68 //"RSqlStatement::Prepare()" OOM test (8-bit SELECT SQL statement, move next) |
68 //"RSqlStatement::Prepare()" OOM test (8-bit SELECT SQL statement, move next) |
69 void PrepareMoveStmt8L(RSqlDatabase& aDb, RSqlStatement& aStmt) |
69 void PrepareMoveStmt8L(RSqlDatabase& aDb, RSqlStatement& aStmt) |
70 { |
70 { |
71 _LIT8(KSqlString, "SELECT * FROM BBB"); |
71 _LIT8(KSqlString, "SELECT * FROM BBB WHERE Fld1=? AND Fld4<>?"); |
72 TInt err = aStmt.Prepare(aDb, KSqlString); |
72 TInt err = aStmt.Prepare(aDb, KSqlString); |
73 if(err == KErrNone) |
73 User::LeaveIfError(err); |
74 { |
74 err = aStmt.BindInt(0, 1); |
75 err = aStmt.Next(); |
75 User::LeaveIfError(err); |
76 if(err == KSqlAtRow) |
76 err = aStmt.BindText(1, _L("data244weewfn43wr83224iu23ewkjfbrektug4i433b3k45b")); |
77 { |
77 User::LeaveIfError(err); |
78 err = KErrNone; |
78 err = aStmt.Next(); |
79 } |
79 if(err == KSqlAtRow) |
80 } |
80 { |
|
81 err = KErrNone; |
|
82 } |
81 User::LeaveIfError(err); |
83 User::LeaveIfError(err); |
82 } |
84 } |
83 |
85 |
84 //"RSqlStatement::Prepare()" OOM test (8-bit INSERT SQL statement) |
86 //"RSqlStatement::Prepare()" OOM test (8-bit INSERT SQL statement) |
85 void PrepareInsertStmt8L(RSqlDatabase& aDb, RSqlStatement& aStmt) |
87 void PrepareInsertStmt8L(RSqlDatabase& aDb, RSqlStatement& aStmt) |