Skip to content

Instantly share code, notes, and snippets.

@yoku0825
Created April 8, 2024 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoku0825/9db4ac205b607fd538aab5c384c7290b to your computer and use it in GitHub Desktop.
Save yoku0825/9db4ac205b607fd538aab5c384c7290b to your computer and use it in GitHub Desktop.
Warning (Code 3170): Memory capacity of 5120 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query.
Breakpoint 1, push_warning_printf (thd=thd@entry=0x7f7244b6dd30, severity=severity@entry=Sql_condition::SL_WARNING, code=code@entry=3170,
format=0x7f729d06a9a4 "Memory capacity of %llu bytes for '%s' exceeded. %s") at /home/yoku0825/mysql-8.0.36/sql/sql_error.cc:692
692 if (format == nullptr) format = ER_THD_NONCONST(thd, code);
(gdb) bt
+bt
#0 push_warning_printf (thd=thd@entry=0x7f7244b6dd30, severity=severity@entry=Sql_condition::SL_WARNING, code=code@entry=3170,
format=0x7f729d06a9a4 "Memory capacity of %llu bytes for '%s' exceeded. %s") at /home/yoku0825/mysql-8.0.36/sql/sql_error.cc:692
#1 0x0000000000ce4123 in handle_condition (sql_errno=34, level=<optimized out>, thd=0x7f7244b6dd30, this=<optimized out>)
at /home/yoku0825/mysql-8.0.36/sql/range_optimizer/internal.h:90
#2 Range_optimizer_error_handler::handle_condition (this=<optimized out>, thd=0x7f7244b6dd30, sql_errno=<optimized out>, level=<optimized out>)
at /home/yoku0825/mysql-8.0.36/sql/range_optimizer/internal.h:79
#3 0x0000000000d33a89 in THD::handle_condition (this=this@entry=0x7f7244b6dd30, sql_errno=sql_errno@entry=34, sqlstate=sqlstate@entry=0x2feadfb "HY000",
level=level@entry=0x7f72985cd0ac, msg=msg@entry=0x7f72985cd180 "Memory capacity exceeded (capacity 5120 bytes)")
at /home/yoku0825/mysql-8.0.36/sql/sql_class.cc:904
#4 0x0000000000d33b87 in THD::raise_condition (this=0x7f7244b6dd30, sql_errno=sql_errno@entry=34, sqlstate=0x2feadfb "HY000", sqlstate@entry=0x0,
level=<optimized out>, level@entry=Sql_condition::SL_ERROR, msg=msg@entry=0x7f72985cd180 "Memory capacity exceeded (capacity 5120 bytes)",
fatal_error=fatal_error@entry=false) at /home/yoku0825/mysql-8.0.36/sql/sql_class.cc:1007
#5 0x0000000000ca9f66 in my_message_sql () at /home/yoku0825/mysql-8.0.36/sql/mysqld.cc:3800
#6 0x000000000206dcd9 in my_error (nr=nr@entry=34, MyFlags=MyFlags@entry=0) at /opt/rh/devtoolset-11/root/usr/include/c++/11/bits/atomic_base.h:836
#7 0x000000000206c179 in MEM_ROOT::AllocBlock (this=this@entry=0x7f72985ce170, wanted_length=6144, minimum_length=<optimized out>)
at /home/yoku0825/mysql-8.0.36/mysys/my_alloc.cc:71
#8 0x000000000206c1c0 in MEM_ROOT::ForceNewBlock (this=0x7f72985ce170, minimum_length=<optimized out>) at /home/yoku0825/mysql-8.0.36/mysys/my_alloc.cc:156
#9 0x000000000206c245 in MEM_ROOT::AllocSlow (this=this@entry=0x7f72985ce170, length=length@entry=88) at /home/yoku0825/mysql-8.0.36/mysys/my_alloc.cc:143
#10 0x00000000012623d5 in Alloc (length=88, this=0x7f72985ce170) at /home/yoku0825/mysql-8.0.36/include/my_alloc.h:164
#11 operator new (arg=<optimized out>, mem_root=0x7f72985ce170, size=88) at /home/yoku0825/mysql-8.0.36/include/my_alloc.h:438
#12 get_mm_leaf(THD*, RANGE_OPT_PARAM*, Item*, Field*, KEY_PART*, Item_func::Functype, Item*, bool*) ()
at /home/yoku0825/mysql-8.0.36/sql/range_optimizer/range_analysis.cc:1587
#13 0x000000000126283c in get_mm_parts (thd=thd@entry=0x7f7244b6dd30, param=param@entry=0x7f72985cddf0, prev_tables=prev_tables@entry=2305843009213693952,
read_tables=read_tables@entry=2305843009213693952, cond_func=cond_func@entry=0x7f72451706f8, field=field@entry=0x7f7244c73870, type=Item_func::EQ_FUNC,
value=<optimized out>) at /home/yoku0825/mysql-8.0.36/sql/range_optimizer/range_analysis.cc:1103
#14 0x0000000001263e0e in get_mm_parts (value=<optimized out>, type=Item_func::EQ_FUNC, field=0x7f7244c73870, cond_func=0x7f72451706f8,
read_tables=2305843009213693952, prev_tables=2305843009213693952, param=0x7f72985cddf0, thd=0x7f7244b6dd30)
at /home/yoku0825/mysql-8.0.36/sql/range_optimizer/range_analysis.cc:1081
#15 get_func_mm_tree_from_in_predicate (is_negated=<optimized out>, op=0x7f72451706f8, predicand=0x7f724511ef80, remove_jump_scans=<optimized out>,
read_tables=2305843009213693952, prev_tables=2305843009213693952, param=0x7f72985cddf0, thd=0x7f7244b6dd30)
at /home/yoku0825/mysql-8.0.36/sql/range_optimizer/range_analysis.cc:374
#16 get_func_mm_tree(THD*, RANGE_OPT_PARAM*, unsigned long, unsigned long, bool, Item*, Item_func*, Item*, bool) ()
at /home/yoku0825/mysql-8.0.36/sql/range_optimizer/range_analysis.cc:609
#17 0x000000000126464b in get_full_func_mm_tree (thd=thd@entry=0x7f7244b6dd30, param=param@entry=0x7f72985cddf0,
prev_tables=prev_tables@entry=2305843009213693952, read_tables=read_tables@entry=2305843009213693952, current_table=current_table@entry=1,
remove_jump_scans=remove_jump_scans@entry=true, predicand=0x7f7245173b38, op=0x7f72451706f8, value=0x0, inv=false)
at /home/yoku0825/mysql-8.0.36/sql/range_optimizer/range_analysis.cc:775
#18 0x0000000001264bab in get_mm_tree(THD*, RANGE_OPT_PARAM*, unsigned long, unsigned long, unsigned long, bool, Item*) [clone .localalias] ()
at /home/yoku0825/mysql-8.0.36/sql/range_optimizer/range_analysis.cc:964
#19 0x0000000000ce6298 in test_quick_select(THD*, MEM_ROOT*, MEM_ROOT*, Bitmap<64u>, unsigned long, unsigned long, unsigned long long, bool, enum_order, TABLE*, bool, Item*, Bitmap<64u>*, bool, Query_block*, AccessPath**) () at /home/yoku0825/mysql-8.0.36/sql/table.h:3881
#20 0x0000000000db2b53 in get_quick_record_count (condition=0x7f72451706f8, limit=<optimized out>, tab=0x7f72451792e8, thd=0x7f7244b6dd30)
at /home/yoku0825/mysql-8.0.36/sql/sql_opt_exec_shared.h:503
#21 JOIN::estimate_rowcount() () at /home/yoku0825/mysql-8.0.36/sql/sql_optimizer.cc:5932
#22 0x0000000000dbb6e4 in JOIN::make_join_plan() () at /home/yoku0825/mysql-8.0.36/sql/sql_optimizer.cc:5341
#23 0x0000000000dbdd4a in JOIN::optimize(bool) () at /home/yoku0825/mysql-8.0.36/sql/sql_optimizer.cc:694
#24 0x0000000000e22d7d in Query_block::optimize (this=this@entry=0x7f7245135eb0, thd=thd@entry=0x7f7244b6dd30,
finalize_access_paths=finalize_access_paths@entry=true) at /home/yoku0825/mysql-8.0.36/sql/sql_select.cc:2006
#25 0x0000000000e9f641 in Query_expression::optimize(THD*, TABLE*, bool, bool) () at /home/yoku0825/mysql-8.0.36/sql/sql_union.cc:1006
#26 0x0000000000e21c70 in Sql_cmd_dml::execute_inner (this=0x7f7245174c98, thd=0x7f7244b6dd30) at /home/yoku0825/mysql-8.0.36/sql/sql_select.cc:1007
#27 0x0000000000e21164 in Sql_cmd_dml::execute(THD*) () at /home/yoku0825/mysql-8.0.36/sql/sql_select.cc:793
#28 0x0000000000dc7431 in mysql_execute_command(THD*, bool) () at /home/yoku0825/mysql-8.0.36/sql/sql_parse.cc:4721
#29 0x0000000000dcb0d0 in dispatch_sql_command(THD*, Parser_state*) () at /home/yoku0825/mysql-8.0.36/sql/sql_parse.cc:5370
#30 0x0000000000dcc43e in dispatch_command(THD*, COM_DATA const*, enum_server_command) () at /home/yoku0825/mysql-8.0.36/sql/sql_parse.cc:2054
#31 0x0000000000dce7c7 in do_command (thd=thd@entry=0x7f7244b6dd30) at /home/yoku0825/mysql-8.0.36/sql/sql_parse.cc:1439
#32 0x0000000000f25630 in handle_connection (arg=arg@entry=0x6d44390) at /home/yoku0825/mysql-8.0.36/sql/conn_handler/connection_handler_per_thread.cc:302
#33 0x00000000024fa6c5 in pfs_spawn_thread (arg=0x6dc5630) at /home/yoku0825/mysql-8.0.36/storage/perfschema/pfs.cc:3042
#34 0x00007f72a7aaaea5 in start_thread (arg=0x7f72985d1700) at pthread_create.c:307
#35 0x00007f72a60c4b0d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment