synchronized Statement compile ( Session session , Result cmd ) throws Throwable { String sql = cmd . getMainString ( ) ; long csid = getStatementID ( session . currentSchema , sql ) ; Statement cs = ( Statement ) csidMap . get ( csid ) ; if ( cs == null || ! cs . isValid ( ) || ! session . isAdmin ( ) ) { Session sys = database . sessionManager . getSysSession ( session . currentSchema . name , session . getUser ( ) ) ; cs = sys . compileStatement ( sql ) ; csid = registerStatement ( csid , cs ) ; } linkSession ( csid , session . getId ( ) ) ; return cs ; }
Compiles an SQL statement and returns a CompiledStatement Object