title: MYSQL - ERROR 1048 (23000): Column cannot be null
body: <p>I have a table that i i created an SP to insert data into it. </p>
  
  <p>When i run the SP i get the error in the subject, if i run a manual insert with the same data this works as expected. </p>
  
  <p>Manual insert works </p>
  
  <pre><code>INSERT INTO Leagues (LeagueName, PlatformID, GameID, ActiveStatus, Admin, PointsSys)
      VALUES ('LeagueName', 1, 1, 'Active', 'Test', 1); 
  </code></pre>
  
  <p>Calling SP does not - Returns error 'ERROR 1048 (23000): Column \'LeagueName\' cannot be null'</p>
  
  <pre><code>CALL `tmddg-data`.`SP_CreateLeague`('LeagueName', 1, 1, 'Active', 'Test', 1)
  </code></pre>
  
  <p>Create Table </p>
  
  <pre><code>CREATE TABLE `Leagues` (
    `LeagueID` int(11) NOT NULL AUTO_INCREMENT,
    `LeagueName` text NOT NULL,
    `PlatformID` int(11) NOT NULL,
    `GameID` int(11) NOT NULL,
    `ActiveStatus` text NOT NULL,
    `Admin` varchar(45) NOT NULL,
    `PointsSys` int(11) DEFAULT '1',
    PRIMARY KEY (`LeagueID`),
    UNIQUE KEY `LeagueID_UNIQUE` (`LeagueID`)
  ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  </code></pre>
  
  <p>Create SP</p>
  
  <pre><code>DELIMITER $$
  CREATE PROCEDURE `SP_CreateLeague`(
  LN TEXT,
  PID INT, 
  GID INT, 
  ASt TEXT, 
  ADM VARCHAR(45), 
  PS INT)
  BEGIN
      DECLARE exit handler for SQLEXCEPTION
      BEGIN
          GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE, 
          @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
          SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
          SELECT @full_error;
      END;
  
      INSERT INTO Leagues (LeagueName, PlatformID, GameID, ActiveStatus, Admin, PointsSys)
      VALUES ( @LN, @PID, @GID, @ASt, @ADM, @PS);
  END$$
  DELIMITER ;
  </code></pre>