Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executeSql parameter as array, iOS #144

Closed
matb33 opened this issue Oct 11, 2014 · 3 comments
Closed

executeSql parameter as array, iOS #144

matb33 opened this issue Oct 11, 2014 · 3 comments

Comments

@matb33
Copy link

matb33 commented Oct 11, 2014

If you pass a parameter that is actually an array, the WebSQL implementation will automatically typecast it as a string. However, at least for the iOS implementation of your plugin, this results in an error.

Example:
executeSql("INSERT ... (?, ?)", ['abc', [1,2,3]]);
In WebSQL, the above would be accepted and typecast to resemble the equivalent of:
executeSql("INSERT ... (?, ?)", ['abc', '1,2,3']);

Should be a simple fix in your JS to toString parameters that are arrays.

Apologies for the lack of a repro scenario.

@brodybits
Copy link
Contributor

I will make the reproduction scenario, should be tested for JS objects as well.

@brodybits
Copy link
Contributor

This issue is now reproduced for all three platforms Android/iOS/WP(8). For Android and iOS the data is stored incorrectly. For WP(8) the executeSql fails silently, returning no result or error callbacks.

brodybits pushed a commit that referenced this issue Mar 6, 2015
Small fix to handling of Blob to prepare for SQL blob improvements (ref: PR #170)
brodybits pushed a commit that referenced this issue Mar 10, 2015
Fixes:
- #193: workaround for Android db locking/closing issue
- #144: convert array parameters to string to match Web SQL
- #199: fix double-precision REAL values in result for iOS version
- #150/#153: close Android db before removing from map
- Fix truncation in iOS query result in case of UNICODE NULL (\0 or \u0000) (ref: PR #170)
- Some fixes for error handling to be consistent with Web SQL (ref: PR #170)

Testing ONLY:
- #147: testing with UNICODE line separator
- #195: Reproduce issue with double-precision REAL number on WP(8) ONLY
brodybits pushed a commit that referenced this issue Mar 10, 2015
Fixes:
- #193: workaround for Android db locking/closing issue
- #144: convert array parameters to string to match Web SQL
- #199: fix double-precision REAL values in result for iOS version
- #150/#153: close Android db before removing from map
- Fix truncation in iOS query result in case of UNICODE NULL (\0 or \u0000) (ref: PR #170)
- Some fixes for error handling to be consistent with Web SQL (ref: PR #170)

Testing ONLY:
- #147: testing with UNICODE line separator
- #195: Reproduce issue with double-precision REAL number on WP(8) ONLY
@brodybits
Copy link
Contributor

The fix has been validated on Android/iOS/WP(8) and published.

brodybits pushed a commit that referenced this issue Mar 10, 2015
Related to the following fixes:
- #193: workaround for Android db locking/closing issue
- #144: convert array parameters to string to match Web SQL
- #199: fix double-precision REAL values in result for iOS version
- #150/#153: close Android db before removing from map
- Fix truncation in iOS query result in case of UNICODE NULL (\0 or \u0000) (ref: PR #170)
- Some fixes for error handling to be consistent with Web SQL (ref: PR #170)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants