Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
a81d480d
Commit
a81d480d
authored
Mar 14, 2004
by
miguel@hegel.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge miguel@bk-internal.mysql.com:/home/bk/mysql-4.1
into hegel.local:/home/miguel/bk/mysql-4.1
parents
0c92e904
ded8fa56
Changes
33
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
205 additions
and
33 deletions
+205
-33
include/m_string.h
include/m_string.h
+3
-0
include/mysqld_error.h
include/mysqld_error.h
+2
-1
libmysqld/lib_sql.cc
libmysqld/lib_sql.cc
+0
-17
mysql-test/r/create.result
mysql-test/r/create.result
+55
-0
mysql-test/r/insert.result
mysql-test/r/insert.result
+2
-8
mysql-test/r/mysqldump.result
mysql-test/r/mysqldump.result
+0
-2
mysql-test/t/create.test
mysql-test/t/create.test
+39
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+8
-1
sql/share/czech/errmsg.txt
sql/share/czech/errmsg.txt
+1
-0
sql/share/danish/errmsg.txt
sql/share/danish/errmsg.txt
+1
-0
sql/share/dutch/errmsg.txt
sql/share/dutch/errmsg.txt
+1
-0
sql/share/english/errmsg.txt
sql/share/english/errmsg.txt
+1
-0
sql/share/estonian/errmsg.txt
sql/share/estonian/errmsg.txt
+1
-0
sql/share/french/errmsg.txt
sql/share/french/errmsg.txt
+1
-0
sql/share/german/errmsg.txt
sql/share/german/errmsg.txt
+1
-0
sql/share/greek/errmsg.txt
sql/share/greek/errmsg.txt
+1
-0
sql/share/hungarian/errmsg.txt
sql/share/hungarian/errmsg.txt
+1
-0
sql/share/italian/errmsg.txt
sql/share/italian/errmsg.txt
+1
-0
sql/share/japanese/errmsg.txt
sql/share/japanese/errmsg.txt
+1
-0
sql/share/korean/errmsg.txt
sql/share/korean/errmsg.txt
+1
-0
sql/share/norwegian-ny/errmsg.txt
sql/share/norwegian-ny/errmsg.txt
+1
-0
sql/share/norwegian/errmsg.txt
sql/share/norwegian/errmsg.txt
+1
-0
sql/share/polish/errmsg.txt
sql/share/polish/errmsg.txt
+1
-0
sql/share/portuguese/errmsg.txt
sql/share/portuguese/errmsg.txt
+1
-0
sql/share/romanian/errmsg.txt
sql/share/romanian/errmsg.txt
+1
-0
sql/share/russian/errmsg.txt
sql/share/russian/errmsg.txt
+1
-0
sql/share/serbian/errmsg.txt
sql/share/serbian/errmsg.txt
+1
-0
sql/share/slovak/errmsg.txt
sql/share/slovak/errmsg.txt
+1
-0
sql/share/spanish/errmsg.txt
sql/share/spanish/errmsg.txt
+1
-0
sql/share/swedish/errmsg.txt
sql/share/swedish/errmsg.txt
+1
-0
sql/share/ukrainian/errmsg.txt
sql/share/ukrainian/errmsg.txt
+1
-0
sql/sql_table.cc
sql/sql_table.cc
+62
-1
strings/strtod.c
strings/strtod.c
+11
-3
No files found.
include/m_string.h
View file @
a81d480d
...
...
@@ -218,6 +218,9 @@ extern int is_prefix(const char *, const char *);
/* Conversion routines */
double
my_strtod
(
const
char
*
str
,
char
**
end
);
double
my_atof
(
const
char
*
nptr
);
#ifndef EOVERFLOW
#define EOVERFLOW 84
#endif
#ifdef USE_MY_ITOA
extern
char
*
my_itoa
(
int
val
,
char
*
dst
,
int
radix
);
...
...
include/mysqld_error.h
View file @
a81d480d
...
...
@@ -307,4 +307,5 @@
#define ER_NON_UPDATABLE_TABLE 1288
#define ER_FEATURE_DISABLED 1289
#define ER_OPTION_PREVENTS_STATEMENT 1290
#define ER_ERROR_MESSAGES 291
#define ER_DUPLICATED_VALUE_IN_TYPE 1291
#define ER_ERROR_MESSAGES 292
libmysqld/lib_sql.cc
View file @
a81d480d
...
...
@@ -398,23 +398,6 @@ int init_embedded_server(int argc, char **argv, char **groups)
udf_init
();
#endif
if
(
opt_bin_log
)
{
if
(
!
opt_bin_logname
)
{
char
tmp
[
FN_REFLEN
];
/* TODO: The following should be using fn_format(); We just need to
first change fn_format() to cut the file name if it's too long.
*/
strmake
(
tmp
,
glob_hostname
,
FN_REFLEN
-
5
);
strmov
(
strcend
(
tmp
,
'.'
),
"-bin"
);
opt_bin_logname
=
my_strdup
(
tmp
,
MYF
(
MY_WME
));
}
open_log
(
&
mysql_bin_log
,
glob_hostname
,
opt_bin_logname
,
"-bin"
,
opt_binlog_index_name
,
LOG_BIN
,
0
,
0
,
max_binlog_size
);
using_update_log
=
1
;
}
(
void
)
thr_setconcurrency
(
concurrency
);
// 10 by default
if
(
...
...
mysql-test/r/create.result
View file @
a81d480d
...
...
@@ -456,6 +456,20 @@ Field Type Null Key Default Extra
name varchar(10) YES NULL
age smallint(6) YES -1
drop table t1, t2;
create table t1(cenum enum('a'), cset set('b'));
create table t2(cenum enum('a','a'), cset set('b','b'));
Warnings:
Error 1291 Column 'cenum' has duplicated value 'a' in ENUM
Error 1291 Column 'cset' has duplicated value 'b' in SET
create table t3(cenum enum('a','A','a','c','c'), cset set('b','B','b','d','d'));
Warnings:
Error 1291 Column 'cenum' has duplicated value 'a' in ENUM
Error 1291 Column 'cenum' has duplicated value 'A' in ENUM
Error 1291 Column 'cenum' has duplicated value 'c' in ENUM
Error 1291 Column 'cset' has duplicated value 'b' in SET
Error 1291 Column 'cset' has duplicated value 'B' in SET
Error 1291 Column 'cset' has duplicated value 'd' in SET
drop table t1, t2, t3;
create database test_$1;
use test_$1;
select database();
...
...
@@ -468,3 +482,44 @@ NULL
select database();
database()
NULL
use test;
create table t1 (a int, index `primary` (a));
ERROR 42000: Incorrect index name 'primary'
create table t1 (a int, index `PRIMARY` (a));
ERROR 42000: Incorrect index name 'PRIMARY'
create table t1 (`primary` int, index(`primary`));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`primary` int(11) default NULL,
KEY `primary_2` (`primary`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create table t2 (`PRIMARY` int, index(`PRIMARY`));
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`PRIMARY` int(11) default NULL,
KEY `PRIMARY_2` (`PRIMARY`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create table t3 (a int);
alter table t3 add index `primary` (a);
ERROR 42000: Incorrect index name 'primary'
alter table t3 add index `PRIMARY` (a);
ERROR 42000: Incorrect index name 'PRIMARY'
create table t4 (`primary` int);
alter table t4 add index(`primary`);
show create table t4;
Table Create Table
t4 CREATE TABLE `t4` (
`primary` int(11) default NULL,
KEY `primary_2` (`primary`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create table t5 (`PRIMARY` int);
alter table t5 add index(`PRIMARY`);
show create table t5;
Table Create Table
t5 CREATE TABLE `t5` (
`PRIMARY` int(11) default NULL,
KEY `PRIMARY_2` (`PRIMARY`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2, t3, t4, t5;
mysql-test/r/insert.result
View file @
a81d480d
...
...
@@ -169,7 +169,6 @@ set @value= "1e+1111111111a";
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
Warnings:
Warning 1265 Data truncated for column 'f_double ' at row 1
Warning 1264 Data truncated, out of range for column 'f_double ' at row 1
Warning 1265 Data truncated for column 'f_float ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float ' at row 1
Warning 1265 Data truncated for column 'f_double_7_2 ' at row 1
...
...
@@ -177,7 +176,6 @@ Warning 1264 Data truncated, out of range for column 'f_double_7_2 ' at row 1
Warning 1265 Data truncated for column 'f_float_4_3 ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float_4_3 ' at row 1
Warning 1265 Data truncated for column 'f_double_u ' at row 1
Warning 1264 Data truncated, out of range for column 'f_double_u ' at row 1
Warning 1265 Data truncated for column 'f_float_u ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float_u ' at row 1
Warning 1265 Data truncated for column 'f_double_15_1_u ' at row 1
...
...
@@ -199,7 +197,6 @@ set @value= "-1e+1111111111a";
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
Warnings:
Warning 1265 Data truncated for column 'f_double ' at row 1
Warning 1264 Data truncated, out of range for column 'f_double ' at row 1
Warning 1265 Data truncated for column 'f_float ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float ' at row 1
Warning 1265 Data truncated for column 'f_double_7_2 ' at row 1
...
...
@@ -228,17 +225,15 @@ f_float_3_1_u 0.0
set @value= 1e+1111111111;
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
Warnings:
Warning 1264 Data truncated, out of range for column 'f_double ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float ' at row 1
Warning 1264 Data truncated, out of range for column 'f_double_7_2 ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float_4_3 ' at row 1
Warning 1264 Data truncated, out of range for column 'f_double_u ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float_u ' at row 1
Warning 1264 Data truncated, out of range for column 'f_double_15_1_u ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float_3_1_u ' at row 1
select * from t1 where `number `=last_insert_id();
number 6
original_value
inf
original_value
1.7976931348623e+308
f_double 1.79769313486232e+308
f_float 3.40282e+38
f_double_7_2 99999.99
...
...
@@ -250,7 +245,6 @@ f_float_3_1_u 99.9
set @value= -1e+1111111111;
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
Warnings:
Warning 1264 Data truncated, out of range for column 'f_double ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float ' at row 1
Warning 1264 Data truncated, out of range for column 'f_double_7_2 ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float_4_3 ' at row 1
...
...
@@ -260,7 +254,7 @@ Warning 1264 Data truncated, out of range for column 'f_double_15_1_u ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float_3_1_u ' at row 1
select * from t1 where `number `=last_insert_id();
number 7
original_value -
inf
original_value -
1.7976931348623e+308
f_double -1.79769313486232e+308
f_float -3.40282e+38
f_double_7_2 -99999.99
...
...
mysql-test/r/mysqldump.result
View file @
a81d480d
...
...
@@ -46,8 +46,6 @@ UNLOCK TABLES;
DROP TABLE t1;
CREATE TABLE t1 (a double);
INSERT INTO t1 VALUES (-9e999999);
Warnings:
Warning 1264 Data truncated, out of range for column 'a' at row 1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
...
...
mysql-test/t/create.test
View file @
a81d480d
...
...
@@ -346,6 +346,15 @@ create table t2(name varchar(10), age smallint default - 1);
describe
t2
;
drop
table
t1
,
t2
;
#
# test for bug #1427 "enum allows duplicate values in the list"
#
create
table
t1
(
cenum
enum
(
'a'
),
cset
set
(
'b'
));
create
table
t2
(
cenum
enum
(
'a'
,
'a'
),
cset
set
(
'b'
,
'b'
));
create
table
t3
(
cenum
enum
(
'a'
,
'A'
,
'a'
,
'c'
,
'c'
),
cset
set
(
'b'
,
'B'
,
'b'
,
'd'
,
'd'
));
drop
table
t1
,
t2
,
t3
;
#
# Bug #1209
#
...
...
@@ -359,3 +368,33 @@ select database();
# Connect without a database
connect
(
user4
,
localhost
,
mysqltest_1
,,
*
NO
-
ONE
*
);
select
database
();
#
# Test for Bug 856 'Naming a key "Primary" causes trouble'
#
use
test
;
--
error
1280
create
table
t1
(
a
int
,
index
`primary`
(
a
));
--
error
1280
create
table
t1
(
a
int
,
index
`PRIMARY`
(
a
));
create
table
t1
(
`primary`
int
,
index
(
`primary`
));
show
create
table
t1
;
create
table
t2
(
`PRIMARY`
int
,
index
(
`PRIMARY`
));
show
create
table
t2
;
create
table
t3
(
a
int
);
--
error
1280
alter
table
t3
add
index
`primary`
(
a
);
--
error
1280
alter
table
t3
add
index
`PRIMARY`
(
a
);
create
table
t4
(
`primary`
int
);
alter
table
t4
add
index
(
`primary`
);
show
create
table
t4
;
create
table
t5
(
`PRIMARY`
int
);
alter
table
t5
add
index
(
`PRIMARY`
);
show
create
table
t5
;
drop
table
t1
,
t2
,
t3
,
t4
,
t5
;
sql/item_strfunc.cc
View file @
a81d480d
...
...
@@ -2754,7 +2754,14 @@ String *Item_func_uuid::val_str(String *str)
tv
++
;
}
else
nanoseq
=
0
;
{
if
(
nanoseq
)
{
tv
-=
nanoseq
;
nanoseq
=
0
;
}
DBUG_ASSERT
(
tv
>
uuid_time
);
}
uuid_time
=
tv
;
pthread_mutex_unlock
(
&
LOCK_uuid_generator
);
...
...
sql/share/czech/errmsg.txt
View file @
a81d480d
...
...
@@ -303,3 +303,4 @@ character-set=latin2
"The target table %-.100s of the %s is not updatable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/danish/errmsg.txt
View file @
a81d480d
...
...
@@ -297,3 +297,4 @@ character-set=latin1
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/dutch/errmsg.txt
View file @
a81d480d
...
...
@@ -305,3 +305,4 @@ character-set=latin1
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/english/errmsg.txt
View file @
a81d480d
...
...
@@ -294,3 +294,4 @@ character-set=latin1
"The target table %-.100s of the %s is not updatable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/estonian/errmsg.txt
View file @
a81d480d
...
...
@@ -299,3 +299,4 @@ character-set=latin7
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/french/errmsg.txt
View file @
a81d480d
...
...
@@ -294,3 +294,4 @@ character-set=latin1
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/german/errmsg.txt
View file @
a81d480d
...
...
@@ -306,3 +306,4 @@ character-set=latin1
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/greek/errmsg.txt
View file @
a81d480d
...
...
@@ -294,3 +294,4 @@ character-set=greek
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/hungarian/errmsg.txt
View file @
a81d480d
...
...
@@ -296,3 +296,4 @@ character-set=latin2
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/italian/errmsg.txt
View file @
a81d480d
...
...
@@ -294,3 +294,4 @@ character-set=latin1
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/japanese/errmsg.txt
View file @
a81d480d
...
...
@@ -296,3 +296,4 @@ character-set=ujis
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/korean/errmsg.txt
View file @
a81d480d
...
...
@@ -294,3 +294,4 @@ character-set=euckr
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/norwegian-ny/errmsg.txt
View file @
a81d480d
...
...
@@ -296,3 +296,4 @@ character-set=latin1
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/norwegian/errmsg.txt
View file @
a81d480d
...
...
@@ -296,3 +296,4 @@ character-set=latin1
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/polish/errmsg.txt
View file @
a81d480d
...
...
@@ -298,3 +298,4 @@ character-set=latin2
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/portuguese/errmsg.txt
View file @
a81d480d
...
...
@@ -295,3 +295,4 @@ character-set=latin1
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/romanian/errmsg.txt
View file @
a81d480d
...
...
@@ -298,3 +298,4 @@ character-set=latin2
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/russian/errmsg.txt
View file @
a81d480d
...
...
@@ -296,3 +296,4 @@ character-set=koi8r
" %-.100s %s ",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/serbian/errmsg.txt
View file @
a81d480d
...
...
@@ -288,3 +288,4 @@ character-set=cp1250
"The target table %-.100s of the %s is not updatable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working"
"The MySQL server is running with the %s option so it cannot execute this statement"
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/slovak/errmsg.txt
View file @
a81d480d
...
...
@@ -302,3 +302,4 @@ character-set=latin2
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/spanish/errmsg.txt
View file @
a81d480d
...
...
@@ -296,3 +296,4 @@ character-set=latin1
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/swedish/errmsg.txt
View file @
a81d480d
...
...
@@ -294,3 +294,4 @@ character-set=latin1
"'%s' är inte aktiverad; För att aktivera detta måste du bygga om MySQL med '%s' definerad",
"MySQL är started i --skip-grant-tables mod. Pga av detta kan du inte använda detta program",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/share/ukrainian/errmsg.txt
View file @
a81d480d
...
...
@@ -299,3 +299,4 @@ character-set=koi8u
" %-.100s %s ",
"The '%s' feature was disabled; you need MySQL built with '%s' to have it working",
"The MySQL server is running with the %s option so it cannot execute this statement",
"Column '%-.100s' has duplicated value '%-.64s' in %s"
sql/sql_table.cc
View file @
a81d480d
...
...
@@ -342,6 +342,50 @@ static int sort_keys(KEY *a, KEY *b)
0
);
}
/*
Check TYPELIB (set or enum) for duplicates
SYNOPSIS
check_duplicates_in_interval()
set_or_name "SET" or "ENUM" string for warning message
name name of the checked column
typelib list of values for the column
DESCRIPTION
This function prints an warning for each value in list
which has some duplicates on its right
RETURN VALUES
void
*/
void
check_duplicates_in_interval
(
const
char
*
set_or_name
,
const
char
*
name
,
TYPELIB
*
typelib
)
{
unsigned
int
old_count
=
typelib
->
count
;
const
char
**
old_type_names
=
typelib
->
type_names
;
if
(
typelib
->
count
<=
1
)
return
;
old_count
=
typelib
->
count
;
old_type_names
=
typelib
->
type_names
;
const
char
**
cur_value
=
typelib
->
type_names
;
for
(
;
typelib
->
count
>
1
;
cur_value
++
)
{
typelib
->
type_names
++
;
typelib
->
count
--
;
if
(
find_type
((
char
*
)
*
cur_value
,
typelib
,
1
))
{
push_warning_printf
(
current_thd
,
MYSQL_ERROR
::
WARN_LEVEL_ERROR
,
ER_DUPLICATED_VALUE_IN_TYPE
,
ER
(
ER_DUPLICATED_VALUE_IN_TYPE
),
name
,
*
cur_value
,
set_or_name
);
}
}
typelib
->
count
=
old_count
;
typelib
->
type_names
=
old_type_names
;
}
/*
Create a table
...
...
@@ -546,6 +590,8 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
if
(
sql_field
->
charset
->
state
&
MY_CS_BINSORT
)
sql_field
->
pack_flag
|=
FIELDFLAG_BINARY
;
sql_field
->
unireg_check
=
Field
::
INTERVAL_FIELD
;
check_duplicates_in_interval
(
"ENUM"
,
sql_field
->
field_name
,
sql_field
->
interval
);
break
;
case
FIELD_TYPE_SET
:
sql_field
->
pack_flag
=
pack_length_to_packflag
(
sql_field
->
pack_length
)
|
...
...
@@ -553,6 +599,8 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
if
(
sql_field
->
charset
->
state
&
MY_CS_BINSORT
)
sql_field
->
pack_flag
|=
FIELDFLAG_BINARY
;
sql_field
->
unireg_check
=
Field
::
BIT_FIELD
;
check_duplicates_in_interval
(
"SET"
,
sql_field
->
field_name
,
sql_field
->
interval
);
break
;
case
FIELD_TYPE_DATE
:
// Rest of string types
case
FIELD_TYPE_NEWDATE
:
...
...
@@ -639,6 +687,12 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
DBUG_RETURN
(
-
1
);
}
key_parts
+=
key
->
columns
.
elements
;
if
(
key
->
name
&&
!
tmp_table
&&
!
my_strcasecmp
(
system_charset_info
,
key
->
name
,
primary_key_name
))
{
my_error
(
ER_WRONG_NAME_FOR_INDEX
,
MYF
(
0
),
key
->
name
);
DBUG_RETURN
(
-
1
);
}
}
tmp
=
min
(
file
->
max_keys
(),
MAX_KEY
);
if
(
key_count
>
tmp
)
...
...
@@ -1079,7 +1133,8 @@ make_unique_key_name(const char *field_name,KEY *start,KEY *end)
{
char
buff
[
MAX_FIELD_NAME
],
*
buff_end
;
if
(
!
check_if_keyname_exists
(
field_name
,
start
,
end
))
if
(
!
check_if_keyname_exists
(
field_name
,
start
,
end
)
&&
my_strcasecmp
(
system_charset_info
,
field_name
,
primary_key_name
))
return
(
char
*
)
field_name
;
// Use fieldname
buff_end
=
strmake
(
buff
,
field_name
,
MAX_FIELD_NAME
-
4
);
for
(
uint
i
=
2
;
;
i
++
)
...
...
@@ -2403,6 +2458,12 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
{
if
(
key
->
type
!=
Key
::
FOREIGN_KEY
)
key_list
.
push_back
(
key
);
if
(
key
->
name
&&
!
my_strcasecmp
(
system_charset_info
,
key
->
name
,
primary_key_name
))
{
my_error
(
ER_WRONG_NAME_FOR_INDEX
,
MYF
(
0
),
key
->
name
);
DBUG_RETURN
(
-
1
);
}
}
}
...
...
strings/strtod.c
View file @
a81d480d
...
...
@@ -2,7 +2,7 @@
An alternative implementation of "strtod()" that is both
simplier, and thread-safe.
From mit-threads as bundled with MySQL 3.2
2
From mit-threads as bundled with MySQL 3.2
3
SQL:2003 specifies a number as
...
...
@@ -41,6 +41,7 @@ double my_strtod(const char *str, char **end)
double
result
=
0
.
0
;
int
negative
,
ndigits
;
const
char
*
old_str
;
my_bool
overflow
=
0
;
while
(
my_isspace
(
&
my_charset_latin1
,
*
str
))
str
++
;
...
...
@@ -85,7 +86,8 @@ double my_strtod(const char *str, char **end)
double
scaler
=
1
.
0
;
while
(
my_isdigit
(
&
my_charset_latin1
,
*
str
))
{
exp
=
exp
*
10
+
*
str
-
'0'
;
if
(
exp
<
9999
)
/* protection against exp overflow */
exp
=
exp
*
10
+
*
str
-
'0'
;
str
++
;
}
if
(
exp
>=
1000
)
...
...
@@ -93,7 +95,7 @@ double my_strtod(const char *str, char **end)
if
(
neg
)
result
=
0
.
0
;
else
result
=
DBL_MAX
*
10
;
overflow
=
1
;
goto
done
;
}
while
(
exp
>=
100
)
...
...
@@ -113,6 +115,12 @@ done:
if
(
end
)
*
end
=
(
char
*
)
str
;
if
(
overflow
||
((
overflow
=
isinf
(
result
))))
{
result
=
DBL_MAX
;
errno
=
EOVERFLOW
;
}
return
negative
?
-
result
:
result
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment