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
beb5867d
Commit
beb5867d
authored
May 14, 2005
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
After merge fixes
parent
b4e92e63
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
200 additions
and
190 deletions
+200
-190
libmysql/libmysql.c
libmysql/libmysql.c
+17
-14
mysql-test/r/alter_table.result
mysql-test/r/alter_table.result
+114
-111
mysql-test/r/innodb.result
mysql-test/r/innodb.result
+1
-1
mysql-test/r/insert_update.result
mysql-test/r/insert_update.result
+8
-1
mysql-test/r/outfile.result
mysql-test/r/outfile.result
+0
-0
mysql-test/r/outfile2.result
mysql-test/r/outfile2.result
+0
-10
mysql-test/t/alter_table.test
mysql-test/t/alter_table.test
+52
-50
mysql-test/t/insert_update.test
mysql-test/t/insert_update.test
+5
-1
mysql-test/t/outfile.test
mysql-test/t/outfile.test
+1
-0
sql/item_func.cc
sql/item_func.cc
+1
-1
sql/sql_table.cc
sql/sql_table.cc
+1
-1
No files found.
libmysql/libmysql.c
View file @
beb5867d
...
...
@@ -1509,37 +1509,40 @@ const char * STDCALL mysql_character_set_name(MYSQL *mysql)
return
mysql
->
charset
->
csname
;
}
int
STDCALL
mysql_set_character_set
(
MYSQL
*
mysql
,
char
*
cs_name
)
{
struct
charset_info_st
*
cs
;
const
char
*
save_csdir
=
charsets_dir
;
const
char
*
save_csdir
=
charsets_dir
;
if
(
mysql
->
options
.
charset_dir
)
charsets_dir
=
mysql
->
options
.
charset_dir
;
charsets_dir
=
mysql
->
options
.
charset_dir
;
if
(
(
cs
=
get_charset_by_csname
(
cs_name
,
MY_CS_PRIMARY
,
MYF
(
0
)))
)
if
(
(
cs
=
get_charset_by_csname
(
cs_name
,
MY_CS_PRIMARY
,
MYF
(
0
)))
)
{
char
buff
[
MY_CS_NAME_SIZE
+
10
];
charsets_dir
=
save_csdir
;
charsets_dir
=
save_csdir
;
sprintf
(
buff
,
"SET NAMES %s"
,
cs_name
);
if
(
!
mysql_query
(
mysql
,
buff
))
{
mysql
->
charset
=
cs
;
if
(
!
mysql_query
(
mysql
,
buff
))
{
mysql
->
charset
=
cs
;
}
}
}
else
{
else
{
char
cs_dir_name
[
FN_REFLEN
];
get_charsets_dir
(
cs_dir_name
);
mysql
->
net
.
last_errno
=
CR_CANT_READ_CHARSET
;
mysql
->
net
.
last_errno
=
CR_CANT_READ_CHARSET
;
strmov
(
mysql
->
net
.
sqlstate
,
unknown_sqlstate
);
my_snprintf
(
mysql
->
net
.
last_error
,
sizeof
(
mysql
->
net
.
last_error
)
-
1
,
ER
(
mysql
->
net
.
last_errno
),
cs_name
,
cs_dir_name
);
my_snprintf
(
mysql
->
net
.
last_error
,
sizeof
(
mysql
->
net
.
last_error
)
-
1
,
ER
(
mysql
->
net
.
last_errno
),
cs_name
,
cs_dir_name
);
}
charsets_dir
=
save_csdir
;
charsets_dir
=
save_csdir
;
return
mysql
->
net
.
last_errno
;
}
uint
STDCALL
mysql_thread_safe
(
void
)
{
#ifdef THREAD
...
...
mysql-test/r/alter_table.result
View file @
beb5867d
This diff is collapsed.
Click to expand it.
mysql-test/r/innodb.result
View file @
beb5867d
...
...
@@ -1645,5 +1645,5 @@ concat(a, b)
drop table t1;
CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
The used table type doesn't support FULLTEXT indexes
ERROR HY000:
The used table type doesn't support FULLTEXT indexes
DROP TABLE t1;
mysql-test/r/insert_update.result
View file @
beb5867d
...
...
@@ -167,7 +167,7 @@ a b c VALUES(a)
2 1 11 NULL
DROP TABLE t1;
DROP TABLE t2;
create table t1 (a int not null unique);
create table t1 (a int not null unique)
engine=myisam
;
insert into t1 values (1),(2);
insert ignore into t1 select 1 on duplicate key update a=2;
select * from t1;
...
...
@@ -179,4 +179,11 @@ select * from t1;
a
1
3
insert into t1 select 1 on duplicate key update a=2;
select * from t1;
a
2
3
insert into t1 select a from t1 on duplicate key update a=a+1 ;
ERROR 23000: Duplicate entry '3' for key 1
drop table t1;
mysql-test/r/outfile.result
View file @
beb5867d
No preview for this file type
mysql-test/r/outfile2.result
deleted
100644 → 0
View file @
b4e92e63
drop table if exists t1;
CREATE TABLE t1 (a INT);
EXPLAIN
SELECT *
INTO OUTFILE '/tmp/t1.txt'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n'
FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
DROP TABLE t1;
mysql-test/t/alter_table.test
View file @
beb5867d
...
...
@@ -165,56 +165,6 @@ INSERT DELAYED INTO t1 VALUES(1),(2),(3);
ALTER
TABLE
t1
ENABLE
KEYS
;
drop
table
t1
;
#
# Test that data get converted when character set is changed
# Test that data doesn't get converted when src or dst is BINARY/BLOB
#
set
names
koi8r
;
create
table
t1
(
a
char
(
10
)
character
set
koi8r
);
insert
into
t1
values
(
''
);
select
a
,
hex
(
a
)
from
t1
;
alter
table
t1
change
a
a
char
(
10
)
character
set
cp1251
;
select
a
,
hex
(
a
)
from
t1
;
alter
table
t1
change
a
a
binary
(
10
);
select
a
,
hex
(
a
)
from
t1
;
alter
table
t1
change
a
a
char
(
10
)
character
set
cp1251
;
select
a
,
hex
(
a
)
from
t1
;
alter
table
t1
change
a
a
char
(
10
)
character
set
koi8r
;
select
a
,
hex
(
a
)
from
t1
;
alter
table
t1
change
a
a
varchar
(
10
)
character
set
cp1251
;
select
a
,
hex
(
a
)
from
t1
;
alter
table
t1
change
a
a
char
(
10
)
character
set
koi8r
;
select
a
,
hex
(
a
)
from
t1
;
alter
table
t1
change
a
a
text
character
set
cp1251
;
select
a
,
hex
(
a
)
from
t1
;
alter
table
t1
change
a
a
char
(
10
)
character
set
koi8r
;
select
a
,
hex
(
a
)
from
t1
;
delete
from
t1
;
#
# Test ALTER TABLE .. CHARACTER SET ..
#
show
create
table
t1
;
alter
table
t1
DEFAULT
CHARACTER
SET
latin1
;
show
create
table
t1
;
alter
table
t1
CONVERT
TO
CHARACTER
SET
latin1
;
show
create
table
t1
;
alter
table
t1
DEFAULT
CHARACTER
SET
cp1251
;
show
create
table
t1
;
drop
table
t1
;
#
# Bug#2821
# Test that table CHARACTER SET does not affect blobs
#
create
table
t1
(
myblob
longblob
,
mytext
longtext
)
default
charset
latin1
collate
latin1_general_cs
;
show
create
table
t1
;
alter
table
t1
character
set
latin2
;
show
create
table
t1
;
drop
table
t1
;
#
# Test ALTER TABLE ENABLE/DISABLE keys when things are locked
#
...
...
@@ -317,6 +267,58 @@ insert into t1 (a) values(1);
--
replace_column
7
X
8
X
9
X
10
X
11
X
12
X
13
X
14
X
show
table
status
like
't1'
;
drop
table
t1
;
#
# Test that data get converted when character set is changed
# Test that data doesn't get converted when src or dst is BINARY/BLOB
#
set
names
koi8r
;
create
table
t1
(
a
char
(
10
)
character
set
koi8r
);
insert
into
t1
values
(
''
);
select
a
,
hex
(
a
)
from
t1
;
alter
table
t1
change
a
a
char
(
10
)
character
set
cp1251
;
select
a
,
hex
(
a
)
from
t1
;
alter
table
t1
change
a
a
binary
(
10
);
select
a
,
hex
(
a
)
from
t1
;
alter
table
t1
change
a
a
char
(
10
)
character
set
cp1251
;
select
a
,
hex
(
a
)
from
t1
;
alter
table
t1
change
a
a
char
(
10
)
character
set
koi8r
;
select
a
,
hex
(
a
)
from
t1
;
alter
table
t1
change
a
a
varchar
(
10
)
character
set
cp1251
;
select
a
,
hex
(
a
)
from
t1
;
alter
table
t1
change
a
a
char
(
10
)
character
set
koi8r
;
select
a
,
hex
(
a
)
from
t1
;
alter
table
t1
change
a
a
text
character
set
cp1251
;
select
a
,
hex
(
a
)
from
t1
;
alter
table
t1
change
a
a
char
(
10
)
character
set
koi8r
;
select
a
,
hex
(
a
)
from
t1
;
delete
from
t1
;
#
# Test ALTER TABLE .. CHARACTER SET ..
#
show
create
table
t1
;
alter
table
t1
DEFAULT
CHARACTER
SET
latin1
;
show
create
table
t1
;
alter
table
t1
CONVERT
TO
CHARACTER
SET
latin1
;
show
create
table
t1
;
alter
table
t1
DEFAULT
CHARACTER
SET
cp1251
;
show
create
table
t1
;
drop
table
t1
;
#
# Bug#2821
# Test that table CHARACTER SET does not affect blobs
#
create
table
t1
(
myblob
longblob
,
mytext
longtext
)
default
charset
latin1
collate
latin1_general_cs
;
show
create
table
t1
;
alter
table
t1
character
set
latin2
;
show
create
table
t1
;
drop
table
t1
;
#
# Bug 2361 (Don't drop UNIQUE with DROP PRIMARY KEY)
#
...
...
mysql-test/t/insert_update.test
View file @
beb5867d
...
...
@@ -85,10 +85,14 @@ DROP TABLE t2;
# Bug#9725 - "disapearing query/hang" and "unknown error" with "on duplicate key update"
# INSERT INGORE...UPDATE gives bad error or breaks protocol.
#
create
table
t1
(
a
int
not
null
unique
);
create
table
t1
(
a
int
not
null
unique
)
engine
=
myisam
;
insert
into
t1
values
(
1
),(
2
);
insert
ignore
into
t1
select
1
on
duplicate
key
update
a
=
2
;
select
*
from
t1
;
insert
ignore
into
t1
select
a
from
t1
on
duplicate
key
update
a
=
a
+
1
;
select
*
from
t1
;
insert
into
t1
select
1
on
duplicate
key
update
a
=
2
;
select
*
from
t1
;
--
error
1062
insert
into
t1
select
a
from
t1
on
duplicate
key
update
a
=
a
+
1
;
drop
table
t1
;
mysql-test/t/outfile.test
View file @
beb5867d
...
...
@@ -38,6 +38,7 @@ select load_file(concat(@tmpdir,"/outfile-test.3"));
#--error 1086
#eval select * into dumpfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.3" from t1;
#enable_query_log;
--
error
13
,
2
select
load_file
(
concat
(
@
tmpdir
,
"/outfile-test.not-exist"
));
--
exec
rm
$MYSQL_TEST_DIR
/
var
/
tmp
/
outfile
-
test
.
1
--
exec
rm
$MYSQL_TEST_DIR
/
var
/
tmp
/
outfile
-
test
.
2
...
...
sql/item_func.cc
View file @
beb5867d
...
...
@@ -3176,7 +3176,7 @@ bool Item_func_match::fix_fields(THD *thd, TABLE_LIST *tlist, Item **ref)
table
=
((
Item_field
*
)
item
)
->
field
->
table
;
if
(
!
(
table
->
file
->
table_flags
()
&
HA_CAN_FULLTEXT
))
{
my_error
(
ER_TABLE_CANT_HANDLE_F
ULLTEX
T
,
MYF
(
0
));
my_error
(
ER_TABLE_CANT_HANDLE_FT
,
MYF
(
0
));
return
1
;
}
table
->
fulltext_searched
=
1
;
...
...
sql/sql_table.cc
View file @
beb5867d
...
...
@@ -1205,6 +1205,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
/* Sort keys in optimized order */
qsort
((
gptr
)
key_info_buffer
,
*
key_count
,
sizeof
(
KEY
),
(
qsort_cmp
)
sort_keys
);
create_info
->
null_bits
=
null_fields
;
DBUG_RETURN
(
0
);
}
...
...
@@ -1392,7 +1393,6 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
if
(
thd
->
variables
.
sql_mode
&
MODE_NO_DIR_IN_CREATE
)
create_info
->
data_file_name
=
create_info
->
index_file_name
=
0
;
create_info
->
table_options
=
db_options
;
create_info
->
null_bits
=
null_fields
;
if
(
rea_create_table
(
thd
,
path
,
create_info
,
fields
,
key_count
,
key_info_buffer
))
...
...
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