When adding a column to the database MySQL and Mariadb have to build the table as a temp table. This requires that you have enough disk space on your system to contain a full copy of the table.
You need to check the location of the temp tables in your my.ini file. Information regarding this can be found here:
https://dev.mysql.com/doc/refman/5.0/en/temporary-files.html
If you do not have the temp directory specified, then under windows, MySQL will default to 'C:\Windows\Temp'.
So, If you have a table that is 20G in size, and you want to add a column, you need to have a minimum of 20G on the drive configured for the temp tables.