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

Function GetSQLCType

storage/connect/odbconn.cpp:95–116  ·  view source on GitHub ↗

/ GetSQLCType: returns the SQL_C_TYPE corresponding to a PLG type. */ /

Source from the content-addressed store, hash-verified

93/* GetSQLCType: returns the SQL_C_TYPE corresponding to a PLG type. */
94/***********************************************************************/
95static int GetSQLCType(int type)
96 {
97 int tp = SQL_TYPE_NULL;
98
99 switch (type) {
100 case TYPE_STRING: tp = SQL_C_CHAR; break;
101 case TYPE_SHORT: tp = SQL_C_SHORT; break;
102 case TYPE_INT: tp = SQL_C_LONG; break;
103 case TYPE_DATE: tp = SQL_C_TIMESTAMP; break;
104 case TYPE_BIGINT: tp = SQL_C_SBIGINT; break;
105 case TYPE_DOUBLE: tp = SQL_C_DOUBLE; break;
106 case TYPE_TINY : tp = SQL_C_TINYINT; break;
107//#if (ODBCVER >= 0x0300)
108// case TYPE_DECIM: tp = SQL_C_NUMERIC; break; (CRASH!!!)
109//#else
110 case TYPE_DECIM: tp = SQL_C_CHAR; break;
111//#endif
112
113 } // endswitch type
114
115 return tp;
116 } // end of GetSQLCType
117
118/***********************************************************************/
119/* TranslateSQLType: translate a SQL Type to a PLG type. */

Callers 3

ExecDirectSQLMethod · 0.85
odbconn.cppFile · 0.85
GetCatInfoMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected