You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cds.run does not return results for an array with "raw" sql. Sometimes we are executing multiple raw sql statements in parallel. Consider the below query:
constresult=awaitcds.run([`SELECT CURRENT_SCHEMA FROM DUMMY`,`SELECT CURRENT_SCHEMA FROM DUMMY`,]);console.log(result);
As far as i can see this comes from the dispatch method in @cap-js/hana/lib/HANAService.js that wraps the query with a DO BEGIN ... END So it might me related to hana only
asyncdispatch(req){// Look for deployment batch dispatch and execute as single query// When deployment is not executed in a batch it will fail to create viewsif(Array.isArray(req.query)&&!req.query.find(q=>typeofq!=='string')){req.query=`DO BEGIN ${req.query.map(q=>`EXEC '${q.replace(/'/g,"''").replace(';','')}${// Add "PAGE LOADABLE" for all tables created to use NSE by default and reduce memory consumption/(^|')CREATE TABLE/.test(q) ? ' PAGE LOADABLE' : ''}';`,).join('\n')} END;`}returnsuper.dispatch(req)}
Detailed steps to reproduce
run the code snippet below in any cap project that is connected to a hdi container
Description of erroneous behaviour
cds.run
does not return results for an array with "raw" sql. Sometimes we are executing multiple raw sql statements in parallel. Consider the below query:Output with the new db adapter:
Output with the old db adapter
As far as i can see this comes from the
dispatch
method in@cap-js/hana/lib/HANAService.js
that wraps the query with aDO BEGIN ... END
So it might me related to hana onlyDetailed steps to reproduce
Details about your project
| ---------------------- | --------------------------------------------- |
| @cap-js/asyncapi | 1.0.2 |
| @cap-js/cds-types | 0.6.5 |
| @cap-js/db-service | 1.16.2 |
| @cap-js/hana | 1.5.2 |
| @cap-js/openapi | 1.0.6 |
| @cap-js/sqlite | 1.7.7 |
| @sap/cds | 8.6.0 |
| @sap/cds-compiler | 5.5.2 |
| @sap/cds-dk (global) | 8.3.0 |
| @sap/cds-fiori | 1.2.8 |
| @sap/cds-foss | 5.0.1 |
| @sap/cds-mtxs | 2.2.0 |
| @sap/eslint-plugin-cds | 3.1.0 |
| Node.js | v20.17.0 |
The text was updated successfully, but these errors were encountered: