Commit graph

963 commits

Author SHA1 Message Date
Tatjana Azundris Nuernberg
9990ab901b auto-merge Bug#11762799/Bug#55436 2011-05-12 03:41:51 +01:00
Tatiana Azundris Nurnberg
9d80d48806 auto-merge conservative fix for Bug#55436/Bug#11762799 2011-05-05 06:39:38 +01:00
Alexander Barkov
fd1e3b03ff Bug#11766725 (Bug#59901) EXTRACTVALUE STILL BROKEN AFTER FIX FOR BUG #44332
Problem: a byte behind the end of input string was read
in case of a broken XML not having a quote or doublequote
character closing a string value.

Fix: changing condition not to read behind the end of input string

  @ mysql-test/r/xml.result
  @ mysql-test/t/xml.test
  Adding tests

  @ strings/xml.c
  When checking if the closing quote/doublequote was found,
  using p->cur[0] us unsafe, as p->cur can point to the byte after the value.
  Comparing p->cur to p->beg instead.
2011-03-01 15:30:18 +03:00
Alexander Barkov
435289acd4 Updating Copyright information 2011-01-19 16:17:52 +03:00
Alexander Barkov
5574a2cd91 Bug#44332 my_xml_scan reads behind the end of buffer
Problem: the scanner function tested for strings "<![CDATA[" and
"-->" without checking input string boundaries, which led to valgrind's
"Conditional jump or move depends on uninitialised value(s)" error.

Fix: Adding boundary checking.

  @ mysql-test/r/xml.result
  @ mysql-test/t/xml.test
  Adding test

  @ strings/xml.c
  Adding a helper function my_xml_parser_prefix_cmp(),
  with input string boundary check.
2011-01-18 09:38:41 +03:00
Kent Boortz
4acfdb9df1 Merge 2010-12-29 00:47:05 +01:00
Kent Boortz
85323eda8a - Added/updated copyright headers
- Removed files specific to compiling on OS/2
- Removed files specific to SCO Unix packaging
- Removed "libmysqld/copyright", text is included in documentation
- Removed LaTeX headers for NDB Doxygen documentation
- Removed obsolete NDB files
- Removed "mkisofs" binaries
- Removed the "cvs2cl.pl" script
- Changed a few GPL texts to use "program" instead of "library"
2010-12-28 19:57:23 +01:00
Mats Kindahl
9c87ae9ba7 Merging patch for BUG#58246 with mysql-5.1-bugteam. 2010-12-01 20:33:31 +01:00
Mats Kindahl
fc9f3efaec BUG#58246: INSTALL PLUGIN not secure & crashable
When installing plugins, there is a missing check
for slash (/) in the path on Windows. Note that on
Windows, both / and \ can be used to separate
directories.

This patch fixes the issue by:
- Adding a FN_DIRSEP symbol for all platforms
  consisting of a string of legal directory
  separators.
- Adding a charset-aware version of strcspn().
- Adding a check_valid_path() function that uses
  my_strcspn() to check if any FN_DIRSEP character
  is in the supplied string.
- Using the check_valid_path() function in
  sql_plugin.cc and sql_udf.cc (which means
  replacing the existing test there).

include/config-netware.h:
  Adding FN_DIRSEP
  ******
  Adding FN_DIRSEP
include/config-win.h:
  Adding FN_DIRSEP
  ******
  Adding FN_DIRSEP
include/m_ctype.h:
  Adding my_strspn() and my_strcspn().
  
  ******
  Adding my_strspn() and my_strcspn().
include/my_global.h:
  Adding FN_DIRSEP
  ******
  Adding FN_DIRSEP
mysql-test/t/plugin_not_embedded.test:
  Adding test that file names containing / is
  disallowed on *all* platforms.
  ******
  Adding test that file names containing / is
  disallowed on *all* platforms.
sql/sql_plugin.cc:
  Introducing check_if_path() function for
  checking if filename is a path to include
  / on Windows.
  ******
  Introducing check_if_path() function for
  checking if filename is a path to include
  / on Windows.
sql/sql_udf.cc:
  Switching to use check_if_path() function.
  ******
  Switching to use check_if_path() function.
strings/my_strchr.c:
  Adding my_strspn() and my_strcspn().
  ******
  Adding my_strspn() and my_strcspn().
2010-12-01 13:54:50 +01:00
Alexander Barkov
a7c09ea9f8 Bug#56639 Character Euro (0x88) not converted from cp1251 to utf8
Problem: MySQL cp1251 did not support 'U+20AC EURO SIGN'
which was assigned a few years ago to 0x88.

Fix: adding mapping: 0x88 <-> U+20AC 

  @ mysql-test/include/ctype_8bit.inc
  New shared file to test 8bit character sets.

  @ mysql-test/r/ctype_cp1251.result
  @ mysql-test/t/ctype_cp1251.test
  Adding tests

  @ sql/share/charsets/cp1251.xml
  Adding mapping

  @ strings/ctype-extra.c
  Regenerating ctype-extra.c using strings/conf_to_src
  according to new cp1251.xml
2010-11-26 16:58:54 +03:00
Tatiana A. Nurnberg
ccbc24b45a Bug#55436: buffer overflow in debug binary of dbug_buff in Field_new_decimal::store_value
There were some misunderstandings about parameters pertaining to buffer-size.

Patches fixes the reported off by one and
clarifies the documentation.

mysql-test/r/type_newdecimal.result:
  add test
mysql-test/t/type_newdecimal.test:
  add test
sql/field.cc:
  adjust buffer size by one to account for terminator.
sql/my_decimal.cc:
  adjust buffer size by one to account for terminator.
  clarify needs in comments.
sql/my_decimal.h:
  clarify buffer-size needs to prevent future off-by-one bugs.
strings/decimal.c:
  clarify buffer-size needs and parameters to prevent future off-by-one bugs
2010-11-11 09:46:49 +00:00
Tatiana A. Nurnberg
1c37eaaabf Bug #49752: 2469.126.2 unintentionally breaks authentication against
MySQL 5.1 server

Server used to clip overly long user-names. This was presumably lost
when code was made UTF8-clean.

Now we emulate the behaviour for backward compatibility, but UTF8-ly
correct.


mysql-test/r/connect.result:
  Show that user-names that are too long get clipped now.
mysql-test/t/connect.test:
  Show that user-names that are too long get clipped now.
sql/sql_connect.cc:
  Clip user-name to 16 characters (not bytes).
strings/CHARSET_INFO.txt:
  Clarify in docs.
2010-11-11 07:34:14 +00:00
Alexander Barkov
e57a9d6fe0 Bug#45012 my_like_range_cp932 generates invalid string
Problem: The functions my_like_range_xxx() returned
badly formed maximum strings for Asian character sets,
which made problems for storage engines.

Fix: 
- Removed a number my_like_range_xxx() implementations,
  which were in fact dumplicate code pieces.
- Using generic my_like_range_mb() instead.
- Setting max_sort_char member properly for Asian character sets
- Adding unittest/strings/strings-t.c, 
  to test that my_like_range_xxx() return well-formed 
  min and max strings.

Notes:

- No additional tests in mysql/t/ available.
  Old tests cover the affected code well enough.
2010-07-26 09:06:18 +04:00
Davi Arnaut
9a5fa17fd3 Bug#45288: pb2 returns a lot of compilation warnings on linux
Fix warnings flagged by the new warning option -Wunused-but-set-variable
that was added to GCC 4.6 and that is enabled by -Wunused and -Wall. The
option causes a warning whenever a local variable is assigned to but is
later unused. It also warns about meaningless pointer dereferences.

client/mysql.cc:
  Meaningless pointer dereferences.
client/mysql_upgrade.c:
  Check whether reading from the file succeeded.
extra/comp_err.c:
  Unused.
extra/yassl/src/yassl_imp.cpp:
  Skip instead of reading data that is discarded.
include/my_pthread.h:
  Variable is only used in debug builds.
include/mysys_err.h:
  Add new error messages.
mysys/errors.c:
  Add new error message for permission related functions.
mysys/mf_iocache.c:
  Variable is only checked under THREAD.
mysys/my_copy.c:
  Raise a error if chmod or chown fails.
mysys/my_redel.c:
  Raise a error if chmod or chown fails.
regex/engine.c:
  Use a equivalent variable for the assert.
server-tools/instance-manager/instance_options.cc:
  Unused.
sql/field.cc:
  Unused.
sql/item.cc:
  Unused.
sql/log.cc:
  Do not ignore the return value of freopen: only set buffer if
  reopening succeeds.
  
  Adjust doxygen comment to the right function.
  
  Pass message lenght to log function.
sql/mysqld.cc:
  Do not ignore the return value of freopen: only set buffer if
  reopening succeeds.
sql/partition_info.cc:
  Unused.
sql/slave.cc:
  No need to set pointer to the address of '\0'.
sql/spatial.cc:
  Unused. Left for historical purposes.
sql/sql_acl.cc:
  Unused.
sql/sql_base.cc:
  Pointers are always set to the same variables.
sql/sql_parse.cc:
  End statement if reading fails.
  
  Store the buffer after it has actually been updated.
sql/sql_repl.cc:
  No need to set pointer to the address of '\0'.
sql/sql_show.cc:
  Put variable under the same ifdef block.
sql/udf_example.c:
  Set null pointer flag appropriately.
storage/csv/ha_tina.cc:
  Meaningless dereferences.
storage/example/ha_example.cc:
  Return the error since it's available.
storage/myisam/mi_locking.c:
  Remove unused and dead code.
2010-07-20 15:07:36 -03:00
Davi Arnaut
11fae04527 Bug#45288: pb2 returns a lot of compilation warnings on linux
Although the C standard mandates that sprintf return the number
of bytes written, some very ancient systems (i.e. SunOS 4)
returned a pointer to the buffer instead. Since these systems
are not supported anymore and are hopefully long dead by now,
simply remove the portability wrapper that dealt with this
discrepancy. The autoconf check was causing trouble with GCC.
2010-07-09 09:00:17 -03:00
Davi Arnaut
0300935ff3 Bug#53445: Build with -Wall and fix warnings that it generates
If bzero is not available, resort to memset. Also, remove dead
bzero.c
2010-07-02 18:42:32 -03:00
Davi Arnaut
0eb26fdfa8 Bug#53445: Build with -Wall and fix warnings that it generates
Apart strict-aliasing warnings, fix the remaining warnings
generated by GCC 4.4.4 -Wall and -Wextra flags.

One major source of warnings was the in-house function my_bcmp
which (unconventionally) took pointers to unsigned characters
as the byte sequences to be compared. Since my_bcmp and bcmp
are deprecated functions whose only difference with memcmp is
the return value, every use of the function is replaced with
memcmp as the special return value wasn't actually being used
by any caller.

There were also various other warnings, mostly due to type
mismatches, missing return values, missing prototypes, dead
code (unreachable) and ignored return values.

BUILD/SETUP.sh:
  Remove flags that are implied by -Wall and -Wextra.
  Do not warn about unused parameters in C++.
BUILD/check-cpu:
  Print only the compiler version instead of verbose banner.
  Although the option is gcc specific, the check was only
  being used for GCC specific checks anyway.
client/mysql.cc:
  bcmp is no longer defined.
client/mysqltest.cc:
  Pass a string to function expecting a format string.
  Replace use of bcmp with memcmp.
cmd-line-utils/readline/Makefile.am:
  Always define _GNU_SOURCE when compiling GNU readline.
  Required to make certain prototypes visible.
cmd-line-utils/readline/input.c:
  Condition for the code to be meaningful.
configure.in:
  Remove check for bcmp.
extra/comp_err.c:
  Use appropriate type.
extra/replace.c:
  Replace use of bcmp with memcmp.
extra/yassl/src/crypto_wrapper.cpp:
  Do not ignore the return value of fgets. Retrieve the file
  position if fgets succeed -- if it fails, the function will
  bail out and return a error.
extra/yassl/taocrypt/include/blowfish.hpp:
  Use a single array instead of accessing positions of the sbox_
  through a subscript to pbox_.
extra/yassl/taocrypt/include/runtime.hpp:
  One definition of such functions is enough.
extra/yassl/taocrypt/src/aes.cpp:
  Avoid potentially ambiguous conditions.
extra/yassl/taocrypt/src/algebra.cpp:
  Rename arguments to avoid shadowing related warnings.
extra/yassl/taocrypt/src/blowfish.cpp:
  Avoid potentially ambiguous conditions.
extra/yassl/taocrypt/src/integer.cpp:
  Do not define type within a anonymous union.
  Use a variable to return a value instead of
  leaving the result in a register -- compiler
  does not know the logic inside the asm.
extra/yassl/taocrypt/src/misc.cpp:
  Define handler for pure virtual functions.
  Remove unused code.
extra/yassl/taocrypt/src/twofish.cpp:
  Avoid potentially ambiguous conditions.
extra/yassl/testsuite/test.hpp:
  Function must have C language linkage.
include/m_string.h:
  Remove check which relied on bcmp being defined -- they weren't
  being used as bcmp is only visible when _BSD_SOURCE is defined.
include/my_bitmap.h:
  Remove bogus helpers which were used only in a few files and
  were causing warnings about dead code.
include/my_global.h:
  Due to G++ bug, always silence false-positive uninitialized
  variables warnings when compiling C++ code with G++.
  Remove bogus helper.
libmysql/Makefile.shared:
  Remove built-in implementation of bcmp.
mysql-test/lib/My/SafeProcess/safe_process.cc:
  Cast pid to largest possible type for a process identifier.
mysys/mf_loadpath.c:
  Leave space of the ending nul.
mysys/mf_pack.c:
  Replace bcmp with memcmp.
mysys/my_bitmap.c:
  Dead code removal.
mysys/my_gethwaddr.c:
  Remove unused variable.
mysys/my_getopt.c:
  Silence bogus uninitialized variable warning.
  Do not cast away the constant qualifier.
mysys/safemalloc.c:
  Cast to expected type.
mysys/thr_lock.c:
  Silence bogus uninitialized variable warning.
sql/field.cc:
  Replace bogus helper with a more appropriate logic which is
  used throughout the code.
sql/item.cc:
  Remove bogus logical condition which always evaluates to TRUE.
sql/item_create.cc:
  Simplify code to avoid signedness related warnings.
sql/log_event.cc:
  Replace use of bcmp with memcmp.
  No need to use helpers for simple bit operations.
sql/log_event_old.cc:
  Replace bmove_align with memcpy.
sql/mysqld.cc:
  Move use declaration of variable to the ifdef block where it
  is used. Remove now-unnecessary casts and arguments.
sql/set_var.cc:
  Replace bogus helpers with simple and classic bit operations.
sql/slave.cc:
  Cast to expected type and silence bogus warning.
sql/sql_class.h:
  Don't use enum values as bit flags, the supposed type safety is
  bogus as the combined bit flags are not a value in the enumeration.
sql/udf_example.c:
  Only declare variable when necessary.
sql/unireg.h:
  Replace use of bmove_align with memcpy.
storage/innobase/os/os0file.c:
  Silence bogus warning.
storage/myisam/mi_open.c:
  Remove bogus cast, DBUG_DUMP expects a pointer to unsigned
  char.
storage/myisam/mi_page.c:
  Remove bogus cast, DBUG_DUMP expects a pointer to unsigned
  char.
strings/bcmp.c:
  Remove built-in bcmp.
strings/ctype-ucs2.c:
  Silence bogus warning.
tests/mysql_client_test.c:
  Use a appropriate type as expected by simple_command().
2010-07-02 15:30:47 -03:00
Davi Arnaut
6f3a540c37 Bug#42733: Type-punning warnings when compiling MySQL --
strict aliasing violations.

Essentially, the problem is that large parts of the server were
developed in simpler times (last decades, pre C99 standard) when
strict aliasing and compilers supporting such optimizations were
rare to non-existent. Thus, when compiling the server with a modern
compiler that uses strict aliasing rules to perform optimizations,
there are several places in the code that might trigger undefined
behavior.

As evinced by some recent bugs, GCC does a somewhat good of job
misoptimizing such code, but on the other hand also gives warnings
about suspicious code. One problem is that the warnings aren't
always accurate, yet we can't afford to just shut them off as we
might miss real cases. False-positive cases are aggravated mostly
by casts that are likely to trigger undefined behavior.

The solution is to start a cleanup process focused on fixing and
reducing the amount of strict-aliasing related warnings produced
by GCC and others compilers. A good deal of noise reduction can
be achieved by just removing useless casts that are product of
historical cruft and are likely to trigger undefined behavior if
dereferenced.

client/mysql.cc:
  Remove now-unnecessary casts.
  Break up large strings.
client/mysql_upgrade.c:
  Remove now-unnecessary casts.
client/mysqladmin.cc:
  Remove now-unnecessary casts.
  Break up large strings.
client/mysqlbinlog.cc:
  Remove now-unnecessary casts.
client/mysqlcheck.c:
  Remove now-unnecessary casts.
client/mysqldump.c:
  Remove now-unnecessary casts.
client/mysqlimport.c:
  Remove now-unnecessary casts.
client/mysqlshow.c:
  Remove now-unnecessary casts.
client/mysqlslap.c:
  Remove now-unnecessary casts.
client/mysqltest.cc:
  Remove now-unnecessary casts.
extra/comp_err.c:
  Remove now-unnecessary casts.
extra/my_print_defaults.c:
  Remove now-unnecessary casts.
  Break up large strings.
extra/mysql_waitpid.c:
  Remove now-unnecessary casts.
extra/perror.c:
  Remove now-unnecessary casts.
extra/resolve_stack_dump.c:
  Remove now-unnecessary casts.
extra/resolveip.c:
  Remove now-unnecessary casts.
include/my_getopt.h:
  Use a void pointer type as the opaque type to avoid problems with type
  incompatibility -- GCC issues warnings when the type name is not type
  compatible with a operand. As a side bonus, a explicit cast won't be
  necessary anymore.
include/sslopt-longopts.h:
  Remove now-unnecessary casts.
  Break up large strings.
mysys/my_getopt.c:
  Update opaque type and introduce a type definition for the
  argument to my_getopt_register_get_addr.
server-tools/instance-manager/options.cc:
  Remove now-unnecessary casts.
sql/mysqld.cc:
  Remove now-unnecessary casts.
  Break up large strings.
  Update mysql_getopt_value prototype (the old prototype
  was different from the definition anyway).
sql/sql_plugin.cc:
  The type of a pointer to a function must be compatible with the
  pointed-to function type, otherwise the behavior is undefined.
sql/table.cc:
  The variable buf pointer to pointer to pointer to constant char
  could improperly alias a incompatible type in call to fix_type_
  pointers. Since this was actually dead code, it is simply removed.
sql/unireg.cc:
  Remove call to get_form_pos. The code creates a new FRM file which
  is always truncated and writes the form position as 0. Hence, no
  need to retrieve it, we now for sure it is 0.
storage/archive/archive_reader.c:
  Remove now-unnecessary casts.
storage/myisam/ft_nlq_search.c:
  Read weight directly from the buffer.
storage/myisam/fulltext.h:
  Add explanation about the type duality of a key buffer.
  Add accessor macro to retrieve a FT float value.
storage/myisam/mi_test1.c:
  Remove now-unnecessary casts.
storage/myisam/myisam_ftdump.c:
  Read weight directly from the buffer.
storage/myisam/myisamchk.c:
  Remove now-unnecessary casts.
storage/myisam/myisamlog.c:
  A pointer to char was used to alias a pointer to pointer to
  unsigned char, thus violating strict aliasing rules.
storage/myisam/myisampack.c:
  Remove now-unnecessary casts.
strings/decimal.c:
  Remove aliasing violation, printing the value is enough for
  debugging purposes.
tests/mysql_client_test.c:
  Remove now-unnecessary casts.
2010-06-10 17:16:43 -03:00
Gleb Shchepa
107f34ed77 Bug #49955: ld error message: undefined reference to `strmov_overlapp'
32bit builds with the --enable-assembler flag (enabled by default)
fail with an error message: undefined reference to `strmov_overlapp'.

Since the fix for bug 48866 we use a home-grown strmov function
instead of the ctpcpy function, but the source file for this
function was missed in the Makefile.am.

The strings/Makefile.am file has been modified to include strmov.c
file into ASSEMBLER_x86 and ASSEMBLER_sparc32 sections.


strings/Makefile.am:
  Bug #49955: ld error message: undefined reference to `strmov_overlapp'
  
  The strings/Makefile.am file has been modified to include
  strmov.c file into ASSEMBLER_x86 and ASSEMBLER_sparc32 sections.
2010-01-11 18:21:22 +04:00
Gleb Shchepa
a852f464e3 manual merge 5.0-bugteam --> 5.1-bugteam (bug 49955) 2010-01-11 18:31:06 +04:00
Georgi Kodinov
c248859ec8 merge 2009-12-24 11:00:04 +02:00
Georgi Kodinov
adc17cd41e Bug #48866: mysql.test fails under Fedora 12
strmov() is not guaranteed to work correctly on overlapping
source and destination buffers. On some OSes it may work,
but Fedora 12 has a stpcpy() that's not working correctly 
on overlapping buffers.
Fixed to use the overlap-safe version of strmov instead.
Re-vitalized the overlap-safe version of strmov.
2009-12-16 19:31:19 +02:00
Mattias Jonsson
f9e48efb91 Recommit of patch for bug#49028 for 5.1.
Includes both patch from bug#48737 (without test,
which should go to next-mr) and test for
bug#49028.
2009-12-14 16:11:47 +01:00
Alexander Barkov
c12dad02d6 A post fix for BUG#45645 Mysql server close all connection and restart using lower function
- Initialized caseinfo only if it is NULL
2009-10-20 12:47:00 +05:00
Alexander Barkov
ead175bb07 Bug#45645 Mysql server close all connection and restart using lower function
Problem: the "caseinfo" member of CHARSET_INFO structure was not
initialized for user-defined Unicode collations, which made the
server crash.
Fix: initializing caseinfo properly.
2009-10-19 18:23:53 +05:00
V Narayanan
64e89a7ed2 Bug#46448 trailing spaces are not ignored when user collation maps space != 0x20
In MySQL when the mapping for space is changed to something other than
0x20 by defining a different collation, then space is not ignored when
comparing two strings.

This was happening because the function that performs the comparison
of two strings while ignoring ending spaces, was comparing the collation
value of a space with the ascii value of the ' ' character. This should
be changed to do comparison between the collated values.

mysql-test/r/ctype_ldml.result:
  Bug#46448 trailing spaces are not ignored when user collation maps space != 0x20
  
  Result file for test case.
mysql-test/std_data/Index.xml:
  Bug#46448 trailing spaces are not ignored when user collation maps space != 0x20
  
  Added entry for new test collation in the index file.
mysql-test/std_data/latin1.xml:
  Bug#46448 trailing spaces are not ignored when user collation maps space != 0x20
  
  Added support for new collation for test.
mysql-test/t/ctype_ldml.test:
  Bug#46448 trailing spaces are not ignored when user collation maps space != 0x20
  
  Added test case to ensure trailing spaces are not ignored.
strings/ctype-simple.c:
  Bug#46448 trailing spaces are not ignored when user collation maps space != 0x20
  
  change my_strnncollsp_simple to compare collated values when checking
  for trailing spaces. Currently the comparison happens between a collated
  value and the ascii value.
2009-10-12 13:13:15 +05:30
Staale Smedseng
5be4c38226 Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00
Staale Smedseng
1ba25ae47c Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
      
This patch fixes a number of GCC warnings about variables used
before initialized. A new macro UNINIT_VAR() is introduced for
use in the variable declaration, and LINT_INIT() usage will be
gradually deprecated. (A workaround is used for g++, pending a
patch for a g++ bug.)
      
GCC warnings for unused results (attribute warn_unused_result)
for a number of system calls (present at least in later
Ubuntus, where the usual void cast trick doesn't work) are
also fixed.


client/mysqlmanager-pwgen.c:
  A fix for warn_unused_result, adding fallback to use of
  srand()/rand() if /dev/random cannot be used. Also actually
  adds calls to rand() in the second branch so that it actually
  creates a random password.
2009-08-28 17:51:31 +02:00
Georgi Kodinov
1a4bc9a1e4 Bug #46042: backported the fix for the valgrind warning from 5.1 2009-07-16 16:13:26 +03:00
Alexander Barkov
c6771e7bde Backporting "WL#3332 Korean Enhancements" and
"WL#4584 New euckr characters" from 5.4.
(as agreed on ServerPT meeting on July 8).
2009-07-24 11:27:23 +05:00
Staale Smedseng
300a8721fa Merge from 5.0 2009-06-29 16:00:47 +02:00
Staale Smedseng
6777150883 Merge from 5.0-bt 2009-06-29 15:17:01 +02:00
Tatiana A. Nurnberg
6e422ce034 Addendum to Bug #45286: backport macro name form other tree
use same (slightly unwieldy) name in all trees; fix before this version goes "public".
bless ctype to avoid upmerge conflict, le sigh.
2009-06-06 15:05:44 +02:00
Georgi Kodinov
5fc05b9528 automerge 2009-06-05 15:30:57 +03:00
Georgi Kodinov
22454390c0 Bug #45286: compilation warnings on mysql-5.0-bugteam on MacOSX
Fixed the 5.0-bugteam MacOSX warnings.

client/mysqldump.c:
  Bug #45286: typecasts
cmd-line-utils/readline/bind.c:
  Bug #45286: use variable of right type
cmd-line-utils/readline/display.c:
  Bug #45286: use variable of right type
dbug/user.r:
  Bug #45286: no warnings in generating man pages
strings/ctype.c:
  Bug #45286: typecasts
2009-06-05 15:05:26 +03:00
Alexander Barkov
d7bfc76dec Bug#43827 Server closes connections and restarts
Problem:
  Crash happened with a user-defined utf8 collation,
  on attempt to insert a value longer than the column
  to store.
Reason:
  The "ctype" member was not initialized (NULL) when
  allocating a user-defined utf8 collation, so an attempt
  to call my_ctype(cs, *str) to check if we loose any important
  data when truncating the value made the server crash.
Fix:
  Initializing tge "ctype" member to a proper value.


mysql-test/r/ctype_ldml.result
  Adding tests

mysql-test/t/ctype_ldml.test
  Adding tests

strings/ctype-uca.c
  Adding initialization of "ctype" member.

modified:
  mysql-test/r/ctype_ldml.result
  mysql-test/t/ctype_ldml.test
  strings/ctype-uca.c
2009-06-04 14:35:29 +05:00
Alexander Barkov
0df0070549 Bug#44352 UPPER/LOWER function doesn't work correctly
on cp932 and sjis environment.
Problem: case conversion erroneously changes the second bytes
of multi-byte sequences because single-byte functions were
called in a mistake.
Fix: call multi-byte aware functions instead.
2009-05-05 11:55:22 +05:00
Georgi Kodinov
c36e935ac2 merged 5.0-bugteam -> 5.1-bugteam 2009-03-24 15:58:52 +02:00
Narayanan V
de750af17d merging with mysql-5.0-bugteam 2009-03-20 11:42:55 +05:30
Narayanan V
c1f335237b Bug#42937 strings/CHARSET_INFO.txt not included in source distributions
The reference manual has instructions for adding new character
sets, and refers to the string/CHARSET_INFO.txt file. This file
is currently not present in the distribution.

Modify the build to include this file in the distribution.

strings/Makefile.am:
  modify EXTRA_DIST to include the CHARSET_INFO file.
2009-03-11 12:41:59 +05:30
Ignacio Galarza
5b7347bda3 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
Ignacio Galarza
54fbbf9591 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-10 17:47:54 -05:00
Georgi Kodinov
f97ef7a40e merged 5.1-main -> 5.1-bugteam 2009-01-05 18:10:20 +02:00
Sergey Glukhov
f42b9ad93f 5.0-bugteam->5.1-bugteam merge 2008-12-23 18:21:01 +04:00
Sergey Glukhov
c06df92af6 Bug#37575 UCASE fails on monthname
The MONTHNAME/DAYNAME functions
returns binary string, so the LOWER/UPPER functions
are not effective on the result of MONTHNAME/DAYNAME call.  
Character set of the MONTHNAME/DAYNAME function
result has been changed to connection character set.


include/m_ctype.h:
  added my_charset_repertoire function
mysql-test/r/ctype_ucs.result:
  test result
mysql-test/r/func_time.result:
  test result
mysql-test/t/ctype_ucs.test:
  test case
mysql-test/t/func_time.test:
  test case
sql/item_timefunc.cc:
  Item_func_monthname::fix_length_and_dec and
  Item_func_dayname::fix_length_and_dec methods have been
  modified to use connection character set
sql/item_timefunc.h:
  Item_func_monthname::fix_length_and_dec and
  Item_func_dayname::fix_length_and_dec methods have been
  modified to use connection character set
sql/mysql_priv.h:
  added max_month_name_length, max_day_name_length fields into MY_LOCALE struct
sql/mysqld.cc:
  The test_lc_time_sz function controls modifications
  of the locale database in debugging mode.
sql/sql_locale.cc:
  initialization of max_month_name_length, max_day_name_length fields
strings/ctype.c:
  added my_charset_repertoire function
2008-12-23 18:08:04 +04:00
Alexander Barkov
8d4b41605b Bug#38227 EXTRACTVALUE doesn't work with DTD declarations
Problem:
 XML syntax parser allowed to use quoted strings as attribute names,
 and tried to put them into parser state stack instead of identifiers.
 After that parser failed, if quoted string contained some slash characters.
Fix:
 - Disallowing quoted strings in regular tags.
 - Allowing quoted string in DOCTYPE declararion, but
 don't push it into parse state stack (just skip it).
2008-12-10 13:05:57 +04:00
unknown
bfba620e45 Changes of copyright output from "--version" and similar.
Changes of copyright in RPM spec file.
2008-11-14 17:29:38 +01:00
Chad MILLER
535a183964 Merge from 5.0-bugteam. 2008-08-15 15:49:43 -04:00
Chad MILLER
65c3870cfc Bug#36270: incorrect calculation result - works in 4.1 but not in 5.0 or 5.1
When the fractional part in a multiplication of DECIMALs
overflowed, we truncated the first operand rather than the
longest. Now truncating least significant places instead
for more precise multiplications.

(Queuing at demand of Trudy/Davi.)

mysql-test/r/type_newdecimal.result:
  show that if we need to truncate the scale of an operand, we pick the
  right one (that is, we discard the least significant decimal places)
mysql-test/t/type_newdecimal.test:
  show that if we need to truncate the scale of an operand, we pick the
  right one (that is, we discard the least significant decimal places)
strings/decimal.c:
  when needing to disregard fractional parts, pick the least
  significant ones
2008-08-15 15:46:21 -04:00
Georgi Kodinov
b2362674d5 merged 5.0-bugteam to 5.1-bugteam
sql/share/charsets/README:
  merged bug 36676 to 5.1-bugteam
strings/CHARSET_INFO.txt:
  merged bug 36676 to 5.1-bugteam
2008-05-28 17:18:24 +03:00