@@ -6239,7 +6239,16 @@ void Item_func_get_system_var::cleanup()
62396239}
62406240
62416241
6242- void Item_func_match::init_search (bool no_order)
6242+ /* *
6243+ Initialize searching within full-text index.
6244+
6245+ @param thd Thread handler
6246+ @param no_order set if FT should not be sorted
6247+
6248+ @returns false if success, true if error
6249+ */
6250+
6251+ bool Item_func_match::init_search (THD *thd, bool no_order)
62436252{
62446253 DBUG_ENTER (" Item_func_match::init_search" );
62456254
@@ -6248,7 +6257,7 @@ void Item_func_match::init_search(bool no_order)
62486257 with fix_field
62496258 */
62506259 if (!fixed)
6251- DBUG_VOID_RETURN ;
6260+ DBUG_RETURN ( false ) ;
62526261
62536262 /* Check if init_search() has been called before */
62546263 if (ft_handler)
@@ -6261,16 +6270,19 @@ void Item_func_match::init_search(bool no_order)
62616270 */
62626271 if (join_key)
62636272 table->file ->ft_handler = ft_handler;
6264- DBUG_VOID_RETURN ;
6273+ DBUG_RETURN ( false ) ;
62656274 }
62666275
62676276 if (key == NO_SUCH_KEY )
62686277 {
62696278 List<Item> fields;
6270- fields.push_back (new Item_string (" " ,1 , cmp_collation.collation ));
6279+ if (fields.push_back (new Item_string (" " ,1 , cmp_collation.collation )))
6280+ DBUG_RETURN (true );
62716281 for (uint i=1 ; i < arg_count; i++)
62726282 fields.push_back (args[i]);
62736283 concat_ws=new Item_func_concat_ws (fields);
6284+ if (concat_ws == NULL )
6285+ DBUG_RETURN (true );
62746286 /*
62756287 Above function used only to get value and do not need fix_fields for it:
62766288 Item_string - basic constant
@@ -6283,10 +6295,13 @@ void Item_func_match::init_search(bool no_order)
62836295 if (master)
62846296 {
62856297 join_key=master->join_key =join_key|master->join_key ;
6286- master->init_search (no_order);
6298+ if (master->init_search (thd, no_order))
6299+ DBUG_RETURN (true );
6300+
62876301 ft_handler=master->ft_handler ;
62886302 join_key=master->join_key ;
6289- DBUG_VOID_RETURN ;
6303+
6304+ DBUG_RETURN (false );
62906305 }
62916306
62926307 String *ft_tmp= 0 ;
@@ -6310,10 +6325,13 @@ void Item_func_match::init_search(bool no_order)
63106325 flags|=FT_SORTED ;
63116326 ft_handler=table->file ->ft_init_ext (flags, key, ft_tmp);
63126327
6328+ if (thd->is_error ())
6329+ DBUG_RETURN (true );
6330+
63136331 if (join_key)
63146332 table->file ->ft_handler =ft_handler;
63156333
6316- DBUG_VOID_RETURN ;
6334+ DBUG_RETURN ( false ) ;
63176335}
63186336
63196337/* *
0 commit comments