node_modules/mariadb/lib/cmd/batch-rewrite.js
/**
   * Validate that parameters exists and are defined.
   *
   * @param info        connection info
   * @returns {boolean} return false if any error occur.
   */
Validate that parameters exists and are defined.
@param info        connection info
@returns {boolean} return false if any error occur.
Validate that parameters exists and are defined . @param info connection info @returns { boolean } return false if any error occur .
validateParameters(info) {
    for (let r = 0; r < this.values.length; r++) {
      let val = this.values[r];
      if (!Array.isArray(val)) {
        val = [val];
        this.values[r] = val;
      }
      if (this.parseResults.partList.length - 3 > val.length) {
        this.emit('send_end');
        this.throwNewError(
          'Parameter at position ' +
            val.length +
            ' is not set for values ' +
            r +
            '\n' +
            this.displaySql(),
          false,
          info,
          'HY000',
          Errors.ER_MISSING_PARAMETER
        );
        return false;
      }
      for (let i = 0; i < this.parseResults.partList.length - 3; i++) {
        if (val[i] === undefined) {
          this.emit('send_end');
          this.throwNewError(
            'Parameter at position ' +
              (i + 1) +
              ' is undefined for values ' +
              r +
              '\n' +
              this.displaySql(),
            false,
            info,
            'HY000',
            Errors.ER_PARAMETER_UNDEFINED
          );
          return false;
        }
      }
    }
    return true;
  }
validateParameters ( info ) { for ( let r = 0 ; r < this . values . length ; r ++ ) { let val = this . values [ r ] ; if ( ! Array . isArray ( val ) ) { val = [ val ] ; this . values [ r ] = val ; } if ( this . parseResults . partList . length - 3 > val . length ) { this . emit ( 'send_end' ) ; this . throwNewError ( 'Parameter at position ' + val . length + ' is not set for values ' + r + '\n' + this . displaySql ( ) , false , info , 'HY000' , Errors . ER_MISSING_PARAMETER ) ; return false ; } for ( let i = 0 ; i < this . parseResults . partList . length - 3 ; i ++ ) { if ( val [ i ] === undefined ) { this . emit ( 'send_end' ) ; this . throwNewError ( 'Parameter at position ' + ( i + 1 ) + ' is undefined for values ' + r + '\n' + this . displaySql ( ) , false , info , 'HY000' , Errors . ER_PARAMETER_UNDEFINED ) ; return false ; } } } return true ; }
Validate that parameters exists and are defined.
Validate that parameters exists and are defined .
//validate parameter size. //validate parameter is defined.