Skip to content

Conversation

@jycor
Copy link
Contributor

@jycor jycor commented Nov 29, 2023

fixes dolthub/dolt#7060

Additionally, fixes POW() to not have the same panic and returns warnings instead of errors for certain inputs to LOG().

@jycor jycor changed the title James/sqrt fix panic in math funcs Nov 29, 2023
Copy link
Contributor

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

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

lgtm, no big comments

func computeLog(ctx *sql.Context, v float64, base float64) (interface{}, error) {
if v <= 0 {
return float64(0), ErrInvalidArgumentForLogarithm.New(v)
ctx.Warn(3020, ErrInvalidArgumentForLogarithm.New(v).Error())
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a list of warning numbers somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is MySQLs list:
https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html

I don't think we have a list of these in dolt/gms

@jycor jycor merged commit e47c2ca into main Nov 29, 2023
@jycor jycor deleted the james/sqrt branch November 29, 2023 20:03
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.

Crash by SQRT

2 participants