Commit graph

36 commits

Author SHA1 Message Date
Mats Kindahl
e409d6f69c WL#5030: Split and remove mysql_priv.h
This patch:

- Moves all definitions from the mysql_priv.h file into
  header files for the component where the variable is
  defined
- Creates header files if the component lacks one
- Eliminates all include directives from mysql_priv.h
- Eliminates all circular include cycles
- Rename time.cc to sql_time.cc
- Rename mysql_priv.h to sql_priv.h
2010-03-31 16:05:33 +02:00
Alexey Kopytov
f10885675c Manual merge of mysql-trunk into mysql-trunk-merge.
Conflicts:

Text conflict in client/mysqlbinlog.cc
Text conflict in mysql-test/Makefile.am
Text conflict in mysql-test/collections/default.daily
Text conflict in mysql-test/r/mysqlbinlog_row_innodb.result
Text conflict in mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
Text conflict in mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
Text conflict in mysql-test/suite/rpl/t/rpl_row_create_table.test
Text conflict in mysql-test/suite/rpl/t/rpl_slave_skip.test
Text conflict in mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
Text conflict in mysys/charset.c
Text conflict in sql/field.cc
Text conflict in sql/field.h
Text conflict in sql/item.h
Text conflict in sql/item_func.cc
Text conflict in sql/log.cc
Text conflict in sql/log_event.cc
Text conflict in sql/log_event_old.cc
Text conflict in sql/mysqld.cc
Text conflict in sql/rpl_utility.cc
Text conflict in sql/rpl_utility.h
Text conflict in sql/set_var.cc
Text conflict in sql/share/Makefile.am
Text conflict in sql/sql_delete.cc
Text conflict in sql/sql_plugin.cc
Text conflict in sql/sql_select.cc
Text conflict in sql/sql_table.cc
Text conflict in storage/example/ha_example.h
Text conflict in storage/federated/ha_federated.cc
Text conflict in storage/myisammrg/ha_myisammrg.cc
Text conflict in storage/myisammrg/myrg_open.c
2010-03-24 18:03:44 +03:00
Alexey Kopytov
acc2b9e366 Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts:

Text conflict in mysql-test/r/partition_innodb.result
Text conflict in sql/field.h
Text conflict in sql/item.h
Text conflict in sql/item_cmpfunc.h
Text conflict in sql/item_sum.h
Text conflict in sql/log_event_old.cc
Text conflict in sql/protocol.cc
Text conflict in sql/sql_select.cc
Text conflict in sql/sql_yacc.yy
2010-03-20 23:23:42 +03:00
Staale Smedseng
3f4d8edb84 Bug #49829 Many "hides virtual function" warnings with
SunStudio
      
SunStudio compilers of late warn about methods that might hide
methods in base classes due to the use of overloading combined
with overriding. SunStudio also warns about variables defined
in local socpe or method arguments that have the same name as
a member attribute of the class.
      
This patch renames methods that might hide base class methods,
to make it easier both for humans and compilers to see what is
actually called. It also renames variables in local scope.
2010-03-14 17:01:45 +01:00
Alexander Nozdrin
6c32fa7357 Manual merge from mysql-next-mr.
Conflicts:
  - sql/log_event.cc
  - sql/sql_class.h
2010-02-15 14:16:49 +03:00
Vladislav Vaintroub
fe6f55d6a2 Bug#50057: 'SHOW PROFILE CPU' port for Windows.
Patch contributed by Alex Budovski.
2010-02-05 13:57:15 +01:00
Konstantin Osipov
0ce6d93f85 Merge next-mr -> next-4284. 2010-02-03 03:06:42 +03:00
Sergei Golubchik
ae2768ce9c WL#4738 streamline/simplify @@variable creation process
Bug#16565 mysqld --help --verbose does not order variablesBug#20413 sql_slave_skip_counter is not shown in show variables
Bug#20415 Output of mysqld --help --verbose is incomplete
Bug#25430 variable not found in SELECT @@global.ft_max_word_len;
Bug#32902 plugin variables don't know their names
Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting!
Bug#34829 No default value for variable and setting default does not raise error
Bug#34834 ? Is accepted as a valid sql mode
Bug#34878 Few variables have default value according to documentation but error occurs  
Bug#34883 ft_boolean_syntax cant be assigned from user variable to global var.
Bug#37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status
Bug#40988 log_output_basic.test succeeded though syntactically false.
Bug#41010 enum-style command-line options are not honoured (maria.maria-recover fails)
Bug#42103 Setting key_buffer_size to a negative value may lead to very large allocations 
Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
Bug#44797 plugins w/o command-line options have no disabling option in --help
Bug#46314 string system variables don't support expressions
Bug#46470 sys_vars.max_binlog_cache_size_basic_32 is broken
Bug#46586 When using the plugin interface the type "set" for options caused a crash.
Bug#47212 Crash in DBUG_PRINT in mysqltest.cc when trying to print octal number
Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds
Bug#49417 some complaints about mysqld --help --verbose output
Bug#49540 DEFAULT value of binlog_format isn't the default value
Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix)
Bug#49644 init_connect and \0
Bug#49645 init_slave and multi-byte characters
Bug#49646 mysql --show-warnings crashes when server dies
2009-12-22 10:35:56 +01:00
Konstantin Osipov
f744a84134 Backport of:
------------------------------------------------------------
revno: 2630.4.37
committer: Dmitry Lenev <dlenev@mysql.com>
branch nick: mysql-6.0-3726-w2
timestamp: Wed 2008-06-25 20:28:57 +0400
message:
  Fix build failure of mysql-6.0-3726 tree on Windows.

  The failure was caused by the fact that sql/mdl.cc was
  using __func__ macro without including sql_profile.h
  header which contained definition of this macro for
  those platforms that miss it.

  This patch solves this problem by moving this define to
  include/my_global.h which makes it available in modules
  which don't/can't include sql/mysql_priv.h.

This is a patch that is part of WL#3726.
2009-12-03 00:24:10 +03:00
Konstantin Osipov
d4632dff5a Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.

This patch implements: 

WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).

WL#4435: Support OUT-parameters in prepared statements.

(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).

Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.

After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.

When using the binary protocol, send the parameters in an additional result
set over the wire.  When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.

The following refactoring has been made:
  - Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
  - A new Protocol::send_result_set_row() was introduced to incapsulate
    common functionality for sending row data.
  - Signature of Protocol::prepare_for_send() was changed: this operation
    does not need a list of items, the number of items is fully sufficient.

The following backward incompatible changes have been made:
  - CLIENT_MULTI_RESULTS is now enabled by default in the client;
  - CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
2009-10-22 00:02:06 +04:00
Jon Olav Hauglid
0eccb93214 Bug #44651 "have_community_features" variable should be renamed
"have_profiling"

1) Renamed have_community_features server system variable to
have_profiling.
2) Removed eable-community-features configure option and
ENABLE_COMMUNITY_FEATURES macro.
3) Removed COMMUNITY_SERVER macro and replaced its usage by 
ENABLED_PROFILING.

Only --enable-profiling is now needed to enable profiling.
It was the only existing "community feature", so there was
no need for both configure options.

Using --enable-community-features will give a warning message
since it no longer exists.
2009-10-09 15:59:25 +02:00
Ignacio Galarza
2d9421c3bb Bug#29125 Windows Server X64: so many compiler warnings
- Remove bothersome warning messages.  This change focuses on the warnings 
that are covered by the ignore file: support-files/compiler_warnings.supp.
- Strings are guaranteed to be max uint in length
2009-02-13 11:41:47 -05:00
Georgi Kodinov
b180a10233 Fixed a warning in sql_profile.cc 2009-01-12 18:17:15 +02:00
kostja@dipika.(none)
f8ec5e0984 Fix a compilation failure of the community tree. 2008-02-19 23:47:15 +03:00
cmiller@zippy.cornsilk.net
d27fb9f939 Insert profiling instructions into s-p code to make each statement
be profiled separately.

Expand the time formats in i_s.profiling to wide enough for larger
numbers.
2007-11-13 09:46:17 -05:00
cmiller@zippy.cornsilk.net
5626ec5733 Don't start profiling too soon. Begin timing when the packet is
read.

Do not store profiling information when there is no query text.  We
don't wish to capture non-COM_QUERY packets.
2007-11-09 20:29:02 -05:00
cmiller@zippy.cornsilk.net
f12087af58 Rewrite profiler code to be easier to maintain and less buggy.
Between 5.0 and 5.1, the step of incrementing the global query id
changed, which broke how the profiler noticed when a new query had
started.  That reset the state list and caused all but the last 
five (or so) states to be thrown away.

Now, don't watch for query_id changes in the lower level.

Add a bogus state change at the end of profiling so that the last 
real state change is timed.

Emit source reference for the start of the span of time instead of
the end of it.
2007-11-09 14:45:44 -05:00
cmiller@zippy.cornsilk.net
0455e69b2b Fix several merge problems. There are many changes in 5.1 from 5.0
that affect profiling.
2007-11-02 11:41:58 -04:00
cmiller@zippy.cornsilk.net
e82bbb81d0 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1
2007-10-31 17:24:32 -04:00
cmiller@zippy.cornsilk.net
872d65a547 Sundry changes to fix merge problems. Most of these are duplicated
in 5.0-community, but pulling to merge was very hard.
2007-10-31 16:39:59 -04:00
cmiller@zippy.cornsilk.net
8d836dd38a Push history-limiting code until after the code that adds new
history entries.  Lazy deletion isn't smart or useful here.
2007-10-31 12:29:32 -04:00
cmiller@zippy.cornsilk.net
71d5c5350a Track typedef'd struct. Name changed in Enterprise tree, but
community-exclusive file also referred to struct.
2007-10-04 10:35:09 -04:00
cmiller@zippy.cornsilk.net
da78d3b7a3 In 5.0, Field_double::val_str uses "%g" to render floating point
numbers, which uses "X.YeZ" notation when the exponent Z would be
less than -4. That behavior at -4 is not exactly what we want, and
our Decimal type offers smarter number representation.  By changing
profiling to use Decimal types, we get more readable output.
2007-07-03 12:20:19 -04:00
cmiller@zippy.cornsilk.net
01f572052d Unify profiling SHOW code and INFORMATION_SCHEMA code for
profiling.  Also,

Bug#26938: profiling client hang if used before enabled

In the SHOW command, not sending header data because we had no 
rows to send was a protocol violation.  Porting the SHOW PROFILE
command to use the Information Schema table avoids that problem.
2007-07-02 07:27:39 -04:00
cmiller@zippy.cornsilk.net
587290cf00 Fix up merge. Some macros are now functions. Some functions are
renamed.  Some new THD proc_info states are new.  Directories must be
encountered in make in a specific order, to have symlinks already set.
Move community-server-specific tests into own tests, so that we can 
exempt them from testing on enterprise servers.
2007-05-02 14:13:33 -04:00
cmiller@zippy.cornsilk.net
93e804a616 Wrap code specific to the comunity-server in additional CPP #ifdef .
Add a new autoconf paremeter --{en,dis}able-community-features .  The
default is disable for enterprise servers.

Though this is a 5.0 tree, it is only to be merged into the 5.0-community
tree and the global 5.1 tree, never to the 5.0-enterprise tree.
2007-04-24 18:11:55 -04:00
cmiller@zippy.cornsilk.net
88455a047f Changing the state of whether we're recording profiling information
halfway through a query (as happens in "SET SESSION PROFILING = ...")
has a few side-effects, the worst of which is a memory leak for
prepared statements, which poke directly from the parser into the 
profiling code (we don't have the query text when we need it) and 
that overwrites a pointer to heap-allocated memory when the previous
statement turns on profiling.

Instead, now set a flag when we begin a new statement that tracks 
whether profiling is on _at the start_ of the query.  Use that to
track whether we gather info.

Additionally, use that AND use the state of the profiling variable
after the end of a query to know whether to store information about 
the query that just finished.
2007-04-06 09:15:18 -04:00
cmiller@zippy.cornsilk.net
4078a7ccce Unreported minor bug: We start numbering query IDs at zero, which
is a special case in "SHOW PROFILE FOR QUERY n".  No one can get
the zero item (which is always the statement that turns on profiling),
because zero represents the final item, internally.

Now, order the queries starting at one.
2007-04-03 19:52:24 -04:00
cmiller@zippy.cornsilk.net
cd28612e4b Backport:
B-g#27501: 5.0 significantly more sys ("kernel") time than 4.1 \
      due to getrusage() calls

Even if profiling is turned off, the parser makes calls to reset 
the state at the beginning of each query.  That would eventually 
instantiate a PROFILE_ENTRY, which does indeed capture resource 
usage.

Instead, now check that profiling is active before progressing
far into the storage/expiration of old entries in the history.
This has the pleasant side-effect that queries to toggle profiling
are not recorded in the history.
2007-04-03 19:50:55 -04:00
cmiller@zippy.cornsilk.net
ad181bb037 Backport:
B-g#27060: SQL Profile utility may not be reporting right duration \
      for each step

Whenever the profiler is reset at the beginning of a query, there's
a "hidden" profiling entry that represents that point in time.  It 
has no status description, as those are set by state changes and no
such point has yet been encountered.  That profiling entry is not
in the list of entries generated when we change states.

The profiling code had the problem that each step of printing 
profiling data subtracted the previous "step"'s data, but gave the
label to that data of the current step, which is wrong.  The label/
state refers to the period beginning with that profiling data, not
ending with it.

Now, give a label to the first profiling pseudo-entry, so that we 
have a name to assign to the period that ends with the first state 
change.  Now also use the state name of the previous step in showing 
the delta values that end with this step.
2007-04-03 19:45:28 -04:00
cmiller@zippy.cornsilk.net
9816842b58 Backport:
B-g#24795: SHOW PROFILE implementation

Don't use memory roots to store profiling information, because
memory roots make freeing the data a no-op, and thus long-running
processes with profiling turned on the whole time could eventually 
use all available memory.

Instead, use regular heap allocation and deallocation calls to 
manage profiling data.  Replace the leaky List usage with a similar-
behaving structure named "Queue".
2007-04-03 17:59:52 -04:00
cmiller@zippy.cornsilk.net
94036e0137 Patch to release clone. Fixes two post-pushbuild discovered failures.
Expand float size to avoid assert()ion failures.

"_db_func_" isn't a known linked object on some platforms, possibly 
because it is occasionaly shadowed by DBUG variables.  Avoid that
confusion.
2007-03-02 09:14:33 -05:00
cmiller@calliope.local.cmiller/calliope.local
c186793b6c Some changes suggested Serg, from message <20070223210659.GA24202@janus.mylan> 2007-02-26 13:11:36 -05:00
cmiller@zippy.cornsilk.net
b30fd9b414 Disambiguate method call. (Windows compiler error.) 2007-02-22 16:25:47 -05:00
cmiller@zippy.cornsilk.net
6e096ee8d9 Prevent bugs by making DBUG_* expressions syntactically equivalent
to a single statement.
---
Bug#24795: SHOW PROFILE

Profiling is only partially functional on some architectures.  Where 
there is no getrusage() system call, presently Null values are 
returned where it would be required.  Notably, Windows needs some love 
applied to make it as useful.

  Syntax this adds:
  
  SHOW PROFILES
  
  SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]
   where "n" is an integer
   and "types" is zero or many (comma-separated) of
      "CPU"
      "MEMORY" (not presently supported)
      "BLOCK IO"
      "CONTEXT SWITCHES"
      "PAGE FAULTS"
      "IPC"
      "SWAPS"
      "SOURCE"
      "ALL"

It also adds a session variable (boolean) "profiling", set to "no"
by default, and (integer) profiling_history_size, set to 15 by 
default.

This patch abstracts setting THDs' "proc_info" behind a macro that 
can be used as a hook into the profiling code when profiling 
support is compiled in.  All future code in this line should use
that mechanism for setting thd->proc_info.

---

Tests are now set to omit the statistics.

---

Adds an Information_schema table, "profiling" for access to 
"show profile" data.
---
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community-3--bug24795
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
---
Fix merge problems.
---
Fixed one bug in the query_source being NULL.  

Updated test results.
---
Include more thorough profiling tests.

Improve support for prepared statements.

Use session-specific query IDs, starting at zero.
---
Selecting from I_S.profiling is no longer quashed in profiling, as
requested by Giuseppe.

Limit the size of captured query text.

No longer log queries that are zero length.
2007-02-22 10:03:08 -05:00
cmiller@zippy.cornsilk.net
10cdf90bd3 Bug#24795: Add SHOW PROFILE
Patch contributed by Jeremy Cole.  CLA received Oct 2006 by Kaj Arnö

Add rudimentary query profiling support.
2007-01-03 17:15:10 -05:00