Skip to content

promote string lookup range types#2383

Merged
jycor merged 7 commits intomainfrom
james/length
Mar 11, 2024
Merged

promote string lookup range types#2383
jycor merged 7 commits intomainfrom
james/length

Conversation

@jycor
Copy link
Contributor

@jycor jycor commented Mar 8, 2024

When performing range lookups, we convert the key to the type of the column.
The conversion throws an error when the key doesn't fit within the type for the index.
The fix is to promote these (only for StringType) so the ranges fit.

There were issues with type.Promote() for all types.

Additionally, there are some inconsistencies with MySQL when performing these checks with NUL characters (\0). They are skipped tests for now.

related dolthub/dolt#7588

},
},
},
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add cast tests like:

select * from vt where v < cast('def' as varchar(6))

etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't cast to varchar, but I can do char(6); will add these!

Copy link
Contributor

@nicktobey nicktobey Mar 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Are there other types we want to consider here too? Binary, text, etc?

@jycor jycor changed the title promote lookup range types promote string lookup range types Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants