Skip to content

bad query create panic esp32 #234

Open

Description

@Red-Owl

Connected to server version 8.0.38 (compatible login)
Error: 60 = Out of range value for column 'mc_cpm_min' at row 2. (insert decimal into int field)
Disconnected.
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.

the problem is not my bad query is a panic

this exception or truncate data or not insert a data

Activity

  1. ChuckBell commented on Aug 13, 2024

    @ChuckBell
    Owner
  2. Red-Owl commented on Aug 14, 2024

    @Red-Owl
    Author
    String mysql_insert_query(void){
      String subq = "( SELECT SUBSTRING_INDEX(host,':',1) as 'ip' from performance_schema.processlist WHERE ID=connection_id() )";
      long ep = esprtc.getEpoch();
      String query = "INSERT INTO esp32.geiger SET ";
      query += "mc_ippy=" + subq + ",";
      query += "mc_epoq='" + String(ep, 10) + "',";
      query += "mc_date=now(), ";
      query += "mc_session='" + String(ENABLE_STRING) + "',";
      query += "mc_cpm_min='" + String(CPM_PREV[2]) + "',";
      query += "mc_usv_min='" + String(GEIGER_PREV2) + "',";
      query += "mc_model='" + String(FIRMWARE_MODEL) + "',";
      query += "mc_serial='" + String(FIRMWARE_SERIAL) + "',";
      query += "mc_version='" + String(FIRMWARE_VERSION) + "'; ";
      return query;
    }
    

    CREATE TABLE geiger (
    MC BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
    mc_ippy CHAR(16) NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci',
    mc_date DATETIME(6) NULL DEFAULT NULL,
    mc_session VARCHAR(45) NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci',
    mc_cpm_min MEDIUMINT UNSIGNED NULL DEFAULT NULL,
    mc_usv_min DECIMAL(20,6) UNSIGNED NULL DEFAULT NULL,
    mc_model VARCHAR(45) NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci',
    mc_serial VARCHAR(45) NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci',
    mc_version VARCHAR(45) NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci',
    mc_epoq BIGINT NULL DEFAULT NULL,
    PRIMARY KEY (MC) USING BTREE
    )
    COLLATE='utf8mb4_unicode_ci'
    ENGINE=InnoDB
    AUTO_INCREMENT=2954
    ;

  3. ChuckBell commented on Sep 6, 2024

    @ChuckBell
    Owner
  4. Red-Owl commented on Sep 8, 2024

    @Red-Owl
    Author

    .... Panic bad query create a guru meditation. Bad query return error id or message. Not crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions