Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
7f83c176
Commit
7f83c176
authored
Dec 11, 2003
by
antony@ltantony.rdg.cyberkinetica.homeunix.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for Bug #2075 - negative default values not accepted for integer columns
Allow numeric literals have a sign
parent
7576f1a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
5 deletions
+35
-5
mysql-test/r/create.result
mysql-test/r/create.result
+11
-0
mysql-test/t/create.test
mysql-test/t/create.test
+10
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+14
-5
No files found.
mysql-test/r/create.result
View file @
7f83c176
...
...
@@ -423,6 +423,17 @@ strnull varchar(10) YES NULL
intg int(11) YES NULL
rel double YES NULL
drop table t1, t2;
create table t1(name varchar(10), age smallint default -1);
describe t1;
Field Type Null Key Default Extra
name varchar(10) YES NULL
age smallint(6) YES -1
create table t2(name varchar(10), age smallint default - 1);
describe t2;
Field Type Null Key Default Extra
name varchar(10) YES NULL
age smallint(6) YES -1
drop table t1, t2;
create database test_$1;
use test_$1;
select database();
...
...
mysql-test/t/create.test
View file @
7f83c176
...
...
@@ -330,6 +330,16 @@ create table t2 select default(str) as str, default(strnull) as strnull, default
describe
t2
;
drop
table
t1
,
t2
;
#
# Bug #2075
#
create
table
t1
(
name
varchar
(
10
),
age
smallint
default
-
1
);
describe
t1
;
create
table
t2
(
name
varchar
(
10
),
age
smallint
default
-
1
);
describe
t2
;
drop
table
t1
,
t2
;
#
# Bug #1209
#
...
...
sql/sql_yacc.yy
View file @
7f83c176
...
...
@@ -627,6 +627,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
using_list expr_or_default set_expr_or_default interval_expr
param_marker singlerow_subselect singlerow_subselect_init
exists_subselect exists_subselect_init
NUM_literal
%type <item_list>
expr_list udf_expr_list when_list ident_list ident_list_arg
...
...
@@ -4409,11 +4410,8 @@ param_marker:
literal:
text_literal { $$ = $1; }
| NUM { $$ = new Item_int($1.str, (longlong) strtol($1.str, NULL, 10),$1.length); }
| LONG_NUM { $$ = new Item_int($1.str, (longlong) strtoll($1.str,NULL,10), $1.length); }
| ULONGLONG_NUM { $$ = new Item_uint($1.str, $1.length); }
| REAL_NUM { $$ = new Item_real($1.str, $1.length); }
| FLOAT_NUM { $$ = new Item_float($1.str, $1.length); }
| opt_plus NUM_literal { $$ = $2; }
| '-' NUM_literal { $$ = new Item_func_neg($2); }
| NULL_SYM { $$ = new Item_null();
Lex->next_state=MY_LEX_OPERATOR_OR_IDENT;}
| HEX_NUM { $$ = new Item_varbinary($1.str,$1.length);}
...
...
@@ -4429,6 +4427,17 @@ literal:
| TIME_SYM text_literal { $$ = $2; }
| TIMESTAMP text_literal { $$ = $2; };
opt_plus:
| '+' ;
NUM_literal:
NUM { $$ = new Item_int($1.str, (longlong) strtol($1.str, NULL, 10),$1.length); }
| LONG_NUM { $$ = new Item_int($1.str, (longlong) strtoll($1.str,NULL,10), $1.length); }
| ULONGLONG_NUM { $$ = new Item_uint($1.str, $1.length); }
| REAL_NUM { $$ = new Item_real($1.str, $1.length); }
| FLOAT_NUM { $$ = new Item_float($1.str, $1.length); }
;
/**********************************************************************
** Createing different items.
**********************************************************************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment