Column 'order_Id' Cannot Be Null (1048)

Hello

I was hoping someone can help with this error. I'm using multi vendor 4.3.9 and I get this when someone logs into the store. I also tried adding a column named order_id and making sure it's not set to NULL but still no go

Column 'order_id' cannot be null (1048)

REPLACE INTO cscart_user_session_products (`user_id`, `timestamp`, `type`, `user_type`, `item_id`, `item_type`, `product_id`, `amount`, `price`, `session_id`, `ip_address`, `order_id`, `extra`) VALUES (7, 1470145263, 'C', 'R', 2219528071, 'P', 2261, 1, 315, '0cf7935c3d379449c39e488db1b9c37c-C', '319651a7', NULL, 'a:32:{s:7:\"user_id\";s:1:\"7\";s:9:\"timestamp\";s:10:\"1467552428\";s:4:\"type\";s:1:\"C\";s:9:\"user_type\";s:1:\"R\";s:7:\"item_id\";s:10:\"2219528071\";s:9:\"item_type\";s:1:\"P\";s:10:\"product_id\";i:2261;s:6:\"amount\";i:1;s:5:\"price\";d:315;s:10:\"session_id\";s:34:\"289a323488c0579e55a54a973cc8f63f-C\";s:10:\"ip_address\";s:8:\"31965798\";s:8:\"order_id\";N;s:12:\"product_code\";s:12:\"BKEX0200-E6L\";s:7:\"product\";s:24:\"Tim Burton Playing Cards\";s:15:\"product_options\";a:0:{}s:12:\"stored_price\";s:1:\"N\";s:9:\"main_pair\";a:5:{s:7:\"pair_id\";s:4:\"3168\";s:8:\"image_id\";s:1:\"0\";s:11:\"detailed_id\";s:4:\"3200\";s:8:\"position\";s:1:\"0\";s:8:\"detailed\";a:10:{s:9:\"object_id\";s:4:\"2261\";s:11:\"object_type\";s:7:\"product\";s:10:\"image_path\";s:59:\"http://www.blink.com.ph/images/detailed/3/9781596177376.jpg\";s:3:\"alt\";s:24:\"TimBurton Playing Cards\";s:7:\"image_x\";s:3:\"560\";s:7:\"image_y\";s:3:\"400\";s:15:\"http_image_path\";s:59:\"http://www.blink.com.ph/images/detailed/3/9781596177376.jpg\";s:16:\"https_image_path\";s:60:\"https://www.blink.com.ph/images/detailed/3/9781596177376.jpg\";s:13:\"absolute_path\";s:73:\"/var/www/vhosts/blink.com.ph/httpdocs/images/detailed/3/9781596177376.jpg\";s:13:\"relative_path\";s:28:\"detailed/3/9781596177376.jpg\";}}s:5:\"extra\";a:3:{s:15:\"product_options\";a:0:{}s:18:\"unlimited_download\";s:1:\"N\";s:13:\"return_period\";s:2:\"10\";}s:15:\"stored_discount\";s:1:\"N\";s:10:\"company_id\";s:1:\"2\";s:13:\"return_period\";s:2:\"10\";s:12:\"amount_total\";i:1;s:12:\"options_type\";s:1:\"P\";s:15:\"exceptions_type\";s:1:\"F\";s:15:\"modifiers_price\";d:0;s:6:\"is_edp\";s:1:\"N\";s:12:\"edp_shipping\";s:1:\"N\";s:8:\"discount\";i:0;s:10:\"promotions\";a:0:{}s:10:\"base_price\";d:315;s:12:\"category_ids\";a:5:{i:0;i:555;i:1;i:99;i:2;i:180;i:3;i:483;i:4;i:585;}s:13:\"display_price\";d:315;}')

Error at

app/Tygh/Database/Connection.php, line: 863

Backtrace

			File:
		
			app/Tygh/Database/Connection.php
	
			Line:
		
			458
	
			Function:
		
			<b>error</b>
	
			File:
		
			app/functions/fn.database.php
	
			Line:
		
			129
	
			Function:
		
			<b>query</b>
	
			File:
		
			app/functions/fn.cart.php
	
			Line:
		
			1552
	
			Function:
		
			<b>db_query</b>
	
			File:
		
			app/functions/fn.users.php
	
			Line:
		
			2974
	
			Function:
		
			<b>fn_save_cart_content</b>
	
			File:
		
			app/controllers/common/auth.php
	
			Line:
		
			177
	
			Function:
		
			<b>fn_user_logout</b>
	
			File:
		
			app/functions/fn.control.php
	
			Line:
		
			699
	
			Function:
		
			<b>include</b>
	
			File:
		
			app/functions/fn.control.php
	
			Line:
		
			455
	
			Function:
		
			<b>fn_run_controller</b>
	
			File:
		
			index.php
	
			Line:
		
			25
	
			Function:
		
			<b>fn_dispatch</b>
	<p> </p>

Please make sure that the order_id columns has the mediumint(8) DEFAULT NULL parameters

http://prntscr.com/c0o9aw

Please make sure that the order_id columns has the mediumint( 8) DEFAULT NULL parameters

http://prntscr.com/c0o9aw

thanks eComLabs. I actually did. Here's what i have http://prntscr.com/c0oedl

its working fine now. Sorry i took screenshot of the wrong DB. Made it NULL and issue disappeared. thanks

Glad to hear that the issue is solved

this problem occurred again. I was able to fix it by changing to NULL be default again. Any idea was is causing this to change?

thanks in advance.

this problem occurred again. I was able to fix it by changing to NULL be default again. Any idea was is causing this to change?

thanks in advance.

Please check last comment here:

http://forum.cs-cart.com/tracker/issue-6435-column-order-id-cannot-be-null-b1048b