summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/mysql.cc2
-rw-r--r--configure.in3
-rw-r--r--include/config-netware.h3
-rw-r--r--mysql-test/r/ctype_uca.result106
-rw-r--r--mysql-test/r/fulltext2.result21
-rw-r--r--mysql-test/t/ctype_uca.test1
-rw-r--r--mysql-test/t/fulltext2.test30
-rw-r--r--mysys/charset-def.c4
-rw-r--r--mysys/my_copy.c3
-rw-r--r--mysys/thr_alarm.c24
-rwxr-xr-xndb/tools/ndb_error_reporter88
-rw-r--r--server-tools/instance-manager/instance.cc3
-rw-r--r--sql/mysqld.cc2
-rw-r--r--storage/myisam/mi_create.c5
-rw-r--r--storage/myisam/mi_delete.c2
-rw-r--r--strings/ctype-uca.c73
-rw-r--r--strings/decimal.c7
17 files changed, 350 insertions, 27 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 1323b70cbf8..98af6561966 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -259,7 +259,7 @@ static COMMANDS commands[] = {
{ "quit", 'q', com_quit, 0, "Quit mysql." },
{ "rehash", '#', com_rehash, 0, "Rebuild completion hash." },
{ "source", '.', com_source, 1,
- "Execute a SQL script file. Takes a file name as an argument."},
+ "Execute an SQL script file. Takes a file name as an argument."},
{ "status", 's', com_status, 0, "Get status information from the server."},
#ifdef USE_POPEN
{ "system", '!', com_shell, 1, "Execute a system shell command."},
diff --git a/configure.in b/configure.in
index 10c3c26ec26..ba213c2484d 100644
--- a/configure.in
+++ b/configure.in
@@ -6,6 +6,7 @@ AC_PREREQ(2.52)dnl Minimum Autoconf version required.
AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line!
+# remember to also change ndb version below and update version.c in ndb
AM_INIT_AUTOMAKE(mysql, 5.1.5-alpha)
AM_CONFIG_HEADER(config.h)
@@ -17,7 +18,7 @@ SHARED_LIB_VERSION=15:0:0
# ndb version
NDB_VERSION_MAJOR=5
NDB_VERSION_MINOR=0
-NDB_VERSION_BUILD=18
+NDB_VERSION_BUILD=19
NDB_VERSION_STATUS=""
# Set all version vars based on $VERSION. How do we do this more elegant ?
diff --git a/include/config-netware.h b/include/config-netware.h
index 7def0053bf2..f517e3c34d3 100644
--- a/include/config-netware.h
+++ b/include/config-netware.h
@@ -72,9 +72,10 @@ extern "C" {
#undef HAVE_CRYPT
#endif /* HAVE_OPENSSL */
-/* Configure can't detect this because it uses AC_TRY_RUN */
+/* Netware has an ancient zlib */
#undef HAVE_COMPRESS
#define HAVE_COMPRESS
+#undef HAVE_ARCHIVE_DB
/* include the old function apis */
#define USE_OLD_FUNCTIONS 1
diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result
index 4b245c69d2a..3e286c77c00 100644
--- a/mysql-test/r/ctype_uca.result
+++ b/mysql-test/r/ctype_uca.result
@@ -2015,6 +2015,112 @@ Z,z,Ź,ź,Ż,ż,Ž,ž
ǁ
ǂ
ǃ
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_hungarian_ci;
+group_concat(c1 order by c1)
+A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ
+AA,Aa,aA,aa
+Æ,æ,Ǣ,ǣ,Ǽ,ǽ
+B,b
+Ƃ,ƃ
+C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č
+CH,Ch,cH,ch
+Ƈ,ƈ
+D,d,Ď,ď
+DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
+Đ,đ
+Ƌ,ƌ
+Ð,ð
+E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
+Ǝ,ǝ
+F,f
+Ƒ,ƒ
+G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ
+Ǥ,ǥ
+Ƣ,ƣ
+H,h,Ĥ,ĥ
+ƕ,Ƕ
+Ħ,ħ
+I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ
+IJ,Ij,iJ,ij,IJ,ij
+J,j,Ĵ,ĵ,ǰ
+K,k,Ķ,ķ,Ǩ,ǩ
+Ƙ,ƙ
+L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
+Ŀ,ŀ
+LJ,Lj,lJ,lj,LJ,Lj,lj
+LL,Ll,lL,ll
+Ł,ł
+M,m
+N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
+NJ,Nj,nJ,nj,NJ,Nj,nj
+Ŋ,ŋ
+O,o,Ò,Ó,Ô,Õ,ò,ó,ô,õ,Ō,ō,Ŏ,ŏ,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ
+OE,Oe,oE,oe,Œ,œ
+Ö,ö,Ő,ő
+Ø,ø,Ǿ,ǿ
+P,p
+Ƥ,ƥ
+Q,q
+R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
+RR,Rr,rR,rr
+S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ
+SS,Ss,sS,ss,ß
+T,t,Ţ,ţ,Ť,ť
+Ŧ,ŧ
+Ƭ,ƭ
+U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
+Ü,ü,Ű,ű
+V,v
+W,w,Ŵ,ŵ
+X,x
+Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ
+Ƴ,ƴ
+Z,z,Ź,ź,Ż,ż,Ž,ž
+Ƶ,ƶ
+Ʒ,Ǯ,ǯ
+Ƹ,ƹ
+Þ,þ
+ƿ,Ƿ
+Ƨ,ƨ
+Ƽ,ƽ
+Ƅ,ƅ
drop table t1;
SET NAMES utf8;
CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE utf8_general_ci, INDEX (c));
diff --git a/mysql-test/r/fulltext2.result b/mysql-test/r/fulltext2.result
index 0b1d8eb9a15..72c6b2d22ed 100644
--- a/mysql-test/r/fulltext2.result
+++ b/mysql-test/r/fulltext2.result
@@ -215,3 +215,24 @@ select count(*) from t1 where match a against ('aaazzz' in boolean mode);
count(*)
262
drop table t1;
+set names utf8;
+create table t1(a text,fulltext(a)) collate=utf8_swedish_ci;
+insert into t1 values('test test '),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test');
+delete from t1 limit 1;
+drop table t1;
+set names latin1;
diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test
index 6d8713f4910..3e49b9de883 100644
--- a/mysql-test/t/ctype_uca.test
+++ b/mysql-test/t/ctype_uca.test
@@ -212,6 +212,7 @@ select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_roman_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_esperanto_ci;
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_hungarian_ci;
drop table t1;
diff --git a/mysql-test/t/fulltext2.test b/mysql-test/t/fulltext2.test
index bcd39b9ea04..7a7b572d58f 100644
--- a/mysql-test/t/fulltext2.test
+++ b/mysql-test/t/fulltext2.test
@@ -179,7 +179,37 @@ update t1 set a='aaaxxx' where a = 'aaayyy';
select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
select count(*) from t1 where match a against ('aaayyy' in boolean mode);
select count(*) from t1 where match a against ('aaazzz' in boolean mode);
+drop table t1;
+
+#
+# BUG#11336
+#
+# for uca collation isalnum and strnncollsp don't agree on whether
+# 0xC2A0 is a space (strnncollsp is right, isalnum is wrong).
+#
+# they still don't, the bug was fixed by avoiding strnncollsp
+#
+set names utf8;
+create table t1(a text,fulltext(a)) collate=utf8_swedish_ci;
+insert into t1 values('test test '),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
+('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test');
+delete from t1 limit 1;
drop table t1;
+set names latin1;
# End of 4.1 tests
diff --git a/mysys/charset-def.c b/mysys/charset-def.c
index 5b30d1ee135..0559fe59d06 100644
--- a/mysys/charset-def.c
+++ b/mysys/charset-def.c
@@ -43,6 +43,7 @@ extern CHARSET_INFO my_charset_ucs2_spanish2_uca_ci;
extern CHARSET_INFO my_charset_ucs2_roman_uca_ci;
extern CHARSET_INFO my_charset_ucs2_persian_uca_ci;
extern CHARSET_INFO my_charset_ucs2_esperanto_uca_ci;
+extern CHARSET_INFO my_charset_ucs2_hungarian_uca_ci;
#endif
#ifdef HAVE_CHARSET_utf8
@@ -64,6 +65,7 @@ extern CHARSET_INFO my_charset_utf8_spanish2_uca_ci;
extern CHARSET_INFO my_charset_utf8_roman_uca_ci;
extern CHARSET_INFO my_charset_utf8_persian_uca_ci;
extern CHARSET_INFO my_charset_utf8_esperanto_uca_ci;
+extern CHARSET_INFO my_charset_utf8_hungarian_uca_ci;
#ifdef HAVE_UTF8_GENERAL_CS
extern CHARSET_INFO my_charset_utf8_general_cs;
#endif
@@ -151,6 +153,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_ucs2_roman_uca_ci);
add_compiled_collation(&my_charset_ucs2_persian_uca_ci);
add_compiled_collation(&my_charset_ucs2_esperanto_uca_ci);
+ add_compiled_collation(&my_charset_ucs2_hungarian_uca_ci);
#endif
#endif
@@ -184,6 +187,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_utf8_roman_uca_ci);
add_compiled_collation(&my_charset_utf8_persian_uca_ci);
add_compiled_collation(&my_charset_utf8_esperanto_uca_ci);
+ add_compiled_collation(&my_charset_utf8_hungarian_uca_ci);
#endif
#endif
diff --git a/mysys/my_copy.c b/mysys/my_copy.c
index 072492172e3..2fb022a25f2 100644
--- a/mysys/my_copy.c
+++ b/mysys/my_copy.c
@@ -53,7 +53,7 @@ struct utimbuf {
int my_copy(const char *from, const char *to, myf MyFlags)
{
uint Count;
- my_bool new_file_stat; /* 1 if we could stat "to" */
+ my_bool new_file_stat= 0; /* 1 if we could stat "to" */
int create_flag;
File from_file,to_file;
char buff[IO_SIZE];
@@ -62,7 +62,6 @@ int my_copy(const char *from, const char *to, myf MyFlags)
DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags));
from_file=to_file= -1;
- LINT_INIT(new_file_stat);
DBUG_ASSERT(!(MyFlags & (MY_FNABP | MY_NABP))); /* for my_read/my_write */
if (MyFlags & MY_HOLD_ORIGINAL_MODES) /* Copy stat if possible */
new_file_stat= test(my_stat((char*) to, &new_stat_buff, MYF(0)));
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index e5b77de5e38..41914080a9d 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -401,7 +401,7 @@ void end_thr_alarm(my_bool free_structures)
{
DBUG_ENTER("end_thr_alarm");
if (alarm_aborted != 1) /* If memory not freed */
- {
+ {
pthread_mutex_lock(&LOCK_alarm);
DBUG_PRINT("info",("Resheduling %d waiting alarms",alarm_queue.elements));
alarm_aborted= -1; /* mark aborted */
@@ -415,13 +415,10 @@ void end_thr_alarm(my_bool free_structures)
if (free_structures)
{
struct timespec abstime;
- /*
- The following test is just for safety, the caller should not
- depend on this
- */
+
DBUG_ASSERT(!alarm_queue.elements);
- /* Wait until alarm thread dies */
+ /* Wait until alarm thread dies */
set_timespec(abstime, 10); /* Wait up to 10 seconds */
while (alarm_thread_running)
{
@@ -429,16 +426,13 @@ void end_thr_alarm(my_bool free_structures)
if (error == ETIME || error == ETIMEDOUT)
break; /* Don't wait forever */
}
- if (!alarm_queue.elements)
+ delete_queue(&alarm_queue);
+ alarm_aborted= 1;
+ pthread_mutex_unlock(&LOCK_alarm);
+ if (!alarm_thread_running) /* Safety */
{
- delete_queue(&alarm_queue);
- alarm_aborted= 1;
- pthread_mutex_unlock(&LOCK_alarm);
- if (!alarm_thread_running) /* Safety */
- {
- pthread_mutex_destroy(&LOCK_alarm);
- pthread_cond_destroy(&COND_alarm);
- }
+ pthread_mutex_destroy(&LOCK_alarm);
+ pthread_cond_destroy(&COND_alarm);
}
}
else
diff --git a/ndb/tools/ndb_error_reporter b/ndb/tools/ndb_error_reporter
new file mode 100755
index 00000000000..2b5aadb6171
--- /dev/null
+++ b/ndb/tools/ndb_error_reporter
@@ -0,0 +1,88 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+if(@ARGV < 1)
+{
+ print STDERR "Usage:\n";
+ print STDERR "\tndb_error_reporter config.ini [username] [--fs]\n\n";
+ print STDERR "\tusername is a user that you can use to ssh into\n";
+ print STDERR "\t all of your nodes with.\n\n";
+ print STDERR "\t--fs means include the filesystems in the report\n";
+ print STDERR "\t WARNING: This may require a lot of disk space.\n";
+ print STDERR "\t Only use this option when asked to.\n\n";
+ exit(1);
+}
+
+my $config_file= $ARGV[0];
+my $config_get_fs= 0;
+my $config_username= '';
+if(defined($ARGV[1]))
+{
+ $config_get_fs= 1 if $ARGV[1] eq '--fs';
+ $config_username= $ARGV[1].'@' if $ARGV[1] ne '--fs';
+ $config_get_fs= (defined $ARGV[2] && $ARGV[2] eq '--fs')?1:$config_get_fs;
+}
+
+if(!stat($config_file))
+{
+ print STDERR "Cannot open configuration file.\n\n";
+ exit(1);
+}
+
+my @nodes= split ' ',`ndb_config --config-file=$ARGV[0] --nodes --query=id --type=ndbd`;
+
+push @nodes, split ' ',`ndb_config --config-file=$ARGV[0] --nodes --query=id --type=ndb_mgmd`;
+
+sub config {
+ my $nodeid= shift;
+ my $query= shift;
+ my $res= `ndb_config --config-file=$ARGV[0] --id=$nodeid --query=$query`;
+ chomp $res;
+ $res;
+}
+
+my @t= localtime();
+my $reportdir= sprintf('ndb_error_report_%u%02u%02u%02u%02u%02u',
+ ($t[5]+1900),($t[4]+1),$t[3],$t[2],$t[1],$t[0]);
+
+if(stat($reportdir) || stat($reportdir.'tar.bz2'))
+{
+ print STDERR "It looks like another ndb_error_report process is running.\n";
+ print STDERR "If that is not the case, remove the ndb_error_report directory";
+ print STDERR " and run ndb_error_report again.\n\n";
+ exit(1);
+}
+
+mkdir($reportdir);
+
+foreach my $node (@nodes)
+{
+ print "\n\n Copying data from node $node".
+ (($config_get_fs)?" with filesystem":"").
+ "\n\n";
+ my $recurse= ($config_get_fs)?'-r ':'';
+ system 'scp '.$recurse.$config_username.config($node,'host').
+ ':'.config($node,'datadir')."/ndb_".$node."* ".
+ "$reportdir/\n";
+}
+
+print "\n\n Copying configuration file...\n\n\t$config_file\n\n";
+system "cp $config_file $reportdir/";
+
+my $r = system 'bzip2 2>&1 > /dev/null < /dev/null';
+my $outfile;
+if($r==0)
+{
+ $outfile= "$reportdir.tar.bz2";
+ system "tar c $reportdir|bzip2 > $outfile";
+}
+else
+{
+ $outfile= "$reportdir.tar.gz";
+ system "tar c $reportdir|gzip > $outfile";
+}
+
+system "rm -rf $reportdir";
+
+print "\n\nPlease attach $outfile to your error report\n\n";
diff --git a/server-tools/instance-manager/instance.cc b/server-tools/instance-manager/instance.cc
index 3d54d000d5f..3d04403f830 100644
--- a/server-tools/instance-manager/instance.cc
+++ b/server-tools/instance-manager/instance.cc
@@ -255,7 +255,10 @@ static void start_and_monitor_instance(Instance_options *old_instance_options,
log_info("starting instance %s", instance_name_buff);
if (start_process(old_instance_options, &process_info))
+ {
+ instance_map->unlock();
return; /* error is logged */
+ }
/* allow users to delete instances */
instance_map->unlock();
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index a7f3d12af09..438382fa526 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -4846,7 +4846,7 @@ Disable with --skip-bdb (will save memory).",
{"bootstrap", OPT_BOOTSTRAP, "Used by mysql installation scripts.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"character-set-client-handshake", OPT_CHARACTER_SET_CLIENT_HANDSHAKE,
- "Don't use client side character set value sent during handshake.",
+ "Don't ignore client side character set value sent during handshake.",
(gptr*) &opt_character_set_client_handshake,
(gptr*) &opt_character_set_client_handshake,
0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c
index 6d4106afda5..1a17febe94a 100644
--- a/storage/myisam/mi_create.c
+++ b/storage/myisam/mi_create.c
@@ -72,7 +72,6 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
}
LINT_INIT(dfile);
LINT_INIT(file);
- pthread_mutex_lock(&THR_LOCK_myisam);
errpos=0;
options=0;
bzero((byte*) &share,sizeof(share));
@@ -135,7 +134,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
pack_reclength++;
min_pack_length++;
/* We must test for 257 as length includes pack-length */
- if (test(rec->length >= 257))
+ if (test(rec->length >= 257))
{
long_varchar_count++;
pack_reclength+= 2; /* May be packed on 3 bytes */
@@ -542,6 +541,8 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
if (! (flags & HA_DONT_TOUCH_DATA))
share.state.create_time= (long) time((time_t*) 0);
+ pthread_mutex_lock(&THR_LOCK_myisam);
+
if (ci->index_file_name)
{
fn_format(filename, ci->index_file_name,"",MI_NAME_IEXT,4);
diff --git a/storage/myisam/mi_delete.c b/storage/myisam/mi_delete.c
index bf99830b37f..416d951d138 100644
--- a/storage/myisam/mi_delete.c
+++ b/storage/myisam/mi_delete.c
@@ -170,7 +170,7 @@ static int _mi_ck_real_delete(register MI_INFO *info, MI_KEYDEF *keyinfo,
goto err;
}
if ((error=d_search(info,keyinfo,
- (keyinfo->flag & HA_FULLTEXT ? SEARCH_FIND
+ (keyinfo->flag & HA_FULLTEXT ? SEARCH_FIND | SEARCH_UPDATE
: SEARCH_SAME),
key,key_length,old_root,root_buff)) >0)
{
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index 4768e42a0b0..b18e5ee59d2 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -6706,6 +6706,14 @@ static const char esperanto[]=
"& U < \\u016d <<< \\u016c";
/*
+ A simplified version of Hungarian, without consonant contractions.
+*/
+static const char hungarian[]=
+ "&O < \\u00F6 <<< \\u00D6 << \\u0151 <<< \\u0150"
+ "&U < \\u00FC <<< \\u00DC << \\u0171 <<< \\u0170";
+
+
+/*
Unicode Collation Algorithm:
Collation element (weight) scanner,
for consequent scan of collations
@@ -8627,6 +8635,39 @@ CHARSET_INFO my_charset_ucs2_esperanto_uca_ci=
};
+CHARSET_INFO my_charset_ucs2_hungarian_uca_ci=
+{
+ 146,0,0, /* number */
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ "ucs2", /* cs name */
+ "ucs2_hungarian_ci",/* name */
+ "", /* comment */
+ hungarian, /* tailoring */
+ NULL, /* ctype */
+ NULL, /* to_lower */
+ NULL, /* to_upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ NULL, /* tab_to_uni */
+ NULL, /* tab_from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state_map */
+ NULL, /* ident_map */
+ 8, /* strxfrm_multiply */
+ 1, /* caseup_multiply */
+ 1, /* casedn_multiply */
+ 2, /* mbminlen */
+ 2, /* mbmaxlen */
+ 9, /* min_sort_char */
+ 0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_ucs2_handler,
+ &my_collation_ucs2_uca_handler
+};
+
+
#endif
@@ -9252,6 +9293,38 @@ CHARSET_INFO my_charset_utf8_esperanto_uca_ci=
&my_collation_any_uca_handler
};
+CHARSET_INFO my_charset_utf8_hungarian_uca_ci=
+{
+ 210,0,0, /* number */
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ "utf8", /* cs name */
+ "utf8_hungarian_ci",/* name */
+ "", /* comment */
+ hungarian, /* tailoring */
+ ctype_utf8, /* ctype */
+ NULL, /* to_lower */
+ NULL, /* to_upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ NULL, /* tab_to_uni */
+ NULL, /* tab_from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state_map */
+ NULL, /* ident_map */
+ 8, /* strxfrm_multiply */
+ 1, /* caseup_multiply */
+ 1, /* casedn_multiply */
+ 1, /* mbminlen */
+ 3, /* mbmaxlen */
+ 9, /* min_sort_char */
+ 0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_utf8_handler,
+ &my_collation_any_uca_handler
+};
+
#endif /* HAVE_CHARSET_utf8 */
#endif /* HAVE_UCA_COLLATIONS */
diff --git a/strings/decimal.c b/strings/decimal.c
index 9cf4a281be2..919d4c7d3bc 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1075,9 +1075,9 @@ int decimal2longlong(decimal_t *from, longlong *to)
}
}
/* boundary case: 9223372036854775808 */
- if (unlikely(from->sign==0 && x < 0 && -x < 0))
+ if (unlikely(from->sign==0 && x == LONGLONG_MIN))
{
- *to= -1-x;
+ *to= LONGLONG_MAX;
return E_DEC_OVERFLOW;
}
@@ -2681,7 +2681,8 @@ void test_pr(const char *s1, int prec, int dec, char filler, const char *orig,
int slen= sizeof(s2);
int res;
- sprintf(s, "'%s', %d, %d, '%c'", s1, prec, dec, filler);
+ sprintf(s, filler ? "'%s', %d, %d, '%c'" : "'%s', %d, %d, '\\0'",
+ s1, prec, dec, filler);
end= strend(s1);
string2decimal(s1, &a, &end);
res= decimal2string(&a, s2, &slen, prec, dec, filler);