@@ -1778,6 +1778,71 @@ short CmpSeabaseDDL::upgradeSeabaseLibmgr(ExeCliInterface * cliInterface)
17781778 return -1 ;
17791779 }
17801780
1781+ // Update the jar locations for system procedures and functions. This should
1782+ // be done before adding any new jar's since we use a system procedure to add
1783+ // procedures.
1784+ NAString jarLocation (getenv (" TRAF_HOME" ));
1785+ jarLocation += " /export/lib" ;
1786+
1787+ char queryBuf[1000 ];
1788+
1789+ // trafodion-sql_currversion.jar
1790+ Int32 stmtSize = snprintf (queryBuf, sizeof (queryBuf), " update %s.\" %s\" .%s "
1791+ " set library_filename = '%s/trafodion-sql-currversion.jar' "
1792+ " where library_uid = "
1793+ " (select object_uid from %s.\" %s\" .%s "
1794+ " where object_name = '%s' and object_type = 'LB')" ,
1795+ getSystemCatalog (),SEABASE_MD_SCHEMA, SEABASE_LIBRARIES, jarLocation.data (),
1796+ getSystemCatalog (),SEABASE_MD_SCHEMA, SEABASE_OBJECTS, SEABASE_VALIDATE_LIBRARY);
1797+ CMPASSERT (stmtSize < sizeof (queryBuf));
1798+
1799+ cliRC = cliInterface->executeImmediate (queryBuf);
1800+ if (cliRC < 0 )
1801+ {
1802+ cliInterface->retrieveSQLDiagnostics (CmpCommon::diags ());
1803+ return -1 ;
1804+ }
1805+
1806+ // lib_mgmt.jar
1807+ stmtSize = snprintf (queryBuf, sizeof (queryBuf), " update %s.\" %s\" .%s "
1808+ " set library_filename = '%s/lib_mgmt.jar' "
1809+ " where library_uid = "
1810+ " (select object_uid from %s.\" %s\" .%s "
1811+ " where object_name = '%s' and object_type = 'LB')" ,
1812+ getSystemCatalog (),SEABASE_MD_SCHEMA, SEABASE_LIBRARIES, jarLocation.data (),
1813+ getSystemCatalog (),SEABASE_MD_SCHEMA, SEABASE_OBJECTS, SEABASE_LIBMGR_LIBRARY);
1814+ CMPASSERT (stmtSize < sizeof (queryBuf));
1815+
1816+ cliRC = cliInterface->executeImmediate (queryBuf);
1817+ if (cliRC < 0 )
1818+ {
1819+ cliInterface->retrieveSQLDiagnostics (CmpCommon::diags ());
1820+ return -1 ;
1821+ }
1822+
1823+ // libudr_predef.so
1824+ NAString dllLocation (getenv (" TRAF_HOME" ));
1825+ dllLocation += " /export/lib64" ;
1826+ if (strcmp (getenv (" SQ_MBTYPE" ), " 64d" ) == 0 )
1827+ dllLocation += " d" ;
1828+
1829+ stmtSize = snprintf (queryBuf, sizeof (queryBuf), " update %s.\" %s\" .%s "
1830+ " set library_filename = '%s/libudr_predef.so' "
1831+ " where library_uid = "
1832+ " (select object_uid from %s.\" %s\" .%s "
1833+ " where object_name = '%s' and object_type = 'LB')" ,
1834+ getSystemCatalog (),SEABASE_MD_SCHEMA, SEABASE_LIBRARIES, dllLocation.data (),
1835+ getSystemCatalog (),SEABASE_MD_SCHEMA, SEABASE_OBJECTS, SEABASE_LIBMGR_LIBRARY_CPP);
1836+ CMPASSERT (stmtSize < sizeof (queryBuf));
1837+
1838+ cliRC = cliInterface->executeImmediate (queryBuf);
1839+ if (cliRC < 0 )
1840+ {
1841+ cliInterface->retrieveSQLDiagnostics (CmpCommon::diags ());
1842+ return -1 ;
1843+ }
1844+
1845+
17811846 // now check for the C++ library, which was added in Trafodion 2.3
17821847 cliRC = existsInSeabaseMDTable (cliInterface,
17831848 getSystemCatalog (), SEABASE_LIBMGR_SCHEMA,
0 commit comments