1 //
2 // Utility.cpp
3 //
4 // Library: Data/MySQL
5 // Package: MySQL
6 // Module:  Utility
7 //
8 // Implementation of Utility
9 //
10 // Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
11 // and Contributors.
12 //
13 // SPDX-License-Identifier:	BSL-1.0
14 //
15 
16 
17 #include "Poco/Data/MySQL/Utility.h"
18 #include <mysql.h>
19 
20 
21 namespace Poco {
22 namespace Data {
23 namespace MySQL {
24 
25 
serverInfo(MYSQL * pHandle)26 std::string Utility::serverInfo(MYSQL* pHandle)
27 {
28 	std::string info(mysql_get_server_info(pHandle));
29 	return info;
30 }
31 
32 
serverInfo(Session & session)33 std::string Utility::serverInfo(Session& session)
34 {
35 	std::string info(mysql_get_server_info(handle(session)));
36 	return info;
37 }
38 
39 
serverVersion(MYSQL * pHandle)40 unsigned long Utility::serverVersion(MYSQL* pHandle)
41 {
42 	return mysql_get_server_version(pHandle);
43 }
44 
45 
serverVersion(Session & session)46 unsigned long Utility::serverVersion(Session& session)
47 {
48 	return mysql_get_server_version(handle(session));
49 }
50 
51 
hostInfo(MYSQL * pHandle)52 std::string Utility::hostInfo(MYSQL* pHandle)
53 {
54 	std::string info(mysql_get_host_info(pHandle));
55 	return info;
56 }
57 
58 
hostInfo(Session & session)59 std::string Utility::hostInfo(Session& session)
60 {
61 	std::string info(mysql_get_host_info(handle(session)));
62 	return info;
63 }
64 
65 
66 } } } // namespace Poco::Data::MySQL
67