{"record":{"id":"b113e2f099112e20","repo":"influxdata/influxdb","slug":"must-provide-only-one-influxql-statement-per-query-http","errorCode":null,"errorMessage":"must provide only one InfluxQl statement per query","messagePattern":"must provide only one InfluxQl statement per query","errorType":"http","errorClass":"Error","httpStatus":400,"severity":"error","filePath":"influxdb3_server/src/http.rs","lineNumber":332,"sourceCode":"    #[error(\"datafusion error: {0}\")]\n    Datafusion(#[from] DataFusionError),\n\n    #[error(\"io error: {0}\")]\n    Io(#[from] std::io::Error),\n\n    #[error(\"query error: {0}\")]\n    Query(#[from] QueryExecutorError),\n\n    #[error(transparent)]\n    DbName(#[from] ValidateDbNameError),\n\n    #[error(\"partial write of line protocol occurred\")]\n    PartialLpWrite(BufferedWriteRequest),\n\n    #[error(\"error in InfluxQL statement: {0}\")]\n    InfluxqlRewrite(#[from] rewrite::Error),\n\n    #[error(\"must provide only one InfluxQl statement per query\")]\n    InfluxqlSingleStatement,\n\n    #[error(\"must specify a 'db' parameter, or provide the database in the InfluxQL query\")]\n    InfluxqlNoDatabase,\n\n    #[error(\n        \"provided a database in both the parameters ({param_db}) and \\\n        query string ({query_db}) that do not match, if providing a query \\\n        that specifies the database, you can omit the 'database' parameter \\\n        from your request\"\n    )]\n    InfluxqlDatabaseMismatch { param_db: String, query_db: String },\n\n    #[error(\"Operation with object store failed: {0}\")]\n    ObjectStore(#[from] object_store::Error),\n\n    #[error(\"heap dump failed: {0}\")]\n    HeapPprof(#[from] jemalloc_pprof_http::Error),","sourceCodeStart":314,"sourceCodeEnd":350,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_server/src/http.rs#L314-L350","documentation":"Raised when an InfluxQL request contains more than one statement. The v1-compatibility query endpoint accepts exactly one InfluxQL statement per request; batched statements separated by semicolons are rejected with this fixed message.","triggerScenarios":"POSTing or GETting `q=SELECT ...; SELECT ...` (or any semicolon-separated pair of statements) to the /query InfluxQL endpoint.","commonSituations":"Scripts copied from InfluxDB 1.x tooling that batched multiple statements; migration scripts sending several queries in one HTTP call for efficiency.","solutions":["Split the statements into separate HTTP requests, one query per call.","Strip any trailing/intermediate semicolons from the q parameter.","Update migration scripts to issue sequential single-statement requests."],"exampleFix":"// before\ncurl 'http://localhost:8181/query?db=mydb' --data-urlencode 'q=SELECT * FROM a; SELECT * FROM b'\n// after\ncurl 'http://localhost:8181/query?db=mydb' --data-urlencode 'q=SELECT * FROM a'\ncurl 'http://localhost:8181/query?db=mydb' --data-urlencode 'q=SELECT * FROM b'","handlingStrategy":"validation","validationCode":"const stmts = q.split(';').map(s => s.trim()).filter(Boolean);\nif (stmts.length > 1) throw new Error('send each statement in its own request');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Strip semicolons before sending q","Loop over statements client-side, one request each","Reject multi-statement input in your tooling before it hits the server"],"tags":["influxql","query","http-api"],"backgroundTag":"invalid-query-parameter","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}