MCPcopy Create free account
hub / github.com/MariaDB/server / set_ok_status

Method set_ok_status

sql/sql_error.cc:351–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349*/
350
351void
352Diagnostics_area::set_ok_status(ulonglong affected_rows,
353 ulonglong last_insert_id,
354 const char *message)
355{
356 DBUG_ENTER("set_ok_status");
357 DBUG_ASSERT(!is_set() || (m_status == DA_OK_BULK && is_bulk_op()));
358 /*
359 In production, refuse to overwrite an error or a custom response
360 with an OK packet.
361 */
362 if (unlikely(is_error() || is_disabled()))
363 DBUG_VOID_RETURN;
364 /*
365 When running a bulk operation, m_status will be DA_OK for the first
366 operation and set to DA_OK_BULK for all following operations.
367 */
368 if (m_status == DA_OK_BULK)
369 {
370 m_statement_warn_count+= current_statement_warn_count();
371 m_affected_rows+= affected_rows;
372 }
373 else
374 {
375 m_statement_warn_count= current_statement_warn_count();
376 m_affected_rows= affected_rows;
377 m_status= (is_bulk_op() ? DA_OK_BULK : DA_OK);
378 }
379 m_last_insert_id= last_insert_id;
380 if (message)
381 strmake_buf(m_message, message);
382 else
383 m_message[0]= '\0';
384 DBUG_VOID_RETURN;
385}
386
387
388/**

Callers 2

executeMethod · 0.80
my_okFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected