This repository has been archived by the owner on Jan 28, 2021. It is now read-only.
Fixed INSERT bugs, added UINT64 support, and added tests #816
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I found some bugs for INSERT statements, and implemented a few tests as well (some specific to the bug fixes, others for general INSERT testing).
One bug dealt with integer values greater than an INT64. By default, all numbers are parsed to INT64, meaning that a column with type
sql.Uint64
cannot actually hold the entire range. I added another check that only attempts to parse as a UINT64 in the event that the INT64 parsing fails.Another bug dealt with the absence of columns in an INSERT statement. For example:
INSERT INTO tablename VALUES ...
would parse as an empty column list, rather than the entire column list. This behavior has been fixed.Another bug dealt with a mismatch between the number of columns supplied and the number of values supplied for an INSERT statement. This has also been fixed.
The last bug dealt with the smallest integer types. The
Convert
function was missing entries for those types, and causing inserts on those columns to fail that should otherwise be valid. This has also been fixed.