Date: Monday, March 20, 2006 @ 13:55:07
Author: marc
Path: /cvsroot/carob/odbsequoia/src
Modified: descriptors_records.hpp (1.6 -> 1.7)
Made concise_type protected instead of private.
Properly documented octet_length, octet_length_ptr and indicator_ptr
-------------------------+
descriptors_records.hpp | 37 +++++++++++++++++++++++++++----------
1 files changed, 27 insertions(+), 10 deletions(-)
Index: odbsequoia/src/descriptors_records.hpp
diff -u odbsequoia/src/descriptors_records.hpp:1.6
odbsequoia/src/descriptors_records.hpp:1.7
--- odbsequoia/src/descriptors_records.hpp:1.6 Wed Mar 8 21:04:32 2006
+++ odbsequoia/src/descriptors_records.hpp Mon Mar 20 13:55:07 2006
@@ -42,11 +42,17 @@
{
public:
// Very simple fields are public to avoid cluttering the code with
- // getters/setters You did not believe descriptors and records
+ // getters/setters. You did not believe descriptors and records
// classes are well separated by a clear interface, did you?
- /** Length of the SQL data buffer allocated by the ODBC
- * application */
+ /** For AppDescRecords, this is the length of the SQL data buffer
+ * (*data_ptr) allocated by the application, including the
+ * null-termination character SQL_NTS if any. octet_length is
+ * usually ignored for fixed-length SQL data.
+ *
+ * For ImplDescRecords, this is probably the length of the SQL
+ * data BEFORE conversion? EXCLUDING the SQL_NTS if any.
+ */
SQLINTEGER octet_length;
/** Sets the concise type as well as all other interdependent fields */
@@ -55,8 +61,8 @@
virtual ~BaseDescRecord() { }
-private:
- // Those are private because we want to enforce some consistency.
+protected:
+ // Those are protected because we want to enforce some consistency.
// concise = type + datetime_interval_code, see
// table in "Data Type Identifiers and Descriptors" ODBC page.
SQLSMALLINT concise_type;
@@ -83,16 +89,27 @@
public: // public to avoid cluttering the code with getters/setters
/** The SQL data buffer allocated by the application */
SQLPOINTER data_ptr;
+ /** Pointer to an SQLINTEGER storing the _actual_ (not max) length
+ of the converted SQL data, BEFORE truncation, EXCLUDING
+ the final SQL_NTS if any. This SQLINTEGER belongs to the
+ application. Warnings: this pointer is allowed to be null in
+ some cases. The pointed-to value can also be SQL_NTS,
+ SQL_NO_TOTAL, SQL_NULL_DATA, or other miscellaneous indicating
+ values instead of the data length in some cases. See below. */
+ SQLINTEGER * octet_length_ptr;
/** Application buffer to return indicator (like SQL_NULL_DATA).
- Warning: null is allowed. Check SQLBindCol() documentation */
+ This pointer is usually equal to octet_length_ptr above, but
+ the application can provide different buffers when it wants to
+ make the life of the driver more nightmar-ish. See section 2.3
+ of the X/Open standard, as well as documentation of
+ SQLBindCol(), SQLBindParam(), SQLFetch() and
+ SQLSetDescField(). */
SQLINTEGER * indicator_ptr;
- /** Application buffer to return length of SQL data. Warning: null
- is allowed. Check SQLBindCol() documentation */
- SQLINTEGER * octet_length_ptr;
};
-/** Abstract class for records of Implementation Descriptors */
+/** Abstract class for records of Implementation Descriptors. Unused
+ * for now. */
class ImplDescRecord : public BaseDescRecord
{
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits