diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index e1c8ab5abb4d4776aaaa40071010099009486dd9..6e82812239e3df9ffb1c89c8a97f71939c0011bb 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -1103,6 +1103,9 @@ void Protocol_text::prepare_for_resend()
   data->embedded_info->prev_ptr= &cur->next;
   next_field=cur->data;
   next_mysql_field= data->embedded_info->fields_list;
+#ifndef DBUG_OFF
+  field_pos= 0;
+#endif
 
   DBUG_VOID_RETURN;
 }