1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00
Commit Graph

12 Commits

Author SHA1 Message Date
Alexander Barkov
2dc9b8b78e MDEV-36216 TO_CHAR FM format not recognized in SQL_MODE=Oracle
Adding support for the "FM" format in function TO_CHAR(date_time, fmt).

"FM" in the format string disables padding of all components following it.

So now TO_CHAR() works as follows:

- By default string format components DAY (weekday name) and
  MONTH (month name) are right-padded with spaces to the maximum
  possible DAY and MONTH name lengths respectively,
  according to the current locale specified in @@lc_time_names.
  So for example, with lc_time_names='en_US' all month names are
  right-padded with spaces up to 9 characters ('September' is the longest).

    SET lc_time_names='en_US';
    SELECT TO_CHAR('0001-02-03', 'MONTH');   -> 'February '  (padded to 9 chars)

  NEW: When typed after FM, DAY and MONTH names are not right-padded
  with trailing spaces any more:

   SET lc_time_names='en_US';
   SELECT TO_CHAR('0001-02-03', 'FMMONTH'); -> 'February' (not padded)

- By default numeric components YYYY, YYY, YY, Y, DD, H12, H24, MI, SS
  are left-padded with leading digits '0' up to the maximum possible
  number of digits in the component (e.g. 4 for YYYY):

    SELECT TO_CHAR('0001-02-03', 'YYYY'); -> '0001' (padded to 4 chars)

  NEW: When typed after FM, these numeric components are not left-padded
  with leading zeros any more:

    SELECT TO_CHAR('0001-02-03', 'FMYYYY'); -> '1' (not padded)

- If FM is specified multiple times in a format string,
  every FM negates the previous padding state:
  * an odd FM disables padding
  * an even FM enables padding

Implementation details:
- Adding a helper class Date_time_format_oracle.
- Adding a helper method Date_time_format_oracle::append_lex_cstring()
- Moving the function append_val() to Date_time_format_oracle as a method.
- Moving the function make_date_time_oracle() to Date_time_format_oracle
  as a method format().
- Adding helper methods month_name() and day_name() in class MY_LOCALE,
  to return the corresponding components as LEX_CSTRINGs.
2025-04-16 12:55:49 +04:00
Alexander Barkov
5967dfdbbf MDEV-23154 Add a data type my_repertoire_t 2020-07-13 19:50:07 +04:00
Vladislav Vaintroub
93efbc390d MDEV-22214 mariadbd.exe calls function mysqld.exe, and crashes
Stop linking plugins to the server executable on Windows.
Instead, extract whole server functionality into a large DLL, called
server.dll. Link both plugins, and small server "stub" exe to it.

This eliminates plugin dependency on the name of the server executable.
It also reduces the size of the packages (since tiny mysqld.exe
and mariadbd.exe are now both linked to one big DLL)

Also, simplify the functionality of exporing all symbols from selected
static libraries. Rely on WINDOWS_EXPORT_ALL_SYMBOLS, rather than old
self-backed solution.

fix compile error

replace GetProcAddress(GetModuleHandle(NULL), "variable_name")
for server exported data with actual variable names.

Runtime loading was never required,was error prone
, since symbols could be missing at runtime, and now it actually failed,
because we do not export symbols from executable anymore, but from a shared
library

This did require a MYSQL_PLUGIN_IMPORT decoration for the plugin,
but made the code more straightforward, and avoids missing symbols at
runtime (as mentioned before).

The audit plugin is still doing some dynamic loading, as it aims to work
cross-version. Now it won't work cross-version on Windows, as it already
uses some symbols that are *not* dynamically loaded, e.g fn_format
and those symbols now exported from server.dll , when earlier they were
exported by mysqld.exe

Windows, fixes for storage engine plugin loading
after various rebranding stuff

Create server.dll containing functionality of the whole server
make mariadbd.exe/mysqld.exe a stub that is only  calling mysqld_main()

fix build
2020-04-10 19:05:26 +02:00
Marko Mäkelä
be85d3e61b Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
Marko Mäkelä
26a14ee130 Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
Vicențiu Ciorbaru
5543b75550 Update FSF Address
* Update wrong zip-code
2019-05-11 21:29:06 +03:00
Michael Widenius
4aaa38d26e Enusure that my_global.h is included first
- Added sql/mariadb.h file that should be included first by files in sql
  directory, if sql_plugin.h is not used (sql_plugin.h adds SHOW variables
  that must be done before my_global.h is included)
- Removed a lot of include my_global.h from include files
- Removed include's of some files that my_global.h automatically includes
- Removed duplicated include's of my_sys.h
- Replaced include my_config.h with my_global.h
2017-08-24 01:05:44 +02:00
Sergei Golubchik
932646b1ff Merge branch '10.1' into 10.2 2016-06-30 16:38:05 +02:00
Alexander Barkov
964c4f070a MDEV-10052 Illegal mix of collations with DAYNAME(date_field)<>varchar_field 2016-05-10 19:13:06 +04:00
Monty
d0b178fb45 Added new range of MariaDB error messages, starting from 3000
This is done by splitting variables.errmsg and locale.errmsg to
variables.errmsg_extra and locale.errmsg_extra

The ER() macros in unireg.h now looks more complex than before, but this
isn't critical as most usage of them are with constants and the compiler
will remove most of the test code.
2016-04-05 18:00:03 +03:00
Kent Boortz
02e07e3b51 Updated/added copyright headers 2011-06-30 17:46:53 +02:00
Mats Kindahl
23d8586dbf 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