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
4fa86749
Commit
4fa86749
authored
Dec 14, 2004
by
bar@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug#6275 "client_test" fail in 4.1.7 make test
bug#6911 resultset metadata always return client character set
parent
94b3e06d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
17 deletions
+32
-17
mysql-test/r/type_enum.result
mysql-test/r/type_enum.result
+3
-3
sql/item.h
sql/item.h
+1
-1
sql/protocol.cc
sql/protocol.cc
+10
-2
tests/client_test.c
tests/client_test.c
+18
-11
No files found.
mysql-test/r/type_enum.result
View file @
4fa86749
...
@@ -1731,9 +1731,9 @@ alter table t1 add b set ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin;
...
@@ -1731,9 +1731,9 @@ alter table t1 add b set ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin;
alter table t1 add c enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin;
alter table t1 add c enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin;
select * from t1;
select * from t1;
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 t1 a a 254
3
1 Y 384 0 8
def test t1 t1 a a 254
1
1 Y 384 0 8
def test t1 t1 b b 254
9
0 Y 2176 0 8
def test t1 t1 b b 254
3
0 Y 2176 0 8
def test t1 t1 c c 254
3
0 Y 384 0 8
def test t1 t1 c c 254
1
0 Y 384 0 8
a b c
a b c
Y NULL NULL
Y NULL NULL
drop table t1;
drop table t1;
...
...
sql/item.h
View file @
4fa86749
...
@@ -765,7 +765,7 @@ class Item_empty_string :public Item_string
...
@@ -765,7 +765,7 @@ class Item_empty_string :public Item_string
public:
public:
Item_empty_string
(
const
char
*
header
,
uint
length
,
CHARSET_INFO
*
cs
=
NULL
)
:
Item_empty_string
(
const
char
*
header
,
uint
length
,
CHARSET_INFO
*
cs
=
NULL
)
:
Item_string
(
""
,
0
,
cs
?
cs
:
&
my_charset_bin
)
Item_string
(
""
,
0
,
cs
?
cs
:
&
my_charset_bin
)
{
name
=
(
char
*
)
header
;
max_length
=
length
;
}
{
name
=
(
char
*
)
header
;
max_length
=
cs
?
length
*
cs
->
mbmaxlen
:
length
;
}
void
make_field
(
Send_field
*
field
);
void
make_field
(
Send_field
*
field
);
};
};
...
...
sql/protocol.cc
View file @
4fa86749
...
@@ -549,10 +549,18 @@ bool Protocol::send_fields(List<Item> *list, uint flag)
...
@@ -549,10 +549,18 @@ bool Protocol::send_fields(List<Item> *list, uint flag)
pos
=
(
char
*
)
local_packet
->
ptr
()
+
local_packet
->
length
();
pos
=
(
char
*
)
local_packet
->
ptr
()
+
local_packet
->
length
();
*
pos
++=
12
;
// Length of packed fields
*
pos
++=
12
;
// Length of packed fields
if
(
item
->
collation
.
collation
==
&
my_charset_bin
||
thd_charset
==
NULL
)
if
(
item
->
collation
.
collation
==
&
my_charset_bin
||
thd_charset
==
NULL
)
{
/* No conversion */
int2store
(
pos
,
field
.
charsetnr
);
int2store
(
pos
,
field
.
charsetnr
);
int4store
(
pos
+
2
,
field
.
length
);
}
else
else
{
/* With conversion */
int2store
(
pos
,
thd_charset
->
number
);
int2store
(
pos
,
thd_charset
->
number
);
int4store
(
pos
+
2
,
field
.
length
);
uint
char_len
=
field
.
length
/
item
->
collation
.
collation
->
mbmaxlen
;
int4store
(
pos
+
2
,
char_len
*
thd_charset
->
mbmaxlen
);
}
pos
[
6
]
=
field
.
type
;
pos
[
6
]
=
field
.
type
;
int2store
(
pos
+
7
,
field
.
flags
);
int2store
(
pos
+
7
,
field
.
flags
);
pos
[
9
]
=
(
char
)
field
.
decimals
;
pos
[
9
]
=
(
char
)
field
.
decimals
;
...
...
tests/client_test.c
View file @
4fa86749
...
@@ -1101,7 +1101,8 @@ static void test_prepare_simple()
...
@@ -1101,7 +1101,8 @@ static void test_prepare_simple()
mysql_stmt_close
(
stmt
);
mysql_stmt_close
(
stmt
);
/* update */
/* update */
strmov
(
query
,
"UPDATE test_prepare_simple SET id=? WHERE id=? AND name= ?"
);
strmov
(
query
,
"UPDATE test_prepare_simple SET id=? "
"WHERE id=? AND CONVERT(name USING utf8)= ?"
);
stmt
=
mysql_simple_prepare
(
mysql
,
query
);
stmt
=
mysql_simple_prepare
(
mysql
,
query
);
check_stmt
(
stmt
);
check_stmt
(
stmt
);
...
@@ -1129,7 +1130,8 @@ static void test_prepare_simple()
...
@@ -1129,7 +1130,8 @@ static void test_prepare_simple()
mysql_stmt_close
(
stmt
);
mysql_stmt_close
(
stmt
);
/* select */
/* select */
strmov
(
query
,
"SELECT * FROM test_prepare_simple WHERE id=? AND name= ?"
);
strmov
(
query
,
"SELECT * FROM test_prepare_simple WHERE id=? "
"AND CONVERT(name USING utf8)= ?"
);
stmt
=
mysql_simple_prepare
(
mysql
,
query
);
stmt
=
mysql_simple_prepare
(
mysql
,
query
);
check_stmt
(
stmt
);
check_stmt
(
stmt
);
...
@@ -1158,7 +1160,7 @@ static void test_prepare_field_result()
...
@@ -1158,7 +1160,7 @@ static void test_prepare_field_result()
rc
=
mysql_query
(
mysql
,
"CREATE TABLE test_prepare_field_result(int_c int, "
rc
=
mysql_query
(
mysql
,
"CREATE TABLE test_prepare_field_result(int_c int, "
"var_c varchar(50), ts_c timestamp(14), "
"var_c varchar(50), ts_c timestamp(14), "
"char_c char(
3
), date_c date, extra tinyint)"
);
"char_c char(
4
), date_c date, extra tinyint)"
);
myquery
(
rc
);
myquery
(
rc
);
/* insert */
/* insert */
...
@@ -1184,8 +1186,8 @@ static void test_prepare_field_result()
...
@@ -1184,8 +1186,8 @@ static void test_prepare_field_result()
"t1"
,
"test_prepare_field_result"
,
current_db
,
10
,
0
);
"t1"
,
"test_prepare_field_result"
,
current_db
,
10
,
0
);
verify_prepare_field
(
result
,
3
,
"ts_c"
,
"ts_c"
,
MYSQL_TYPE_TIMESTAMP
,
verify_prepare_field
(
result
,
3
,
"ts_c"
,
"ts_c"
,
MYSQL_TYPE_TIMESTAMP
,
"t1"
,
"test_prepare_field_result"
,
current_db
,
19
,
0
);
"t1"
,
"test_prepare_field_result"
,
current_db
,
19
,
0
);
verify_prepare_field
(
result
,
4
,
"char_c"
,
"char_c"
,
MYSQL_TYPE_STRING
,
verify_prepare_field
(
result
,
4
,
"char_c"
,
"char_c"
,
MYSQL_TYPE_
VAR_
STRING
,
"t1"
,
"test_prepare_field_result"
,
current_db
,
3
,
0
);
"t1"
,
"test_prepare_field_result"
,
current_db
,
4
,
0
);
verify_field_count
(
result
,
5
);
verify_field_count
(
result
,
5
);
mysql_free_result
(
result
);
mysql_free_result
(
result
);
...
@@ -1921,7 +1923,8 @@ static void test_select()
...
@@ -1921,7 +1923,8 @@ static void test_select()
rc
=
mysql_commit
(
mysql
);
rc
=
mysql_commit
(
mysql
);
myquery
(
rc
);
myquery
(
rc
);
strmov
(
query
,
"SELECT * FROM test_select WHERE id= ? AND name=?"
);
strmov
(
query
,
"SELECT * FROM test_select WHERE id= ? "
"AND CONVERT(name USING utf8) =?"
);
stmt
=
mysql_simple_prepare
(
mysql
,
query
);
stmt
=
mysql_simple_prepare
(
mysql
,
query
);
check_stmt
(
stmt
);
check_stmt
(
stmt
);
...
@@ -1981,7 +1984,8 @@ static void test_ps_conj_select()
...
@@ -1981,7 +1984,8 @@ static void test_ps_conj_select()
"(2, 'hh', 'hh'), (1, 'ii', 'ii'), (2, 'ii', 'ii')"
);
"(2, 'hh', 'hh'), (1, 'ii', 'ii'), (2, 'ii', 'ii')"
);
myquery
(
rc
);
myquery
(
rc
);
strmov
(
query
,
"select id1, value1 from t1 where id1= ? or value1= ?"
);
strmov
(
query
,
"select id1, value1 from t1 where id1= ? or "
"CONVERT(value1 USING utf8)= ?"
);
stmt
=
mysql_simple_prepare
(
mysql
,
query
);
stmt
=
mysql_simple_prepare
(
mysql
,
query
);
check_stmt
(
stmt
);
check_stmt
(
stmt
);
...
@@ -2060,7 +2064,8 @@ session_id char(9) NOT NULL, \
...
@@ -2060,7 +2064,8 @@ session_id char(9) NOT NULL, \
"(
\"
abx
\"
, 1, 2, 3, 2003-08-30)"
);
"(
\"
abx
\"
, 1, 2, 3, 2003-08-30)"
);
myquery
(
rc
);
myquery
(
rc
);
strmov
(
query
,
"SELECT * FROM test_select WHERE session_id= ?"
);
strmov
(
query
,
"SELECT * FROM test_select WHERE "
"CONVERT(session_id USING utf8)= ?"
);
stmt
=
mysql_simple_prepare
(
mysql
,
query
);
stmt
=
mysql_simple_prepare
(
mysql
,
query
);
check_stmt
(
stmt
);
check_stmt
(
stmt
);
...
@@ -2898,7 +2903,8 @@ static void test_simple_delete()
...
@@ -2898,7 +2903,8 @@ static void test_simple_delete()
myquery
(
rc
);
myquery
(
rc
);
/* insert by prepare */
/* insert by prepare */
strmov
(
query
,
"DELETE FROM test_simple_delete WHERE col1= ? AND col2= ? AND col3= 100"
);
strmov
(
query
,
"DELETE FROM test_simple_delete WHERE col1= ? AND "
"CONVERT(col2 USING utf8)= ? AND col3= 100"
);
stmt
=
mysql_simple_prepare
(
mysql
,
query
);
stmt
=
mysql_simple_prepare
(
mysql
,
query
);
check_stmt
(
stmt
);
check_stmt
(
stmt
);
...
@@ -4866,7 +4872,8 @@ static void test_multi_stmt()
...
@@ -4866,7 +4872,8 @@ static void test_multi_stmt()
/* alter the table schema now */
/* alter the table schema now */
stmt1
=
mysql_simple_prepare
(
mysql
,
"DELETE FROM test_multi_table "
stmt1
=
mysql_simple_prepare
(
mysql
,
"DELETE FROM test_multi_table "
"WHERE id= ? AND name=?"
);
"WHERE id= ? AND "
"CONVERT(name USING utf8)=?"
);
check_stmt
(
stmt1
);
check_stmt
(
stmt1
);
verify_param_count
(
stmt1
,
2
);
verify_param_count
(
stmt1
,
2
);
...
@@ -6632,7 +6639,7 @@ static void test_field_misc()
...
@@ -6632,7 +6639,7 @@ static void test_field_misc()
"@@table_type"
,
""
,
/* field and its org name */
"@@table_type"
,
""
,
/* field and its org name */
MYSQL_TYPE_STRING
,
/* field type */
MYSQL_TYPE_STRING
,
/* field type */
""
,
""
,
/* table and its org name */
""
,
""
,
/* table and its org name */
""
,
type_length
*
3
,
0
);
/* db name, length */
""
,
type_length
,
0
);
/* db name, length */
mysql_free_result
(
result
);
mysql_free_result
(
result
);
mysql_stmt_close
(
stmt
);
mysql_stmt_close
(
stmt
);
...
...
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