<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[QSqlQuery, addBindValue, LargeBlob problem?]]></title><description><![CDATA[<p dir="auto">I am constructing a call to a stored procedure, one of the parameters was previously a BLOB, I've changed it now to a LONGBLOB and now there seems to be a problem.</p>
<p dir="auto">C++ Code:</p>
<pre><code>                        QSqlQuery queryBlock;
                        queryBlock.prepare("SELECT addBlock(?,?,?,?,?);");
qdbg() &lt;&lt; "muintDatasetID: " &lt;&lt; muintDatasetID;
qdbg() &lt;&lt; "   strFilename: " &lt;&lt; strFilename;
qdbg() &lt;&lt; "  muint64Block: " &lt;&lt; muint64Block;
qdbg() &lt;&lt; "   bytaryChunk: " &lt;&lt; bytaryChunk.length();
qdbg() &lt;&lt; " uint8Checksum: " &lt;&lt; uint8Checksum;
                        queryBlock.addBindValue(muintDatasetID);
                        queryBlock.addBindValue(strFilename);
                        queryBlock.addBindValue(muint64Block);
                        queryBlock.addBindValue(bytaryChunk, QSql::Binary);
                        queryBlock.addBindValue(uint8Checksum);
                        if ( Trainer::queryDB(queryBlock) == true )
</code></pre>
<p dir="auto">My stored procedure:</p>
<pre><code>CREATE DEFINER=`root`@`localhost` FUNCTION `addBlock`(
      `_biDataset` BIGINT,
      `_txtFilename` TEXT,
      `_intBlockNo` INT,
      `_binChunk` LONGBLOB,
      `_intChecksum` INT
)
RETURNS bigint(20)
LANGUAGE SQL
DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT 'Adds a single data block'
exitProc:BEGIN
#Function:        addBlock
#Parameters:      _biDataset     Optional, Dataset In/Out number
#                 _txtFilename      File name of RDF dataset
#                 _intBlockNo       Block number (base 0)
#                 _binChunk         Large Binary Blob of Data
#                 _intChecksum      8 bit CRC
#Notes:           Creates single record of data block
#History:         2021/05/19  Written by Simon Platten
      #Validate parameters
      IF _txtFilename IS NULL OR
         _intBlockNo IS NULL OR
            _binChunk IS NULL OR
            _intChecksum IS NULL THEN
      #No, abort!
            RETURN -1;
      END IF;
      IF _biDataset IS NULL THEN
      #Look up the dataset id
            SELECT
                  `biPK` INTO _biDataset
            FROM
                  datasets
            WHERE
                  txtFilename=_txtFilename;          
      END IF;
      #Was dataset located?
      IF _biDataset IS NULL THEN
      #No, abort!
            RETURN -2;
      END IF;
      #Insert new record
      INSERT INTO `rdf` (
            `biDataset`,
            `intBlockNo`,
            `intChecksum`,
            `binChunk`
      ) VALUES (
            _biDataset,
            _intBlockNo,
            _intChecksum,
            _binChunk
      );
      RETURN LAST_INSERT_ID();
END
</code></pre>
<p dir="auto">Output to console:</p>
<pre><code>muintDatasetID: 1
   strFilename: 20211004_11h42_LabTest_tvg5000_0.rdf
  muint64Block: 0
   bytaryChunk: 34390236
 uint8Checksum: 18
</code></pre>
<p dir="auto">This code previously worked when I was dealing with a BLOB, now I've changed the stored procedure and table types from BLOB to LONGBLOB it errors, with no sensible error message I can post.  What could the problem?</p>
]]></description><link>https://forum.qt.io/topic/130831/qsqlquery-addbindvalue-largeblob-problem</link><generator>RSS for Node</generator><lastBuildDate>Thu, 21 May 2026 07:13:31 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/130831.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 04 Oct 2021 15:41:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QSqlQuery, addBindValue, LargeBlob problem? on Mon, 04 Oct 2021 17:56:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> , this forum is a resource full of knowledgeable people, just like a Google search is also a resource, how and what I choose to do is my choice.</p>
]]></description><link>https://forum.qt.io/post/683484</link><guid isPermaLink="true">https://forum.qt.io/post/683484</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Mon, 04 Oct 2021 17:56:52 GMT</pubDate></item><item><title><![CDATA[Reply to QSqlQuery, addBindValue, LargeBlob problem? on Mon, 04 Oct 2021 17:00:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a> said in <a href="/post/683473">QSqlQuery, addBindValue, LargeBlob problem?</a>:</p>
<blockquote>
<p dir="auto">your so pissy</p>
</blockquote>
<p dir="auto">Because you're to lazy (or whatever) to search for the simplest things before you write a new question which every kid could resolve in less than a minute...</p>
]]></description><link>https://forum.qt.io/post/683480</link><guid isPermaLink="true">https://forum.qt.io/post/683480</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Mon, 04 Oct 2021 17:00:16 GMT</pubDate></item><item><title><![CDATA[Reply to QSqlQuery, addBindValue, LargeBlob problem? on Mon, 04 Oct 2021 16:07:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/artwaw">@<bdi>artwaw</bdi></a> , so I modified <strong>my.ini</strong> and restarted <strong>MariaDB</strong> service, now it appears to be ok, thank's for your help.</p>
]]></description><link>https://forum.qt.io/post/683474</link><guid isPermaLink="true">https://forum.qt.io/post/683474</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Mon, 04 Oct 2021 16:07:39 GMT</pubDate></item><item><title><![CDATA[Reply to QSqlQuery, addBindValue, LargeBlob problem? on Mon, 04 Oct 2021 16:01:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> , found this <a href="https://docs.oracle.com/cd/E19509-01/820-6323/gicxk/index.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.oracle.com/cd/E19509-01/820-6323/gicxk/index.html</a>, modified my.ini, your so pissy, where you abused as a child?</p>
]]></description><link>https://forum.qt.io/post/683473</link><guid isPermaLink="true">https://forum.qt.io/post/683473</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Mon, 04 Oct 2021 16:01:29 GMT</pubDate></item><item><title><![CDATA[Reply to QSqlQuery, addBindValue, LargeBlob problem? on Mon, 04 Oct 2021 16:01:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a> said in <a href="/post/683469">QSqlQuery, addBindValue, LargeBlob problem?</a>:</p>
<blockquote>
<p dir="auto">'max_allowed_packet' bytes</p>
</blockquote>
<p dir="auto">Configuration of the server doesn't permit the size you send.</p>
]]></description><link>https://forum.qt.io/post/683472</link><guid isPermaLink="true">https://forum.qt.io/post/683472</guid><dc:creator><![CDATA[artwaw]]></dc:creator><pubDate>Mon, 04 Oct 2021 16:01:26 GMT</pubDate></item><item><title><![CDATA[Reply to QSqlQuery, addBindValue, LargeBlob problem? on Mon, 04 Oct 2021 16:00:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a> said in <a href="/post/683469">QSqlQuery, addBindValue, LargeBlob problem?</a>:</p>
<blockquote>
<p dir="auto">max_allowed_packet</p>
</blockquote>
<p dir="auto">So hard to search for <code>HeideSQL max_allowed_packet</code>? The first hit gives you the config option...</p>
]]></description><link>https://forum.qt.io/post/683470</link><guid isPermaLink="true">https://forum.qt.io/post/683470</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Mon, 04 Oct 2021 16:00:43 GMT</pubDate></item><item><title><![CDATA[Reply to QSqlQuery, addBindValue, LargeBlob problem? on Mon, 04 Oct 2021 15:56:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/artwaw">@<bdi>artwaw</bdi></a> , the message that appears in dialog:</p>
<pre><code>Lost connection to MySQL server during query QMYSQL3: Unable to execute statement
</code></pre>
<p dir="auto">And from the event viewer Application:</p>
<pre><code>Aborted connection 3 to db: 'training' host: 'localhost' (Got a packet bigger than 'max_allowed_packet' bytes)
</code></pre>
<p dir="auto">However in my code I check the array size for &lt; ULONG_MAX which is 4GB before I try to submit it.</p>
]]></description><link>https://forum.qt.io/post/683469</link><guid isPermaLink="true">https://forum.qt.io/post/683469</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Mon, 04 Oct 2021 15:56:16 GMT</pubDate></item><item><title><![CDATA[Reply to QSqlQuery, addBindValue, LargeBlob problem? on Mon, 04 Oct 2021 15:51:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/artwaw">@<bdi>artwaw</bdi></a> , it will vary, to begin with I'm using small examples, see the size in the post: 34390236</p>
]]></description><link>https://forum.qt.io/post/683468</link><guid isPermaLink="true">https://forum.qt.io/post/683468</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Mon, 04 Oct 2021 15:51:32 GMT</pubDate></item><item><title><![CDATA[Reply to QSqlQuery, addBindValue, LargeBlob problem? on Mon, 04 Oct 2021 15:50:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a> How large is the blob in your case? I think I remember reading the advice about large blobs in MariaDB that one should be careful since it is easy to run of memory in the stack or something.<br />
In other words: might be it is worth to change to <code>QSqlQuery *queryBlock = new QSqlQuery()</code> etc. Again, one of the possibilities, I am not certain what fails there.</p>
]]></description><link>https://forum.qt.io/post/683467</link><guid isPermaLink="true">https://forum.qt.io/post/683467</guid><dc:creator><![CDATA[artwaw]]></dc:creator><pubDate>Mon, 04 Oct 2021 15:50:04 GMT</pubDate></item><item><title><![CDATA[Reply to QSqlQuery, addBindValue, LargeBlob problem? on Mon, 04 Oct 2021 15:46:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/artwaw">@<bdi>artwaw</bdi></a>, MariaDB certainly supports LARGEBLOB, no errors in HeidiSQL, so it could be the SQL driver I guess...</p>
]]></description><link>https://forum.qt.io/post/683466</link><guid isPermaLink="true">https://forum.qt.io/post/683466</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Mon, 04 Oct 2021 15:46:42 GMT</pubDate></item><item><title><![CDATA[Reply to QSqlQuery, addBindValue, LargeBlob problem? on Mon, 04 Oct 2021 15:45:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a> said in <a href="/post/683464">QSqlQuery, addBindValue, LargeBlob problem?</a>:</p>
<blockquote>
<p dir="auto">is there anyway I can find out</p>
</blockquote>
<p dir="auto">Documentation to both, I suppose?</p>
]]></description><link>https://forum.qt.io/post/683465</link><guid isPermaLink="true">https://forum.qt.io/post/683465</guid><dc:creator><![CDATA[artwaw]]></dc:creator><pubDate>Mon, 04 Oct 2021 15:45:54 GMT</pubDate></item><item><title><![CDATA[Reply to QSqlQuery, addBindValue, LargeBlob problem? on Mon, 04 Oct 2021 15:45:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/artwaw">@<bdi>artwaw</bdi></a> , is there anyway I can find out?  I'm using HeidiSQL to review the database and that looks ok.</p>
]]></description><link>https://forum.qt.io/post/683464</link><guid isPermaLink="true">https://forum.qt.io/post/683464</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Mon, 04 Oct 2021 15:45:30 GMT</pubDate></item><item><title><![CDATA[Reply to QSqlQuery, addBindValue, LargeBlob problem? on Mon, 04 Oct 2021 15:44:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a> Are you certain that both the DB you are connected to and the driver/connector support such construct? My gut feeling would be that id DB supports the driver has a problem.</p>
]]></description><link>https://forum.qt.io/post/683463</link><guid isPermaLink="true">https://forum.qt.io/post/683463</guid><dc:creator><![CDATA[artwaw]]></dc:creator><pubDate>Mon, 04 Oct 2021 15:44:17 GMT</pubDate></item></channel></rss>