View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0008739 | ADK-Xojo-V4RB | SQL | public | 2020-02-27 10:39 | 2020-09-24 07:22 |
Reporter | Beatrix Willius | Assigned To | Ivan Smahin | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Fixed in Version | 10.0.x | ||||
Summary | 0008739: VPreparedStatement gives wrong result if one parameter has empty string | ||||
Description | Try the attached example. I'm doing direct SQL and a VPreparedStatement. Both should give the same result. If username is an empty string the results are different. The code works fine if username is not an empty string. dim username as String = "" dim mailbox as String = "Trash" dim MailboxSQL1 as String = "select RecID, * from Mailbox where lower(MailboxPath) = lower('" + Mailbox + "') and username = ''" dim MailboxCursor1 as VCursor = mDatabase.SqlSelect(MailboxSQL1, EVCursorLocation.kServerSide, EVLockType.kNoLocks, EVCursorDirection.kRandom) dim RecordCount1 as Integer = MailboxCursor1.RecordCount dim MailboxSQL2 as String = "select RecID, * from Mailbox where lower(MailboxPath) = lower(?) and username = ?" dim MailboxPrepared as VPreparedStatement = mDatabase.Prepare(MailboxSQL2) MailboxPrepared.BindText(0, mailbox) MailboxPrepared.BindText(1, Username) dim MailboxCursor2 as VCursor = MailboxPrepared.SqlSelect(EVCursorLocation.kServerSide, EVLockType.kNoLocks, EVCursorDirection.kRandom) dim RecordCount2 as Integer = MailboxCursor2.RecordCount if RecordCount1 <> RecordCount2 then MsgBox "error" end if Using latest Valentina with Xojo 2019r3 and High Sierra. | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2020-02-27 10:39 | Beatrix Willius | New Issue | |
2020-02-27 10:39 | Beatrix Willius | File Added: Archive.zip | |
2020-02-28 07:53 | Ivan Smahin | Assigned To | => Ivan Smahin |
2020-02-28 07:53 | Ivan Smahin | Status | new => resolved |
2020-02-28 07:53 | Ivan Smahin | Resolution | open => fixed |
2020-02-28 07:53 | Ivan Smahin | Fixed in Version | => 10.0.x |