8000 Harden string functions when NULL is passed by colincadams · Pull Request #112 · goccy/go-zetasqlite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Harden string functions when NULL is passed #112

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

Merged
merged 2 commits into from
Mar 10, 2024

Conversation

colincadams
Copy link
Contributor

We noticed that when using some string functions, like LEFT or REGEXP_REPLACE, if one of the values passed to the function was NULL we would receive an error like:

zetasqlite_collate: LEFT: value type is must be STRING or BYTES type

This updates the string functions to more consistently check for NULL parameters and return the correct value, either NULL or an empty array, depending on whether the function returns a single value or an array.

@codecov-commenter
Copy link
8000

Codecov Report

Merging #112 (25e7b0e) into main (a3da2d0) will increase coverage by 0.38%.
The diff coverage is 84.44%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #112      +/-   ##
==========================================
+ Coverage   45.40%   45.78%   +0.38%     
==========================================
  Files          44       44              
  Lines       17544    17620      +76     
==========================================
+ Hits         7966     8068     +102     
+ Misses       8131     8120      -11     
+ Partials     1447     1432      -15     

@ohaibbq
Copy link
Contributor
ohaibbq commented Jan 26, 2024

Hi @goccy, is there anything I can do to move these changes forward? Thank you!

@ohaibbq
Copy link
Contributor
ohaibbq commented Mar 9, 2024

Bumping this issue @goccy

Copy link
Owner
@goccy goccy left a comment

Choose a reason for hiding this comment

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

Sorry it took so long to review.
Thank you for your contribution ! LGTM 👍

@goccy goccy merged commit f887509 into goccy:main Mar 10, 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.

4 participants
0