29 #include "data0type.ic"
32 #ifndef UNIV_HOTBACKUP
40 UNIV_INTERN ulint data_mysql_default_charset_coll;
61 ulint mbminlen = DATA_MBMINLEN(mbminmaxlen);
62 ulint mbmaxlen = DATA_MBMAXLEN(mbminmaxlen);
64 ut_a(data_len != UNIV_SQL_NULL);
65 ut_ad(!mbmaxlen || !(prefix_len % mbmaxlen));
67 if (mbminlen != mbmaxlen) {
68 ut_a(!(prefix_len % mbmaxlen));
71 prefix_len, data_len, str));
74 if (prefix_len < data_len) {
94 if (mtype <= DATA_BLOB
95 || mtype == DATA_MYSQL
96 || mtype == DATA_VARMYSQL) {
116 if ((mtype == DATA_FIXBINARY)
117 || (mtype == DATA_BINARY)
118 || (mtype == DATA_BLOB && (prtype & DATA_BINARY_TYPE))) {
160 ut_a(old_prtype < 256 * 256);
161 ut_a(charset_coll <= MAX_CHAR_COLL_NUM);
163 return(old_prtype + (charset_coll << 16));
179 if (type->
mtype == DATA_SYS) {
180 ut_a((type->
prtype & DATA_MYSQL_TYPE_MASK) < DATA_N_SYS_COLS);
183 #ifndef UNIV_HOTBACKUP
190 #ifndef UNIV_HOTBACKUP
210 fputs(
"DATA_VARCHAR", stderr);
214 fputs(
"DATA_CHAR", stderr);
218 fputs(
"DATA_BINARY", stderr);
222 fputs(
"DATA_FIXBINARY", stderr);
226 fputs(
"DATA_BLOB", stderr);
230 fputs(
"DATA_INT", stderr);
234 fputs(
"DATA_MYSQL", stderr);
238 fputs(
"DATA_SYS", stderr);
242 fputs(
"DATA_FLOAT", stderr);
246 fputs(
"DATA_DOUBLE", stderr);
250 fputs(
"DATA_DECIMAL", stderr);
254 fputs(
"DATA_VARMYSQL", stderr);
258 fprintf(stderr,
"type %lu", (ulong) mtype);
264 if ((type->
mtype == DATA_SYS)
265 || (type->
mtype == DATA_VARCHAR)
266 || (type->
mtype == DATA_CHAR)) {
268 if (prtype == DATA_ROW_ID) {
269 fputs(
"DATA_ROW_ID", stderr);
270 len = DATA_ROW_ID_LEN;
271 }
else if (prtype == DATA_ROLL_PTR) {
272 fputs(
"DATA_ROLL_PTR", stderr);
273 len = DATA_ROLL_PTR_LEN;
274 }
else if (prtype == DATA_TRX_ID) {
275 fputs(
"DATA_TRX_ID", stderr);
276 len = DATA_TRX_ID_LEN;
277 }
else if (prtype == DATA_ENGLISH) {
278 fputs(
"DATA_ENGLISH", stderr);
280 fprintf(stderr,
"prtype %lu", (ulong) prtype);
283 if (prtype & DATA_UNSIGNED) {
284 fputs(
" DATA_UNSIGNED", stderr);
287 if (prtype & DATA_BINARY_TYPE) {
288 fputs(
" DATA_BINARY_TYPE", stderr);
291 if (prtype & DATA_NOT_NULL) {
292 fputs(
" DATA_NOT_NULL", stderr);
296 fprintf(stderr,
" len %lu", (ulong) len);