Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-UDR
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
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-UDR
Commits
9dca2984
Commit
9dca2984
authored
Feb 16, 2022
by
yangjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify mysql select error!
parent
eb4b936f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
5 deletions
+27
-5
src/impl/AuthenticationSubscriptionDocumentApiImpl.cpp
src/impl/AuthenticationSubscriptionDocumentApiImpl.cpp
+27
-5
No files found.
src/impl/AuthenticationSubscriptionDocumentApiImpl.cpp
View file @
9dca2984
...
@@ -17,6 +17,12 @@
...
@@ -17,6 +17,12 @@
#include <AuthenticationSubscription.h>
#include <AuthenticationSubscription.h>
#include "udr_config.hpp"
using
namespace
config
;
extern
udr_config
udr_cfg
;
namespace
org
{
namespace
org
{
namespace
openapitools
{
namespace
openapitools
{
namespace
server
{
namespace
server
{
...
@@ -37,6 +43,14 @@ void AuthenticationSubscriptionDocumentApiImpl::
...
@@ -37,6 +43,14 @@ void AuthenticationSubscriptionDocumentApiImpl::
const
Pistache
::
Optional
<
std
::
string
>
&
supportedFeatures
,
const
Pistache
::
Optional
<
std
::
string
>
&
supportedFeatures
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Pistache
::
Http
::
ResponseWriter
&
response
)
{
MYSQL
mysqldb
;
mysql_init
(
&
mysqldb
);
if
(
!
mysql_real_connect
(
&
mysqldb
,
udr_cfg
.
mysql
.
mysql_server
.
c_str
(),
udr_cfg
.
mysql
.
mysql_user
.
c_str
(),
udr_cfg
.
mysql
.
mysql_pass
.
c_str
(),
udr_cfg
.
mysql
.
mysql_db
.
c_str
(),
udr_cfg
.
mysql
.
mysql_port
,
0
,
0
))
{
Logger
::
udr_server
().
error
(
"An error occurred while connecting to db: %s"
,
mysql_error
(
&
mysqldb
));
return
;
}
MYSQL_RES
*
res
=
NULL
;
MYSQL_RES
*
res
=
NULL
;
MYSQL_ROW
row
;
MYSQL_ROW
row
;
...
@@ -54,14 +68,14 @@ void AuthenticationSubscriptionDocumentApiImpl::
...
@@ -54,14 +68,14 @@ void AuthenticationSubscriptionDocumentApiImpl::
.
get_to
(
sequencenumber
);
.
get_to
(
sequencenumber
);
if
(
mysql_real_query
(
if
(
mysql_real_query
(
mysql_WitcommUDRDB
,
select_Authenticationsubscription
.
c_str
(),
&
mysqldb
,
select_Authenticationsubscription
.
c_str
(),
(
unsigned
long
)
select_Authenticationsubscription
.
size
()))
{
(
unsigned
long
)
select_Authenticationsubscription
.
size
()))
{
Logger
::
udr_server
().
error
(
"mysql_real_query failure!SQL(%s)"
,
Logger
::
udr_server
().
error
(
"mysql_real_query failure!SQL(%s)"
,
select_Authenticationsubscription
.
c_str
());
select_Authenticationsubscription
.
c_str
());
return
;
return
;
}
}
res
=
mysql_store_result
(
mysql_WitcommUDRDB
);
res
=
mysql_store_result
(
&
mysqldb
);
if
(
res
==
NULL
)
{
if
(
res
==
NULL
)
{
Logger
::
udr_server
().
error
(
"mysql_store_result failure!SQL(%s)"
,
Logger
::
udr_server
().
error
(
"mysql_store_result failure!SQL(%s)"
,
select_Authenticationsubscription
.
c_str
());
select_Authenticationsubscription
.
c_str
());
...
@@ -84,7 +98,7 @@ void AuthenticationSubscriptionDocumentApiImpl::
...
@@ -84,7 +98,7 @@ void AuthenticationSubscriptionDocumentApiImpl::
// Logger::udr_server().debug("modify content:
// Logger::udr_server().debug("modify content:
// %s",query.c_str());
// %s",query.c_str());
if
(
mysql_real_query
(
mysql_WitcommUDRDB
,
query
.
c_str
(),
if
(
mysql_real_query
(
&
mysqldb
,
query
.
c_str
(),
(
unsigned
long
)
query
.
size
()))
{
(
unsigned
long
)
query
.
size
()))
{
Logger
::
udr_server
().
error
(
"update mysql failure!SQL(%s)"
,
Logger
::
udr_server
().
error
(
"update mysql failure!SQL(%s)"
,
query
.
c_str
());
query
.
c_str
());
...
@@ -114,18 +128,26 @@ void AuthenticationSubscriptionDocumentApiImpl::
...
@@ -114,18 +128,26 @@ void AuthenticationSubscriptionDocumentApiImpl::
nlohmann
::
json
j
;
nlohmann
::
json
j
;
MYSQL
mysqldb
;
mysql_init
(
&
mysqldb
);
if
(
!
mysql_real_connect
(
&
mysqldb
,
udr_cfg
.
mysql
.
mysql_server
.
c_str
(),
udr_cfg
.
mysql
.
mysql_user
.
c_str
(),
udr_cfg
.
mysql
.
mysql_pass
.
c_str
(),
udr_cfg
.
mysql
.
mysql_db
.
c_str
(),
udr_cfg
.
mysql
.
mysql_port
,
0
,
0
))
{
Logger
::
udr_server
().
error
(
"An error occurred while connecting to db: %s"
,
mysql_error
(
&
mysqldb
));
return
;
}
AuthenticationSubscription
authenticationsubscription
;
AuthenticationSubscription
authenticationsubscription
;
const
std
::
string
query
=
const
std
::
string
query
=
"select * from AuthenticationSubscription WHERE ueid='"
+
ueId
+
"'"
;
"select * from AuthenticationSubscription WHERE ueid='"
+
ueId
+
"'"
;
if
(
mysql_real_query
(
mysql_WitcommUDRDB
,
query
.
c_str
(),
if
(
mysql_real_query
(
&
mysqldb
,
query
.
c_str
(),
(
unsigned
long
)
query
.
size
()))
{
(
unsigned
long
)
query
.
size
()))
{
Logger
::
udr_server
().
error
(
"mysql_real_query failure!SQL(%s)"
,
Logger
::
udr_server
().
error
(
"mysql_real_query failure!SQL(%s)"
,
query
.
c_str
());
query
.
c_str
());
return
;
return
;
}
}
res
=
mysql_store_result
(
mysql_WitcommUDRDB
);
res
=
mysql_store_result
(
&
mysqldb
);
if
(
res
==
NULL
)
{
if
(
res
==
NULL
)
{
Logger
::
udr_server
().
error
(
"mysql_store_result failure!SQL(%s)"
,
Logger
::
udr_server
().
error
(
"mysql_store_result failure!SQL(%s)"
,
query
.
c_str
());
query
.
c_str
());
...
...
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