Skip to content

Commit 3cd1864

Browse files
committed
ndbinfo
- add new function on NdbInfoRecAttr that allows direct access to the data pointer and use it from ha_ndbinfo
1 parent 8e28def commit 3cd1864

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

sql/ha_ndbinfo.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,17 +377,13 @@ ha_ndbinfo::unpack_record(uchar *dst_row)
377377

378378
case (MYSQL_TYPE_LONG):
379379
{
380-
Uint32 val = record->u_32_value();
381-
DBUG_PRINT("info", ("val: %d", val));
382-
memcpy(field->ptr, &val, sizeof (Uint32));
380+
memcpy(field->ptr, record->ptr(), sizeof(Uint32));
383381
break;
384382
}
385383

386384
case (MYSQL_TYPE_LONGLONG):
387385
{
388-
Uint64 val = record->u_64_value();
389-
DBUG_PRINT("info", ("val: %llu", val));
390-
memcpy(field->ptr, &val, sizeof (Uint64));
386+
memcpy(field->ptr, record->ptr(), sizeof(Uint64));
391387
break;
392388
}
393389

storage/ndb/src/ndbapi/NdbInfoRecAttr.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
class NdbInfoRecAttr {
2323
public:
24+
const void* ptr() const {
25+
return m_data;
26+
}
27+
2428
Uint32 u_32_value() const {
2529
assert(m_len == sizeof(Uint32));
2630
return *((Uint32 *) m_data);

0 commit comments

Comments
 (0)