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

'error in running finalizer' when running MySQL.query with an 'update' command #103

Closed
xximranxx opened this issue Mar 22, 2018 · 4 comments

Comments

@xximranxx
Copy link

Running MySQL.query with a 'update' command prints an error message (though does not end in an error) after gc() is run:

Doing the same with a 'select' command prints no error message

connection = MySQL.connect(ip,user,password,port=port,db=initial_schema)
command_update = "update table set value=2 where name='x'"
MySQL.query(connection,command_update)
gc() # prints 'error in running finalizer: Base.MethodError(f=typeof(Base.unsafe_convert)(), args=(Ptr{Void}, 0), world=0x0000000000005579)'

command_select = "select * from table where name='x'"
MySQL.query(connection,command_update)
gc() # prints nothing

This is with julia 0.6.2 and MySQL 0.5.2

@xximranxx
Copy link
Author

Probably related to this function:

function mysql_binary_interpret_field(buf, T::Type)
    value = unsafe_load(convert(Ptr{T}, buf), 1)

    if typeof(value) == MYSQL_TIME
        if value.timetype == MYSQL_TIMESTAMP_DATE
            return convert(Date, value)

        elseif (value.timetype == MYSQL_TIMESTAMP_TIME
                || value.timetype == MYSQL_TIMESTAMP_DATETIME)
            return convert(DateTime, value)

        else
            throw(MySQLInterfaceError("MySQL Time type not recognized."))
        end
    end

    return value
end

Looks like buf==0 in the result the 'insert' command?

@essenciary
Copy link

I'm getting the same with "CREATE TABLE" queries, ex:

error in running finalizer: Base.MethodError(f=typeof(Base.unsafe_convert)(), args=(Ptr{Void}, 0), world=0x0000000000005dd0)

@essenciary
Copy link

Is there a way to stop these from being outputted? I'm running some large data import tasks and these just keep going on for minutes.

@quinnj
Copy link
Member

quinnj commented Jan 29, 2020

Will be ultimately fixed by the package overhaul in #139

@quinnj quinnj closed this as completed Jan 29, 2020
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

No branches or pull requests

3 participants