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
21fffd89
Commit
21fffd89
authored
Oct 31, 2007
by
kostja@bodhi.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into bodhi.(none):/opt/local/work/mysql-5.1-runtime-inc
parents
7ec50bd4
c26aef8f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
55 deletions
+70
-55
sql-common/client.c
sql-common/client.c
+70
-55
No files found.
sql-common/client.c
View file @
21fffd89
...
...
@@ -272,6 +272,76 @@ static int wait_for_data(my_socket fd, uint timeout)
}
#endif
/* defined(__WIN__) || defined(__NETWARE__) */
/**
Set the internal error message to mysql handler
@param mysql connection handle (client side)
@param errcode CR_ error code, passed to ER macro to get
error text
@parma sqlstate SQL standard sqlstate
*/
void
set_mysql_error
(
MYSQL
*
mysql
,
int
errcode
,
const
char
*
sqlstate
)
{
NET
*
net
;
DBUG_ENTER
(
"set_mysql_error"
);
DBUG_PRINT
(
"enter"
,
(
"error :%d '%s'"
,
errcode
,
ER
(
errcode
)));
DBUG_ASSERT
(
mysql
!=
0
);
net
=
&
mysql
->
net
;
net
->
last_errno
=
errcode
;
strmov
(
net
->
last_error
,
ER
(
errcode
));
strmov
(
net
->
sqlstate
,
sqlstate
);
DBUG_VOID_RETURN
;
}
/**
Clear possible error state of struct NET
@param net clear the state of the argument
*/
void
net_clear_error
(
NET
*
net
)
{
net
->
last_errno
=
0
;
net
->
last_error
[
0
]
=
'\0'
;
strmov
(
net
->
sqlstate
,
not_error_sqlstate
);
}
/**
Set an error message on the client.
@param mysql connection handle
@param errcode CR_* errcode, for client errors
@param sqlstate SQL standard sql state, unknown_sqlstate for the
majority of client errors.
@param format error message template, in sprintf format
@param ... variable number of arguments
*/
static
void
set_mysql_extended_error
(
MYSQL
*
mysql
,
int
errcode
,
const
char
*
sqlstate
,
const
char
*
format
,
...)
{
NET
*
net
;
va_list
args
;
DBUG_ENTER
(
"set_mysql_extended_error"
);
DBUG_PRINT
(
"enter"
,
(
"error :%d '%s'"
,
errcode
,
format
));
DBUG_ASSERT
(
mysql
!=
0
);
net
=
&
mysql
->
net
;
net
->
last_errno
=
errcode
;
va_start
(
args
,
format
);
my_vsnprintf
(
net
->
last_error
,
sizeof
(
net
->
last_error
)
-
1
,
format
,
args
);
va_end
(
args
);
strmov
(
net
->
sqlstate
,
sqlstate
);
DBUG_VOID_RETURN
;
}
/*
Create a named pipe connection
...
...
@@ -727,61 +797,6 @@ void free_old_query(MYSQL *mysql)
DBUG_VOID_RETURN
;
}
/*
Set the internal error message to mysql handler
*/
void
set_mysql_error
(
MYSQL
*
mysql
,
int
errcode
,
const
char
*
sqlstate
)
{
NET
*
net
;
DBUG_ENTER
(
"set_mysql_error"
);
DBUG_PRINT
(
"enter"
,
(
"error :%d '%s'"
,
errcode
,
ER
(
errcode
)));
DBUG_ASSERT
(
mysql
!=
0
);
net
=
&
mysql
->
net
;
net
->
last_errno
=
errcode
;
strmov
(
net
->
last_error
,
ER
(
errcode
));
strmov
(
net
->
sqlstate
,
sqlstate
);
DBUG_VOID_RETURN
;
}
/**
Clear possible error state of struct NET
@param net clear the state of the argument
*/
void
net_clear_error
(
NET
*
net
)
{
net
->
last_errno
=
0
;
net
->
last_error
[
0
]
=
'\0'
;
strmov
(
net
->
sqlstate
,
not_error_sqlstate
);
}
static
void
set_mysql_extended_error
(
MYSQL
*
mysql
,
int
errcode
,
const
char
*
sqlstate
,
const
char
*
format
,
...)
{
NET
*
net
;
va_list
args
;
DBUG_ENTER
(
"set_mysql_extended_error"
);
DBUG_PRINT
(
"enter"
,
(
"error :%d '%s'"
,
errcode
,
format
));
DBUG_ASSERT
(
mysql
!=
0
);
net
=
&
mysql
->
net
;
net
->
last_errno
=
errcode
;
va_start
(
args
,
format
);
my_vsnprintf
(
net
->
last_error
,
sizeof
(
net
->
last_error
)
-
1
,
format
,
args
);
va_end
(
args
);
strmov
(
net
->
sqlstate
,
sqlstate
);
DBUG_VOID_RETURN
;
}
/*
Flush result set sent from server
*/
...
...
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