Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

DECIMAL columns to float and the query buffer automatically enlarged. #64

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ionutgrigorescu
Copy link

  1. The DECIMAL MySQL columns were retrieved as strings. I changed that to float, since that's a more appropriate type to retrieve them as.
  2. The PacketReader buffer was allocated when the object was created and didn't change it's size. For large queries (SELECT * FROM large_table) this happened:
    // Socket buffer got full!
    setError("Socket receive buffer full", 0, UME_OTHER);
    return false;
    -- this ended in a python script forced exit.
    I added char * PacketReader::resizeBuffer(size_t new_size) to be able to resize the buffer, and in the case of a big query, when the buffer get's filled, the bool Connection::readSocket() method will automatically resize the buffer to twice it's size. A big query can expect more data, so this saves newer allocation times.

… of things.

FIX: the DECIMAL and NEWDECIMAL will be converted to float.
…ehaviour was:

// Socket buffer got full!
setError("Socket receive buffer full", 0, UME_OTHER);
return false;
-- this ended in a python script forced exit.
I changed the behaviour to resizing the buffer to double it's old size.
--a big query can expect more data, so this saves newer allocation times.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant