[MDEV-16391] Updating a blob on a table with InnoDB engine v10.3 Created: 2018-06-04  Updated: 2018-07-18  Resolved: 2018-07-18

Status: Closed
Project: MariaDB Server
Component/s: Data Manipulation - Update
Affects Version/s: 10.3
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Michael Jensen Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: innodb
Environment:

Windows 10 dot.net And C



 Description   

I cant get this code to work with "update" it returns 0 but dosen't update post, but it works with a "Insert"

bufferlength = ((picturebufferlen)*2) + BUFFERSIZE +1;
buffer = malloc(bufferlength);

end = buffer;
end += snprintf(buffer, bufferlength, "UPDATE billeder_table SET billed='");
end += mysql_real_escape_string(&SQLconnection, end, picturebuffer, picturebufferlen);
end += snprintf(end, bufferlength, "' WHERE %s = %s AND TS='%s';", SoegeFelt, Soegenummer, SoegeTimestam);
if (mysql_real_query(&SQLconnection, buffer, end - buffer) > 0)

{ free(buffer); return 1; }

 Comments   
Comment by Elena Stepanova [ 2018-07-18 ]

Did you check in the general log that it produces and sends the query which you expect (particularly, the correct WHERE clause)?
Does the same query updates any rows if it's executed manually on the server?

Comment by Michael Jensen [ 2018-07-18 ]

I did som research with doing the update via MySQL.exe cli program and there it worked, som I search further down the code and found I was using a invalid timestam, it is now fixed in the code.

Sorry for the inconvenience.

Generated at Thu Feb 08 08:28:34 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.