| 1114 | } |
| 1115 | |
| 1116 | static bool |
| 1117 | set_conversion_functions(Prepared_statement *stmt, uchar **data) |
| 1118 | { |
| 1119 | uchar *read_pos= *data; |
| 1120 | |
| 1121 | DBUG_ENTER("set_conversion_functions"); |
| 1122 | /* |
| 1123 | First execute or types altered by the client, setup the |
| 1124 | conversion routines for all parameters (one time) |
| 1125 | */ |
| 1126 | Item_param **it= stmt->param_array; |
| 1127 | Item_param **end= it + stmt->param_count; |
| 1128 | THD *thd= stmt->thd; |
| 1129 | for (; it < end; ++it) |
| 1130 | { |
| 1131 | ushort typecode; |
| 1132 | |
| 1133 | /* |
| 1134 | stmt_execute_packet_sanity_check has already verified, that there |
| 1135 | are enough data in the packet for data types |
| 1136 | */ |
| 1137 | typecode= sint2korr(read_pos); |
| 1138 | read_pos+= 2; |
| 1139 | if (parameter_type_sanity_check(typecode)) |
| 1140 | { |
| 1141 | DBUG_RETURN(1); |
| 1142 | } |
| 1143 | (**it).unsigned_flag= MY_TEST(typecode & PARAMETER_FLAG_UNSIGNED); |
| 1144 | (*it)->setup_conversion(thd, (uchar) (typecode & 0xff)); |
| 1145 | (*it)->sync_clones(); |
| 1146 | } |
| 1147 | *data= read_pos; |
| 1148 | DBUG_RETURN(0); |
| 1149 | } |
| 1150 | |
| 1151 | |
| 1152 | static bool setup_conversion_functions(Prepared_statement *stmt, |
no test coverage detected