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
27880261
Commit
27880261
authored
Mar 01, 2006
by
msvensson@shellback.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge shellback.(none):/home/msvensson/mysql/mysql-5.0
into shellback.(none):/home/msvensson/mysql/mysql-5.1
parents
513bf354
c26674d7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
90 additions
and
11 deletions
+90
-11
mysql-test/t/mysql_protocols.test
mysql-test/t/mysql_protocols.test
+2
-0
sql/item_sum.h
sql/item_sum.h
+7
-0
sql/net_serv.cc
sql/net_serv.cc
+21
-5
sql/sql_db.cc
sql/sql_db.cc
+12
-6
strings/decimal.c
strings/decimal.c
+13
-0
tests/mysql_client_test.c
tests/mysql_client_test.c
+35
-0
No files found.
mysql-test/t/mysql_protocols.test
View file @
27880261
# Embedded server doesn't support external clients
--
source
include
/
not_embedded
.
inc
# Windows does not have SOCKET, but will try to create a PIPE as well as MEMORY
--
source
include
/
not_windows
.
inc
# test for Bug #4998 "--protocol doesn't reject bad values"
...
...
sql/item_sum.h
View file @
27880261
...
...
@@ -1116,6 +1116,13 @@ class Item_func_group_concat : public Item_sum
enum
Sumfunctype
sum_func
()
const
{
return
GROUP_CONCAT_FUNC
;}
const
char
*
func_name
()
const
{
return
"group_concat"
;
}
virtual
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
enum_field_types
field_type
()
const
{
if
(
max_length
/
collation
.
collation
->
mbmaxlen
>
CONVERT_IF_BIGGER_TO_BLOB
)
return
FIELD_TYPE_BLOB
;
else
return
MYSQL_TYPE_VARCHAR
;
}
void
clear
();
bool
add
();
void
reset_field
()
{
DBUG_ASSERT
(
0
);
}
// not used
...
...
sql/net_serv.cc
View file @
27880261
...
...
@@ -229,8 +229,12 @@ static int net_data_is_ready(my_socket sd)
struct
timeval
tv
;
int
res
;
#ifndef __WIN__
/* Windows uses an _array_ of 64 fd's as default, so it's safe */
if
(
sd
>=
FD_SETSIZE
)
return
-
1
;
#define NET_DATA_IS_READY_CAN_RETURN_MINUS_ONE
#endif
FD_ZERO
(
&
sfds
);
FD_SET
(
sd
,
&
sfds
);
...
...
@@ -271,7 +275,7 @@ void net_clear(NET *net)
int
count
,
ready
;
DBUG_ENTER
(
"net_clear"
);
#if !defined(EMBEDDED_LIBRARY)
while
((
ready
=
net_data_is_ready
(
net
->
vio
->
sd
))
!=
0
)
while
((
ready
=
net_data_is_ready
(
net
->
vio
->
sd
))
>
0
)
{
/* The socket is ready */
if
((
count
=
vio_read
(
net
->
vio
,
(
char
*
)
(
net
->
buff
),
...
...
@@ -286,15 +290,27 @@ void net_clear(NET *net)
}
else
{
/* No data to read and 'net_data_is_ready' returned "don't know" */
if
(
ready
==
-
1
)
break
;
DBUG_PRINT
(
"info"
,(
"socket ready but only EOF to read - disconnected"
));
net
->
error
=
2
;
break
;
}
}
#ifdef NET_DATA_IS_READY_CAN_RETURN_MINUS_ONE
/* 'net_data_is_ready' returned "don't know" */
if
(
ready
==
-
1
)
{
/* Read unblocking to clear net */
my_bool
old_mode
;
if
(
!
vio_blocking
(
net
->
vio
,
FALSE
,
&
old_mode
))
{
while
((
count
=
vio_read
(
net
->
vio
,
(
char
*
)
(
net
->
buff
),
(
uint32
)
net
->
max_packet
))
>
0
)
DBUG_PRINT
(
"info"
,(
"skipped %d bytes from file: %s"
,
count
,
vio_description
(
net
->
vio
)));
vio_blocking
(
net
->
vio
,
TRUE
,
&
old_mode
);
}
}
#endif
#endif
net
->
pkt_nr
=
net
->
compress_pkt_nr
=
0
;
/* Ready for new command */
net
->
write_pos
=
net
->
buff
;
...
...
sql/sql_db.cc
View file @
27880261
...
...
@@ -1226,7 +1226,8 @@ static long mysql_rm_arc_files(THD *thd, MY_DIR *dirp,
bool
mysql_change_db
(
THD
*
thd
,
const
char
*
name
,
bool
no_access_check
)
{
int
length
,
db_length
;
char
*
dbname
=
my_strdup
((
char
*
)
name
,
MYF
(
MY_WME
));
char
*
dbname
=
thd
->
slave_thread
?
(
char
*
)
name
:
my_strdup
((
char
*
)
name
,
MYF
(
MY_WME
));
char
path
[
FN_REFLEN
];
HA_CREATE_INFO
create
;
bool
system_db
=
0
;
...
...
@@ -1249,7 +1250,8 @@ bool mysql_change_db(THD *thd, const char *name, bool no_access_check)
system_db
=
1
;
goto
end
;
}
x_free
(
dbname
);
/* purecov: inspected */
if
(
!
(
thd
->
slave_thread
))
x_free
(
dbname
);
/* purecov: inspected */
my_message
(
ER_NO_DB_ERROR
,
ER
(
ER_NO_DB_ERROR
),
MYF
(
0
));
/* purecov: inspected */
DBUG_RETURN
(
1
);
/* purecov: inspected */
...
...
@@ -1257,7 +1259,8 @@ bool mysql_change_db(THD *thd, const char *name, bool no_access_check)
if
(
check_db_name
(
dbname
))
{
my_error
(
ER_WRONG_DB_NAME
,
MYF
(
0
),
dbname
);
my_free
(
dbname
,
MYF
(
0
));
if
(
!
(
thd
->
slave_thread
))
my_free
(
dbname
,
MYF
(
0
));
DBUG_RETURN
(
1
);
}
DBUG_PRINT
(
"info"
,(
"Use database: %s"
,
dbname
));
...
...
@@ -1287,7 +1290,8 @@ bool mysql_change_db(THD *thd, const char *name, bool no_access_check)
dbname
);
general_log_print
(
thd
,
COM_INIT_DB
,
ER
(
ER_DBACCESS_DENIED_ERROR
),
sctx
->
priv_user
,
sctx
->
priv_host
,
dbname
);
my_free
(
dbname
,
MYF
(
0
));
if
(
!
(
thd
->
slave_thread
))
my_free
(
dbname
,
MYF
(
0
));
DBUG_RETURN
(
1
);
}
}
...
...
@@ -1298,7 +1302,8 @@ bool mysql_change_db(THD *thd, const char *name, bool no_access_check)
if
(
my_access
(
path
,
F_OK
))
{
my_error
(
ER_BAD_DB_ERROR
,
MYF
(
0
),
dbname
);
my_free
(
dbname
,
MYF
(
0
));
if
(
!
(
thd
->
slave_thread
))
my_free
(
dbname
,
MYF
(
0
));
DBUG_RETURN
(
1
);
}
end:
...
...
@@ -1306,7 +1311,8 @@ bool mysql_change_db(THD *thd, const char *name, bool no_access_check)
x_free
(
thd
->
db
);
if
(
dbname
&&
dbname
[
0
]
==
0
)
{
my_free
(
dbname
,
MYF
(
0
));
if
(
!
(
thd
->
slave_thread
))
my_free
(
dbname
,
MYF
(
0
));
thd
->
db
=
NULL
;
thd
->
db_length
=
0
;
}
...
...
strings/decimal.c
View file @
27880261
...
...
@@ -1353,6 +1353,8 @@ int bin2decimal(char *from, decimal_t *to, int precision, int scale)
}
from
+=
i
;
*
buf
=
x
^
mask
;
if
(((
uint32
)
*
buf
)
>=
powers10
[
intg0x
+
1
])
goto
err
;
if
(
buf
>
to
->
buf
||
*
buf
!=
0
)
buf
++
;
else
...
...
@@ -1362,6 +1364,8 @@ int bin2decimal(char *from, decimal_t *to, int precision, int scale)
{
DBUG_ASSERT
(
sizeof
(
dec1
)
==
4
);
*
buf
=
mi_sint4korr
(
from
)
^
mask
;
if
(((
uint32
)
*
buf
)
>
DIG_MAX
)
goto
err
;
if
(
buf
>
to
->
buf
||
*
buf
!=
0
)
buf
++
;
else
...
...
@@ -1372,6 +1376,8 @@ int bin2decimal(char *from, decimal_t *to, int precision, int scale)
{
DBUG_ASSERT
(
sizeof
(
dec1
)
==
4
);
*
buf
=
mi_sint4korr
(
from
)
^
mask
;
if
(((
uint32
)
*
buf
)
>
DIG_MAX
)
goto
err
;
buf
++
;
}
if
(
frac0x
)
...
...
@@ -1387,10 +1393,17 @@ int bin2decimal(char *from, decimal_t *to, int precision, int scale)
default:
DBUG_ASSERT
(
0
);
}
*
buf
=
(
x
^
mask
)
*
powers10
[
DIG_PER_DEC1
-
frac0x
];
if
(((
uint32
)
*
buf
)
>
DIG_MAX
)
goto
err
;
buf
++
;
}
my_afree
(
d_copy
);
return
error
;
err:
my_afree
(
d_copy
);
decimal_make_zero
(((
decimal_t
*
)
to
));
return
(
E_DEC_BAD_NUM
);
}
/*
...
...
tests/mysql_client_test.c
View file @
27880261
...
...
@@ -14840,6 +14840,40 @@ static void test_bug15613()
mysql_stmt_close
(
stmt
);
}
/*
Bug#14169: type of group_concat() result changed to blob if tmp_table was used
*/
static
void
test_bug14169
()
{
MYSQL_STMT
*
stmt
;
const
char
*
stmt_text
;
MYSQL_RES
*
res
;
MYSQL_FIELD
*
field
;
int
rc
;
myheader
(
"test_bug14169"
);
rc
=
mysql_query
(
mysql
,
"drop table if exists t1"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"set session group_concat_max_len=1024"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"create table t1 (f1 int unsigned, f2 varchar(255))"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"insert into t1 values (1,repeat('a',255)),"
"(2,repeat('b',255))"
);
myquery
(
rc
);
stmt
=
mysql_stmt_init
(
mysql
);
stmt_text
=
"select f2,group_concat(f1) from t1 group by f2"
;
rc
=
mysql_stmt_prepare
(
stmt
,
stmt_text
,
strlen
(
stmt_text
));
myquery
(
rc
);
res
=
mysql_stmt_result_metadata
(
stmt
);
field
=
mysql_fetch_fields
(
res
);
if
(
!
opt_silent
)
printf
(
"GROUP_CONCAT() result type %i"
,
field
[
1
].
type
);
DIE_UNLESS
(
field
[
1
].
type
==
MYSQL_TYPE_BLOB
);
rc
=
mysql_query
(
mysql
,
"drop table t1"
);
myquery
(
rc
);
}
/*
Read and parse arguments and MySQL options from my.cnf
*/
...
...
@@ -15104,6 +15138,7 @@ static struct my_tests_st my_tests[]= {
{
"test_bug16143"
,
test_bug16143
},
{
"test_bug16144"
,
test_bug16144
},
{
"test_bug15613"
,
test_bug15613
},
{
"test_bug14169"
,
test_bug14169
},
{
0
,
0
}
};
...
...
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