1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2026-02-14 02:07:14 +01:00

More MySQL implementation.

This commit is contained in:
Sandu Liviu Catalin
2016-06-05 05:36:33 +03:00
parent 3affe10c35
commit 0d6e80a9d5
5 changed files with 109 additions and 15 deletions

View File

@@ -58,55 +58,127 @@ SQInteger ResultSet::GetInt8(Uint32 idx) const
// ------------------------------------------------------------------------------------------------
SQInteger ResultSet::GetUint8(Uint32 idx) const
{
// Validate the managed handle and specified index
m_Handle.ValidateIndex(idx);
// Should we retrieve the value from the bind wrapper?
if (m_Handle->mStatement)
{
return ConvTo< Uint8 >::From(m_Handle->mBinds[idx].mInt64);
}
// Retrieve the value directly from the row
return ConvTo< Uint8 >::From(*reinterpret_cast< Uint8 ** >(m_Handle->mRow)[idx]);
}
// ------------------------------------------------------------------------------------------------
SQInteger ResultSet::GetInt16(Uint32 idx) const
{
// Validate the managed handle and specified index
m_Handle.ValidateIndex(idx);
// Should we retrieve the value from the bind wrapper?
if (m_Handle->mStatement)
{
return ConvTo< Int16 >::From(m_Handle->mBinds[idx].mInt64);
}
// Retrieve the value directly from the row
return ConvTo< Int16 >::From(*reinterpret_cast< Int16 ** >(m_Handle->mRow)[idx]);
}
// ------------------------------------------------------------------------------------------------
SQInteger ResultSet::GetUint16(Uint32 idx) const
{
// Validate the managed handle and specified index
m_Handle.ValidateIndex(idx);
// Should we retrieve the value from the bind wrapper?
if (m_Handle->mStatement)
{
return ConvTo< Uint16 >::From(m_Handle->mBinds[idx].mInt64);
}
// Retrieve the value directly from the row
return ConvTo< Uint16 >::From(*reinterpret_cast< Uint16 ** >(m_Handle->mRow)[idx]);
}
// ------------------------------------------------------------------------------------------------
SQInteger ResultSet::GetInt32(Uint32 idx) const
{
// Validate the managed handle and specified index
m_Handle.ValidateIndex(idx);
// Should we retrieve the value from the bind wrapper?
if (m_Handle->mStatement)
{
return ConvTo< Int32 >::From(m_Handle->mBinds[idx].mInt64);
}
// Retrieve the value directly from the row
return ConvTo< Int32 >::From(*reinterpret_cast< Int32 ** >(m_Handle->mRow)[idx]);
}
// ------------------------------------------------------------------------------------------------
SQInteger ResultSet::GetUint32(Uint32 idx) const
{
// Validate the managed handle and specified index
m_Handle.ValidateIndex(idx);
// Should we retrieve the value from the bind wrapper?
if (m_Handle->mStatement)
{
return ConvTo< Uint32 >::From(m_Handle->mBinds[idx].mInt64);
}
// Retrieve the value directly from the row
return ConvTo< Uint32 >::From(*reinterpret_cast< Uint32 ** >(m_Handle->mRow)[idx]);
}
// ------------------------------------------------------------------------------------------------
Object ResultSet::GetInt64(Uint32 idx) const
Int64 ResultSet::GetInt64(Uint32 idx) const
{
// Validate the managed handle and specified index
m_Handle.ValidateIndex(idx);
// Should we retrieve the value from the bind wrapper?
if (m_Handle->mStatement)
{
return ConvTo< Int64 >::From(m_Handle->mBinds[idx].mInt64);
}
// Retrieve the value directly from the row
return ConvTo< Int64 >::From(*reinterpret_cast< Int64 ** >(m_Handle->mRow)[idx]);
}
// ------------------------------------------------------------------------------------------------
Object ResultSet::GetUint64(Uint32 idx) const
Uint64 ResultSet::GetUint64(Uint32 idx) const
{
// Validate the managed handle and specified index
m_Handle.ValidateIndex(idx);
// Should we retrieve the value from the bind wrapper?
if (m_Handle->mStatement)
{
return ConvTo< Uint64 >::From(m_Handle->mBinds[idx].mInt64);
}
// Retrieve the value directly from the row
return ConvTo< Uint64 >::From(*reinterpret_cast< Uint64 ** >(m_Handle->mRow)[idx]);
}
// ------------------------------------------------------------------------------------------------
SQFloat ResultSet::GetFloat32(Uint32 idx) const
{
// Validate the managed handle and specified index
m_Handle.ValidateIndex(idx);
// Should we retrieve the value from the bind wrapper?
if (m_Handle->mStatement)
{
return ConvTo< Float32 >::From(m_Handle->mBinds[idx].mInt64);
}
// Retrieve the value directly from the row
return ConvTo< Float32 >::From(*reinterpret_cast< Float32 ** >(m_Handle->mRow)[idx]);
}
// ------------------------------------------------------------------------------------------------
SQFloat ResultSet::GetFloat64(Uint32 idx) const
{
// Validate the managed handle and specified index
m_Handle.ValidateIndex(idx);
// Should we retrieve the value from the bind wrapper?
if (m_Handle->mStatement)
{
return ConvTo< Float64 >::From(m_Handle->mBinds[idx].mInt64);
}
// Retrieve the value directly from the row
return ConvTo< Float64 >::From(*reinterpret_cast< Float64 ** >(m_Handle->mRow)[idx]);
}
// ------------------------------------------------------------------------------------------------