Commit bec2f66c authored by unknown's avatar unknown

Compile fixes for NDB on Solaris and HP-UX, provided by Tomas and Jonas, re-applied in new tree.

parent 835426ce
...@@ -59,7 +59,7 @@ struct Local_key ...@@ -59,7 +59,7 @@ struct Local_key
Uint32 ref() const { return (m_page_no << MAX_TUPLES_BITS) | m_page_idx ;} Uint32 ref() const { return (m_page_no << MAX_TUPLES_BITS) | m_page_idx ;}
Local_key& operator= (Uint32 ref) { Local_key& assref (Uint32 ref) {
m_page_no =ref >> MAX_TUPLES_BITS; m_page_no =ref >> MAX_TUPLES_BITS;
m_page_idx = ref & MAX_TUPLES_PER_PAGE; m_page_idx = ref & MAX_TUPLES_PER_PAGE;
return *this; return *this;
......
...@@ -153,7 +153,7 @@ void Dbtup::execTUP_ABORTREQ(Signal* signal) ...@@ -153,7 +153,7 @@ void Dbtup::execTUP_ABORTREQ(Signal* signal)
Ptr<Var_page> vpage; Ptr<Var_page> vpage;
Uint32 ref= * tuple_ptr->get_var_part_ptr(regTabPtr.p); Uint32 ref= * tuple_ptr->get_var_part_ptr(regTabPtr.p);
Local_key tmp; Local_key tmp;
tmp=ref; tmp.assref(ref);
sz= 0; sz= 0;
idx= tmp.m_page_idx; idx= tmp.m_page_idx;
......
...@@ -210,7 +210,7 @@ Dbtup::commit_operation(Signal* signal, ...@@ -210,7 +210,7 @@ Dbtup::commit_operation(Signal* signal,
Uint32 *ref= tuple_ptr->get_var_part_ptr(regTabPtr); Uint32 *ref= tuple_ptr->get_var_part_ptr(regTabPtr);
memcpy(tuple_ptr, copy, 4*(Tuple_header::HeaderSize+fix_size)); memcpy(tuple_ptr, copy, 4*(Tuple_header::HeaderSize+fix_size));
Local_key tmp; tmp= *ref; Local_key tmp; tmp.assref(*ref);
if(0) printf("%p %d %d (%d bytes) - ref: %x ", tuple_ptr, if(0) printf("%p %d %d (%d bytes) - ref: %x ", tuple_ptr,
regOperPtr->m_tuple_location.m_page_no, regOperPtr->m_tuple_location.m_page_no,
regOperPtr->m_tuple_location.m_page_idx, regOperPtr->m_tuple_location.m_page_idx,
......
...@@ -976,7 +976,7 @@ Dbtup::disk_page_undo_alloc(Page* page, const Local_key* key, ...@@ -976,7 +976,7 @@ Dbtup::disk_page_undo_alloc(Page* page, const Local_key* key,
Logfile_client::Change c[1] = {{ &alloc, sizeof(alloc) >> 2 } }; Logfile_client::Change c[1] = {{ &alloc, sizeof(alloc) >> 2 } };
Uint64 lsn= lsman.add_entry<1>(c); Uint64 lsn= lsman.add_entry(c, 1);
m_pgman.update_lsn(* key, lsn); m_pgman.update_lsn(* key, lsn);
return lsn; return lsn;
...@@ -1005,7 +1005,7 @@ Dbtup::disk_page_undo_update(Page* page, const Local_key* key, ...@@ -1005,7 +1005,7 @@ Dbtup::disk_page_undo_update(Page* page, const Local_key* key,
ndbassert(4*(3 + sz + 1) == (sizeof(update) + 4*sz - 4)); ndbassert(4*(3 + sz + 1) == (sizeof(update) + 4*sz - 4));
Uint64 lsn= lsman.add_entry<3>(c); Uint64 lsn= lsman.add_entry(c, 3);
m_pgman.update_lsn(* key, lsn); m_pgman.update_lsn(* key, lsn);
return lsn; return lsn;
...@@ -1034,7 +1034,7 @@ Dbtup::disk_page_undo_free(Page* page, const Local_key* key, ...@@ -1034,7 +1034,7 @@ Dbtup::disk_page_undo_free(Page* page, const Local_key* key,
ndbassert(4*(3 + sz + 1) == (sizeof(free) + 4*sz - 4)); ndbassert(4*(3 + sz + 1) == (sizeof(free) + 4*sz - 4));
Uint64 lsn= lsman.add_entry<3>(c); Uint64 lsn= lsman.add_entry(c, 3);
m_pgman.update_lsn(* key, lsn); m_pgman.update_lsn(* key, lsn);
return lsn; return lsn;
......
...@@ -2811,7 +2811,7 @@ Dbtup::validate_page(Tablerec* regTabPtr, Var_page* p) ...@@ -2811,7 +2811,7 @@ Dbtup::validate_page(Tablerec* regTabPtr, Var_page* p)
if(ptr->m_header_bits & Tuple_header::CHAINED_ROW) if(ptr->m_header_bits & Tuple_header::CHAINED_ROW)
{ {
assert(len == fix_sz + 1); assert(len == fix_sz + 1);
Local_key tmp; tmp= *part; Local_key tmp; tmp.assref(*part);
Ptr<Var_page> tmpPage; Ptr<Var_page> tmpPage;
part= get_ptr(&tmpPage, *(Var_part_ref*)part); part= get_ptr(&tmpPage, *(Var_part_ref*)part);
len= tmpPage.p->get_entry_len(tmp.m_page_idx); len= tmpPage.p->get_entry_len(tmp.m_page_idx);
...@@ -2896,7 +2896,7 @@ Dbtup::handle_size_change_after_update(KeyReqStruct* req_struct, ...@@ -2896,7 +2896,7 @@ Dbtup::handle_size_change_after_update(KeyReqStruct* req_struct,
else else
{ {
Local_key tmp; Local_key tmp;
tmp= *org->get_var_part_ptr(regTabPtr); tmp.assref(*org->get_var_part_ptr(regTabPtr));
idx= tmp.m_page_idx; idx= tmp.m_page_idx;
alloc= pageP->get_entry_len(idx) & ~Var_page::CHAIN; alloc= pageP->get_entry_len(idx) & ~Var_page::CHAIN;
if(!(pageP->get_entry_len(idx) & Var_page::CHAIN)) if(!(pageP->get_entry_len(idx) & Var_page::CHAIN))
......
...@@ -604,7 +604,7 @@ Dbtup::undo_createtable_callback(Signal* signal, Uint32 opPtrI, Uint32 unused) ...@@ -604,7 +604,7 @@ Dbtup::undo_createtable_callback(Signal* signal, Uint32 opPtrI, Uint32 unused)
Logfile_client::Change c[1] = {{ &create, sizeof(create) >> 2 } }; Logfile_client::Change c[1] = {{ &create, sizeof(create) >> 2 } };
Uint64 lsn= lsman.add_entry<1>(c); Uint64 lsn= lsman.add_entry(c, 1);
signal->theData[0] = fragOperPtr.p->lqhPtrFrag; signal->theData[0] = fragOperPtr.p->lqhPtrFrag;
signal->theData[1] = 1; signal->theData[1] = 1;
......
...@@ -1882,9 +1882,8 @@ Lgman::free_log_space(Uint32 ref, Uint32 words) ...@@ -1882,9 +1882,8 @@ Lgman::free_log_space(Uint32 ref, Uint32 words)
return -1; return -1;
} }
template<Uint32 cnt>
Uint64 Uint64
Logfile_client::add_entry(const Change* src) Logfile_client::add_entry(const Change* src, Uint32 cnt)
{ {
Uint32 i, tot= 0; Uint32 i, tot= 0;
for(i= 0; i<cnt; i++) for(i= 0; i<cnt; i++)
...@@ -1937,9 +1936,6 @@ Logfile_client::add_entry(const Change* src) ...@@ -1937,9 +1936,6 @@ Logfile_client::add_entry(const Change* src)
} }
} }
template Uint64 Logfile_client::add_entry<1>(const Change*);
template Uint64 Logfile_client::add_entry<3>(const Change*);
void void
Lgman::execSTART_RECREQ(Signal* signal) Lgman::execSTART_RECREQ(Signal* signal)
{ {
......
...@@ -320,7 +320,7 @@ public: ...@@ -320,7 +320,7 @@ public:
}; };
Uint64 add_entry(const void*, Uint32 len); Uint64 add_entry(const void*, Uint32 len);
template<Uint32 cnt> Uint64 add_entry(const Change*); Uint64 add_entry(const Change*, Uint32 cnt);
Uint64 add_entry(Local_key, void * base, Change*); Uint64 add_entry(Local_key, void * base, Change*);
Uint64 add_entry(Local_key, Uint32 off, Uint32 change); Uint64 add_entry(Local_key, Uint32 off, Uint32 change);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment