@@ -140,17 +140,32 @@ BOOL CDatabase_File::Database_File_FileInsert(XSTORAGECORE_DBFILE *pSt_DBManage,
140140 BaseLib_OperatorMemory_Free ((void ***)&ppSt_ListFile, nListCount);
141141 return TRUE ;
142142 }
143- BaseLib_OperatorMemory_Free ((void ***)&ppSt_ListFile, nListCount);
144-
145- TCHAR tszSQLStatement[2048 ];
146- memset (tszSQLStatement, ' \0 ' , sizeof (tszSQLStatement));
143+ TCHAR tszSQLQuery[2048 ];
144+ memset (tszSQLQuery, ' \0 ' , sizeof (tszSQLQuery));
147145
148146 if (bRewrite)
149147 {
150148 Database_File_FileDelete (pSt_DBManage->tszBuckKey , pSt_DBManage->st_ProtocolFile .tszFilePath , pSt_DBManage->st_ProtocolFile .tszFileName );
151149 }
152- Database_Help_Insert (tszSQLStatement, pSt_DBManage);
153- if (!DataBase_MySQL_Execute (xhDBSQL, tszSQLStatement))
150+ Database_Help_Insert (tszSQLQuery, pSt_DBManage);
151+
152+ int nType = 0 ;
153+ std::string m_StrSQL = tszSQLQuery;
154+ BaseLib_OperatorString_GetPath (pSt_DBManage->st_ProtocolFile .tszFilePath , &nType);
155+ if (1 == nType)
156+ {
157+ std::string m_StrSource = " \\ " ;
158+ std::string m_StrDest = " \\\\ " ;
159+
160+ size_t nStartPos = 0 ;
161+ while ((nStartPos = m_StrSQL.find (m_StrSource, nStartPos)) != std::string::npos)
162+ {
163+ m_StrSQL.replace (nStartPos, m_StrSource.length (), m_StrDest);
164+ nStartPos += m_StrDest.length ();
165+ }
166+ }
167+
168+ if (!DataBase_MySQL_Execute (xhDBSQL, m_StrSQL.c_str ()))
154169 {
155170 Database_IsErrorOccur = TRUE ;
156171 Database_dwErrorCode = DataBase_GetLastError ();
0 commit comments