~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbms/src/events_ms.cc

  • Committer: Marisa Plumb
  • Date: 2010-12-04 02:38:29 UTC
  • mto: This revision was merged to the branch mainline in revision 1984.
  • Revision ID: marisa.plumb@gmail.com-20101204023829-2khzxh30wxi256db
updates to a few sql docs 

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 * 2010-06-01
20
20
 */
21
21
 
22
 
#include <config.h>
 
22
#include "config.h"
23
23
#include <string>
24
24
#include <inttypes.h>
25
25
 
90
90
                }
91
91
                
92
92
                // Signal PBMS to delete the reference to the BLOB.
93
 
                err = MSEngine::referenceBlob(data.table.getSchemaName(), data.table.getTableName(), &blob_url_buffer, blob_url, field->position(), &result);
 
93
                err = MSEngine::referenceBlob(data.table.getSchemaName(), data.table.getTableName(), &blob_url_buffer, blob_url, field->field_index, &result);
94
94
                if (err) {
95
95
                        // If it fails log the error and continue to try and release any other BLOBs in the row.
96
96
                        fprintf(stderr, "PBMSEvents: referenceBlob(\"%s.%s\", \"%s\" ) error (%d):'%s'\n", 
206
206
        }
207
207
        
208
208
        // Tell PBMS to add a reference to the BLOB.
209
 
        err = MSEngine::referenceBlob(db, table_name, &blob_url_buffer, blob_url, field->position(), &result);
 
209
        err = MSEngine::referenceBlob(db, table_name, &blob_url_buffer, blob_url, field->field_index, &result);
210
210
        if (err) {
211
211
                // If it fails log the error and continue to try and release any other BLOBs in the row.
212
212
                fprintf(stderr, "PBMSEvents: referenceBlob(\"%s.%s\", \"%s\" ) error (%d):'%s'\n", 
222
222
                char *blob = possible_blob_url; // This is the BLOB as the server currently sees it.
223
223
                
224
224
                if (length != org_length) {
225
 
                        field->store_length(blob_rec, packlength);
 
225
                        field->store_length(blob_rec, packlength, length);
226
226
                }
227
227
                
228
228
                if (length > org_length) {
229
229
                        // This can only happen if the BLOB URL is actually larger than the BLOB itself.
230
 
                        blob = (char *) session.getMemRoot()->allocate(length);
 
230
                        blob = (char *) session.alloc(length);
231
231
                        memcpy(blob_rec+packlength, &blob, sizeof(char*));
232
232
                }                       
233
233
                memcpy(blob, blob_url_buffer.bu_data, length);