title: Adding column with empty string as default value and not null constraint leads to inconsistent behaviour for oracle database
body: <p>I have trouble understanding what happens in the oracle database after this sql is executed:</p>
  
  <pre><code>CREATE TABLE EMPTYSTRING
  ( 
  COLUMNA VARCHAR2(1)
  );
  
  INSERT INTO EMPTYSTRING (COLUMNA) VALUES('X');
  
  ALTER TABLE EMPTYSTRING ADD
  (
  COLUMNB VARCHAR2(1) DEFAULT '' NOT NULL
  );
  </code></pre>
  
  <p>As I read, oracle treats empty strings as nulls. But then why is adding a column with a default "null" value and a constraint that says that values cannot be null legal?</p>
  
  <p>More importantly, since it is legal, how is this treated internaly?
  If we try</p>
  
  <pre><code>SELECT * FROM EMPTYSTRING WHERE COLUMNB='';
  SELECT * FROM EMPTYSTRING WHERE COLUMNB IS NULL;
  </code></pre>
  
  <p>we get no results. On the other hand, if we try</p>
  
  <pre><code>SELECT * FROM EMPTYSTRING;
  SELECT * FROM EMPTYSTRING WHERE TRIM(COLUMNB) IS NULL;
  </code></pre>
  
  <p>we get:</p>
  
  <pre><code>COLUMNA COLUMNB
  ------- -------
  X               
  </code></pre>
  
  <p>So what is really written in the database? Why does it behave this way?</p>
  
  <p>And if we try to insert a row without specifying a value for COLUMNB</p>
  
  <pre><code>INSERT INTO EMPTYSTRING (COLUMNA) VALUES('Y');
  </code></pre>
  
  <p>we get "cannot insert NULL" error so defaulting to empty string doesn't really work except for the rows that were in the table before we added COLUMNB.</p>