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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
7c31ea4d
Commit
7c31ea4d
authored
Dec 14, 2004
by
ram@gw.mysql.r18.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into gw.mysql.r18.ru:/usr/home/ram/work/4.1
parents
5c5d51c2
4fa86749
Changes
4
Hide 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 @
7c31ea4d
...
...
@@ -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;
select * from t1;
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 b b 254
9
0 Y 2176 0 8
def test t1 t1 c c 254
3
0 Y 384 0 8
def test t1 t1 a a 254
1
1 Y 384 0 8
def test t1 t1 b b 254
3
0 Y 2176 0 8
def test t1 t1 c c 254
1
0 Y 384 0 8
a b c
Y NULL NULL
drop table t1;
...
...
sql/item.h
View file @
7c31ea4d
...
...
@@ -765,7 +765,7 @@ class Item_empty_string :public Item_string
public:
Item_empty_string
(
const
char
*
header
,
uint
length
,
CHARSET_INFO
*
cs
=
NULL
)
:
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
);
};
...
...
sql/protocol.cc
View file @
7c31ea4d
...
...
@@ -549,10 +549,18 @@ bool Protocol::send_fields(List<Item> *list, uint flag)
pos
=
(
char
*
)
local_packet
->
ptr
()
+
local_packet
->
length
();
*
pos
++=
12
;
// Length of packed fields
if
(
item
->
collation
.
collation
==
&
my_charset_bin
||
thd_charset
==
NULL
)
{
/* No conversion */
int2store
(
pos
,
field
.
charsetnr
);
int4store
(
pos
+
2
,
field
.
length
);
}
else
int2store
(
pos
,
thd_charset
->
number
);
int4store
(
pos
+
2
,
field
.
length
);
{
/* With conversion */
int2store
(
pos
,
thd_charset
->
number
);
uint
char_len
=
field
.
length
/
item
->
collation
.
collation
->
mbmaxlen
;
int4store
(
pos
+
2
,
char_len
*
thd_charset
->
mbmaxlen
);
}
pos
[
6
]
=
field
.
type
;
int2store
(
pos
+
7
,
field
.
flags
);
pos
[
9
]
=
(
char
)
field
.
decimals
;
...
...
tests/client_test.c
View file @
7c31ea4d
...
...
@@ -1101,7 +1101,8 @@ static void test_prepare_simple()
mysql_stmt_close
(
stmt
);
/* 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
);
check_stmt
(
stmt
);
...
...
@@ -1129,7 +1130,8 @@ static void test_prepare_simple()
mysql_stmt_close
(
stmt
);
/* 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
);
check_stmt
(
stmt
);
...
...
@@ -1158,7 +1160,7 @@ static void test_prepare_field_result()
rc
=
mysql_query
(
mysql
,
"CREATE TABLE test_prepare_field_result(int_c int, "
"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
);
/* insert */
...
...
@@ -1184,8 +1186,8 @@ static void test_prepare_field_result()
"t1"
,
"test_prepare_field_result"
,
current_db
,
10
,
0
);
verify_prepare_field
(
result
,
3
,
"ts_c"
,
"ts_c"
,
MYSQL_TYPE_TIMESTAMP
,
"t1"
,
"test_prepare_field_result"
,
current_db
,
19
,
0
);
verify_prepare_field
(
result
,
4
,
"char_c"
,
"char_c"
,
MYSQL_TYPE_STRING
,
"t1"
,
"test_prepare_field_result"
,
current_db
,
3
,
0
);
verify_prepare_field
(
result
,
4
,
"char_c"
,
"char_c"
,
MYSQL_TYPE_
VAR_
STRING
,
"t1"
,
"test_prepare_field_result"
,
current_db
,
4
,
0
);
verify_field_count
(
result
,
5
);
mysql_free_result
(
result
);
...
...
@@ -1921,7 +1923,8 @@ static void test_select()
rc
=
mysql_commit
(
mysql
);
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
);
check_stmt
(
stmt
);
...
...
@@ -1981,7 +1984,8 @@ static void test_ps_conj_select()
"(2, 'hh', 'hh'), (1, 'ii', 'ii'), (2, 'ii', 'ii')"
);
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
);
check_stmt
(
stmt
);
...
...
@@ -2060,7 +2064,8 @@ session_id char(9) NOT NULL, \
"(
\"
abx
\"
, 1, 2, 3, 2003-08-30)"
);
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
);
check_stmt
(
stmt
);
...
...
@@ -2898,7 +2903,8 @@ static void test_simple_delete()
myquery
(
rc
);
/* 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
);
check_stmt
(
stmt
);
...
...
@@ -4866,7 +4872,8 @@ static void test_multi_stmt()
/* alter the table schema now */
stmt1
=
mysql_simple_prepare
(
mysql
,
"DELETE FROM test_multi_table "
"WHERE id= ? AND name=?"
);
"WHERE id= ? AND "
"CONVERT(name USING utf8)=?"
);
check_stmt
(
stmt1
);
verify_param_count
(
stmt1
,
2
);
...
...
@@ -6632,7 +6639,7 @@ static void test_field_misc()
"@@table_type"
,
""
,
/* field and its org name */
MYSQL_TYPE_STRING
,
/* field type */
""
,
""
,
/* table and its org name */
""
,
type_length
*
3
,
0
);
/* db name, length */
""
,
type_length
,
0
);
/* db name, length */
mysql_free_result
(
result
);
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